View Source ExOAPI.Stripe.SDK.Orders (exoapi_stripe v0.1.2)

Link to this section Summary

Functions

description: <p>Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.</p>

description: <p>Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.</p>

description: <p>Creates a new order object.</p>

description: <p>Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.</p>

description: <p>Pay an order by providing a <code>source</code> to create a payment.</p>

description: <p>Return all or part of an order. The order must have a status of <code>paid</code> or <code>fulfilled</code> before it can be returned. Once all items have been returned, the order will become <code>canceled</code> or <code>returned</code> depending on which status the order started in.</p>

Link to this section Types

@type get_orders_id_opts() :: {:expand, String.t()}
@type get_orders_opts() ::
  {:upstream_ids, String.t()}
  | {:status_transitions, String.t()}
  | {:status, String.t()}
  | {:starting_after, String.t()}
  | {:limit, String.t()}
  | {:ids, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
  | {:customer, String.t()}
  | {:created, String.t()}

Link to this section Functions

Link to this function

get_orders(client, opts \\ [])

View Source
@spec get_orders(client :: ExOAPI.Client.t(), [get_orders_opts()]) ::
  {:ok, any()} | {:error, any()}

description: <p>Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.</p>

Link to this function

get_orders_id(client, id, opts \\ [])

View Source
@spec get_orders_id(client :: ExOAPI.Client.t(), id :: String.t(), [
  get_orders_id_opts()
]) ::
  {:ok, any()} | {:error, any()}

description: <p>Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information.</p>

Link to this function

post_orders(client, body)

View Source
@spec post_orders(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      shipping: %{
        phone: String.t(),
        name: String.t(),
        address: %{
          state: String.t(),
          postal_code: String.t(),
          line2: String.t(),
          line1: String.t(),
          country: String.t(),
          city: String.t()
        }
      },
      metadata: map(),
      items: [
        %{
          type: String.t() | :discount | :shipping | :sku | :tax,
          quantity: integer(),
          parent: String.t(),
          description: String.t(),
          currency: String.t(),
          amount: integer()
        }
      ],
      expand: [String.t()],
      email: String.t(),
      customer: String.t(),
      currency: String.t(),
      coupon: String.t()
    }
    | map()
) :: {:ok, any()} | {:error, any()}

description: <p>Creates a new order object.</p>

Link to this function

post_orders_id(client, body, id)

View Source
@spec post_orders_id(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      status:
        String.t() | :canceled | :created | :fulfilled | :paid | :returned,
      shipping: %{tracking_number: String.t(), carrier: String.t()},
      selected_shipping_method: String.t(),
      metadata: String.t() | map(),
      expand: [String.t()],
      coupon: String.t()
    }
    | map(),
  id :: String.t()
) :: {:ok, any()} | {:error, any()}

description: <p>Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.</p>

Link to this function

post_orders_id_pay(client, body, id)

View Source
@spec post_orders_id_pay(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      source: String.t(),
      metadata: map(),
      expand: [String.t()],
      email: String.t(),
      customer: String.t(),
      application_fee: integer()
    }
    | map(),
  id :: String.t()
) :: {:ok, any()} | {:error, any()}

description: <p>Pay an order by providing a <code>source</code> to create a payment.</p>

Link to this function

post_orders_id_returns(client, body, id)

View Source
@spec post_orders_id_returns(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      items:
        String.t()
        | [
            %{
              type: String.t() | :discount | :shipping | :sku | :tax,
              quantity: integer(),
              parent: String.t(),
              description: String.t(),
              amount: integer()
            }
          ],
      expand: [String.t()]
    }
    | map(),
  id :: String.t()
) :: {:ok, any()} | {:error, any()}

description: <p>Return all or part of an order. The order must have a status of <code>paid</code> or <code>fulfilled</code> before it can be returned. Once all items have been returned, the order will become <code>canceled</code> or <code>returned</code> depending on which status the order started in.</p>