View Source ExOAPI.Stripe.SDK.Skus (exoapi_stripe v0.1.4)

Link to this section Summary

Functions

description: <p>Delete a SKU. Deleting a SKU is only possible until it has been used in an order.</p>

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

description: <p>Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.</p>

description: <p>Creates a new SKU associated with a product.</p>

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

Link to this section Types

@type get_skus_id_opts() :: {:expand, String.t()}
@type get_skus_opts() ::
  {:starting_after, String.t()}
  | {:product, String.t()}
  | {:limit, String.t()}
  | {:in_stock, String.t()}
  | {:ids, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
  | {:attributes, String.t()}
  | {:active, String.t()}

Link to this section Functions

Link to this function

delete_skus_id(client, body, id)

View Source
@spec delete_skus_id(
  client :: ExOAPI.Client.t(),
  body :: %{} | map(),
  id :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.DeletedSku.t()
   | map()}
  | {:error, any()}

description: <p>Delete a SKU. Deleting a SKU is only possible until it has been used in an order.</p>

Link to this function

get_skus(client, opts \\ [])

View Source
@spec get_skus(client :: ExOAPI.Client.t(), [get_skus_opts()]) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       object: String.t() | :list,
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.Sku.t()]
     }
   | map()}
  | {:error, any()}

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

Link to this function

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

View Source
@spec get_skus_id(client :: ExOAPI.Client.t(), id :: String.t(), [get_skus_id_opts()]) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.DeletedSku.t()
   | ExOAPI.Stripe.Schemas.Sku.t()
   | map()}
  | {:error, any()}

description: <p>Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.</p>

@spec post_skus(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      product: String.t(),
      price: integer(),
      package_dimensions: %{
        width: number(),
        weight: number(),
        length: number(),
        height: number()
      },
      metadata: map(),
      inventory: %{
        value: String.t() | :in_stock | :limited | :out_of_stock,
        type: String.t() | :bucket | :finite | :infinite,
        quantity: integer()
      },
      image: String.t(),
      id: String.t(),
      expand: [String.t()],
      currency: String.t(),
      attributes: map(),
      active: boolean()
    }
    | map()
) ::
  {:ok, ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Sku.t() | map()}
  | {:error, any()}

description: <p>Creates a new SKU associated with a product.</p>

Link to this function

post_skus_id(client, body, id)

View Source
@spec post_skus_id(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      product: String.t(),
      price: integer(),
      package_dimensions:
        String.t()
        | %{
            width: number(),
            weight: number(),
            length: number(),
            height: number()
          },
      metadata: String.t() | map(),
      inventory: %{
        value: String.t() | :in_stock | :limited | :out_of_stock,
        type: String.t() | :bucket | :finite | :infinite,
        quantity: integer()
      },
      image: String.t(),
      expand: [String.t()],
      currency: String.t(),
      attributes: map(),
      active: boolean()
    }
    | map(),
  id :: String.t()
) ::
  {:ok, ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Sku.t() | map()}
  | {:error, any()}

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

Note that a SKU’s attributes are not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.