shopify v0.4.0 Shopify.Order.Fulfillment

Link to this section Summary

Functions

Requests all resources

Request to cancel a fulfillment

Request to mark a fulfillment as complete

Requests the resource count

Requests to create a new resource

Request to transition a fulfillment from pending to open

Requests to update a resource by id

Link to this section Functions

Link to this function all(session, top_id, params \\ %{})

Requests all resources.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • top_id: The id of the top-level resource.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.Transaction.all(order_id)
{:ok, %Shopify.Response{}}
Link to this function cancel(session, top_id, nest_id)
cancel(
  %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()
  },
  integer(),
  integer()
) ::
  {:ok,
   %Shopify.Order.Fulfillment{
     created_at: term(),
     id: term(),
     line_items: term(),
     location_id: term(),
     notify_customer: term(),
     order_id: term(),
     receipt: term(),
     service: term(),
     shipment_status: term(),
     status: term(),
     tracking_company: term(),
     tracking_number: term(),
     tracking_numbers: term(),
     tracking_url: term(),
     tracking_urls: term(),
     updated_at: term(),
     variant_inventory_management: term()
   }}
  | {:error, map()}

Request to cancel a fulfillment.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • top_id: The id of the top level resource.
  • nest_id: The id of the requested nested resource.

Examples

iex> Shopify.session |> Shopify.Fulfillment.cancel(1, 1)
{:ok, %Shopify.Response{}}
Link to this function complete(session, top_id, nest_id)
complete(
  %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()
  },
  integer(),
  integer()
) ::
  {:ok,
   %Shopify.Order.Fulfillment{
     created_at: term(),
     id: term(),
     line_items: term(),
     location_id: term(),
     notify_customer: term(),
     order_id: term(),
     receipt: term(),
     service: term(),
     shipment_status: term(),
     status: term(),
     tracking_company: term(),
     tracking_number: term(),
     tracking_numbers: term(),
     tracking_url: term(),
     tracking_urls: term(),
     updated_at: term(),
     variant_inventory_management: term()
   }}
  | {:error, map()}

Request to mark a fulfillment as complete.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • top_id: The id of the top level resource.
  • nest_id: The id of the requested nested resource.

Examples

iex> Shopify.session |> Shopify.Fulfillment.complete(1, 1)
{:ok, %Shopify.Response{}}
Link to this function count(session, top_id, params \\ %{})

Requests the resource count.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • top_id: The id of the top-level resource.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.Transaction.count(order_id)
{:ok, %Shopify.Response{}}
Link to this function create(session, top_id, new_resource)

Requests to create a new resource.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • top_id: The id of the top-level resource.
  • new_resource: A struct of the resource being created.

Examples

iex> Shopify.session |> Shopify.Transaction.create(order_id)
{:ok, %Shopify.Response{}}
Link to this function find(session, top_id, nest_id, params \\ %{})

Requests a resource by id.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • top_id: The id of the top-level resource.
  • nest_id: The id of the nest-level resource.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.Transaction.find(order_id, transaction_id)
{:ok, %Shopify.Response{}}
Link to this function open(session, top_id, nest_id)
open(
  %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()
  },
  integer(),
  integer()
) ::
  {:ok,
   %Shopify.Order.Fulfillment{
     created_at: term(),
     id: term(),
     line_items: term(),
     location_id: term(),
     notify_customer: term(),
     order_id: term(),
     receipt: term(),
     service: term(),
     shipment_status: term(),
     status: term(),
     tracking_company: term(),
     tracking_number: term(),
     tracking_numbers: term(),
     tracking_url: term(),
     tracking_urls: term(),
     updated_at: term(),
     variant_inventory_management: term()
   }}
  | {:error, map()}

Request to transition a fulfillment from pending to open.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • top_id: The id of the top level resource.
  • nest_id: The id of the requested nested resource.

Examples

iex> Shopify.session |> Shopify.Fulfillment.open(1, 1)
{:ok, %Shopify.Response{}}
Link to this function update(session, top_id, nest_id, updated_resource)

Requests to update a resource by id.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • top_id: The id of the top-level resource.
  • nest_id: The id of the nested-level resource.
  • updated_resource: A struct of the resource being updated.

Examples

iex> Shopify.session |> Shopify.CustomerAddress.update(customer_id, address_id)
{:ok, %Shopify.Response{}}