shopify v0.4.0 Shopify.DraftOrder

Link to this section Summary

Functions

Requests all resources

Requests to complete the order

Requests the resource count

Requests to create a new resource

Requests to delete a resource by id

Requests a resource by id

Requests to send an invoice for the draft order

Requests to update a resource by id

Link to this section Functions

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

Requests all resources.

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

Parameters

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

Examples

iex> Shopify.session |> Shopify.Product.all
{:ok, %Shopify.Response{}}
Link to this function complete(session, id, params \\ %{})

Requests to complete the order.

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

Parameters

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

Examples

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

Requests the resource count.

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

Parameters

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

Examples

iex> Shopify.session |> Shopify.Product.count
{:ok, %Shopify.Response{}}
Link to this function create(session, new_resource)
create(
  %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, list()} | {:error, map()}

Requests to create a new resource.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • new_resource: A struct of the resource being created.

Examples

iex> Shopify.session |> Shopify.Product.create(%Shopify.Product{})
{: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 find(session, id, params \\ %{})

Requests a resource by id.

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

Parameters

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

Examples

iex> Shopify.session |> Shopify.Product.find(id)
{:ok, %Shopify.Response{}}
Link to this function send_invoice(session, id, draft_order_invoice)
send_invoice(
  %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(),
  %Shopify.DraftOrder.DraftOrderInvoice{
    bcc: term(),
    custom_message: term(),
    from: term(),
    subject: term(),
    to: term()
  }
) ::
  {:ok,
   %Shopify.DraftOrder{
     applied_discount: term(),
     billing_address: term(),
     completed_at: term(),
     created_at: term(),
     currency: term(),
     customer: term(),
     email: term(),
     id: term(),
     invoice_sent_at: term(),
     invoice_url: term(),
     line_items: term(),
     name: term(),
     note: term(),
     note_attributes: term(),
     order_id: term(),
     shipping_address: term(),
     shipping_line: term(),
     status: term(),
     subtotal_price: term(),
     tags: term(),
     tax_exempt: term(),
     tax_lines: term(),
     taxes_included: term(),
     total_price: term(),
     total_tax: term(),
     updated_at: term()
   }}
  | {:error, map()}

Requests to send an invoice for the draft order.

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

Parameters

  • session: A %Shopify.Session{} struct.
  • id: The id of the draft order.
  • draft_order_invoice: A %Shopify.DraftOrder.DraftOrderInvoice{} struct.

Examples

iex> Shopify.session |> Shopify.DraftOrder.send_invoice(1, %Shopify.DraftOrder.DraftOrderInvoice{})
{:ok, %Shopify.Response{}}
Link to this function update(session, id, updated_resource)

Requests to update a resource by id.

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

Parameters

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

Examples

iex> Shopify.session |> Shopify.Product.update(id, %Shopify.Product{})
{:ok, %Shopify.Response{}}