shopify v0.4.0 Shopify.InventoryLevel

Link to this section Summary

Functions

Adjusts the inventory for a given inventory item at a given location

Requests all resources. Needs an array of inventory item ids or location ids as parameters!

Connects a given inventory with a location

Requests to delete a resource by id

Sets available inventory for a given inventory item at given location

Link to this section Functions

Link to this function adjust(session, inventory_level)
adjust(
  %Shopify.Session{
    access_token: term(),
    api_key: term(),
    api_version: term(),
    client_id: term(),
    client_secret: term(),
    password: term(),
    req_opts: term(),
    shop_name: term(),
    type: term()
  },
  map()
) :: {:ok, Shopify.Response.t()} | {:error, Shopify.Response.t()}

Adjusts the inventory for a given inventory item at a given location.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.InventoryLevel.adjust(%{inventory_item_id: 123, location_id: 123, available_adjustment: 123})
{:ok, %Shopify.Response{}}
Link to this function all(session, params)
all(
  %Shopify.Session{
    access_token: term(),
    api_key: term(),
    api_version: term(),
    client_id: term(),
    client_secret: term(),
    password: term(),
    req_opts: term(),
    shop_name: term(),
    type: term()
  },
  map()
) :: {:ok, Shopify.Response.t()} | {:error, Shopify.Response.t()}

Requests all resources. Needs an array of inventory item ids or location ids as parameters!

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • params: Can be inventory_item_ids or location_ids or both.

Examples

iex> Shopify.session |> Shopify.InventoryLevel.all(%{inventory_item_ids: [123]})
{:ok, %Shopify.Response{}}
Link to this function connect(session, connection)
connect(
  %Shopify.Session{
    access_token: term(),
    api_key: term(),
    api_version: term(),
    client_id: term(),
    client_secret: term(),
    password: term(),
    req_opts: term(),
    shop_name: term(),
    type: term()
  },
  map()
) :: {:ok, Shopify.Response.t()} | {:error, Shopify.Response.t()}

Connects a given inventory with a location.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.InventoryLevel.connect(%{inventory_item_id: 123, location_id: 123})
{:ok, %Shopify.Response{}}
Link to this function delete(session, id)

Requests to delete a resource by id.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • id: The id of the resource.

Examples

iex> Shopify.session |> Shopify.Product.delete(id)
{:ok, %Shopify.Response{}}
Link to this function set(session, inventory)
set(
  %Shopify.Session{
    access_token: term(),
    api_key: term(),
    api_version: term(),
    client_id: term(),
    client_secret: term(),
    password: term(),
    req_opts: term(),
    shop_name: term(),
    type: term()
  },
  map()
) :: {:ok, Shopify.Response.t()} | {:error, Shopify.Response.t()}

Sets available inventory for a given inventory item at given location.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.InventoryLevel.set(%{inventory_item_id: 123, location_id: 123, available: 5})
{:ok, %Shopify.Response{}}