stripity_stripe v2.7.0 Stripe.Sku View Source
Work with Stripe Sku objects.
Stripe API reference: https://stripe.com/docs/api#sku_object
Link to this section Summary
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %Stripe.Sku{
active: boolean(),
attributes: %{optional(String.t()) => String.t()},
created: Stripe.timestamp(),
currency: String.t(),
id: Stripe.id(),
image: String.t(),
inventory: %{
quantity: non_neg_integer() | nil,
type: String.t(),
value: String.t() | nil
},
livemode: boolean(),
metadata: Stripe.Types.metadata(),
object: String.t(),
package_dimensions:
%{height: float(), length: float(), weight: float(), width: float()} | nil,
price: non_neg_integer(),
product: Stripe.id() | Stripe.Relay.Product.t(),
updated: Stripe.timestamp()
}
t() :: %Stripe.Sku{ active: boolean(), attributes: %{optional(String.t()) => String.t()}, created: Stripe.timestamp(), currency: String.t(), id: Stripe.id(), image: String.t(), inventory: %{ quantity: non_neg_integer() | nil, type: String.t(), value: String.t() | nil }, livemode: boolean(), metadata: Stripe.Types.metadata(), object: String.t(), package_dimensions: %{height: float(), length: float(), weight: float(), width: float()} | nil, price: non_neg_integer(), product: Stripe.id() | Stripe.Relay.Product.t(), updated: Stripe.timestamp() }
Link to this section Functions
Link to this function
create(params, opts \\ [])
View Source
create(params, opts \\ [])
View Source
create(params, Keyword.t()) :: {:ok, t()} | {:error, Stripe.Error.t()}
when params: %{
:currency => String.t(),
:inventory => map(),
:price => non_neg_integer(),
:product => Stripe.id() | Stripe.Relay.Product.t(),
optional(:active) => boolean(),
optional(:attributes) => map(),
optional(:image) => String.t(),
optional(:metadata) => Stripe.Types.metadata(),
optional(:package_dimensions) => map()
}
create(params, Keyword.t()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ :currency => String.t(), :inventory => map(), :price => non_neg_integer(), :product => Stripe.id() | Stripe.Relay.Product.t(), optional(:active) => boolean(), optional(:attributes) => map(), optional(:image) => String.t(), optional(:metadata) => Stripe.Types.metadata(), optional(:package_dimensions) => map() }
Create a order.
Link to this function
delete(id, opts \\ [])
View Source
delete(id, opts \\ [])
View Source
delete(Stripe.id() | t(), Stripe.options()) ::
{:ok, t()} | {:error, Stripe.Error.t()}
delete(Stripe.id() | t(), Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()}
delete an order.
Link to this function
list(params \\ %{}, opts \\ [])
View Source
list(params \\ %{}, opts \\ [])
View Source
list(params, Stripe.options()) ::
{:ok, Stripe.List.t(t())} | {:error, Stripe.Error.t()}
when params: %{
optional(:active) => boolean(),
optional(:attributes) => map(),
optional(:ending_before) => t() | Stripe.id(),
optional(:ids) => Stripe.List.t(Stripe.id()),
optional(:in_stock) => boolean(),
optional(:limit) => 1..100,
optional(:product) => Stripe.id() | Stripe.Relay.Product.t(),
optional(:starting_after) => t() | Stripe.id()
}
list(params, Stripe.options()) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.Error.t()} when params: %{ optional(:active) => boolean(), optional(:attributes) => map(), optional(:ending_before) => t() | Stripe.id(), optional(:ids) => Stripe.List.t(Stripe.id()), optional(:in_stock) => boolean(), optional(:limit) => 1..100, optional(:product) => Stripe.id() | Stripe.Relay.Product.t(), optional(:starting_after) => t() | Stripe.id() }
List all skus.
Link to this function
retrieve(id, opts \\ [])
View Source
retrieve(id, opts \\ [])
View Source
retrieve(Stripe.id() | t(), Stripe.options()) ::
{:ok, t()} | {:error, Stripe.Error.t()}
retrieve(Stripe.id() | t(), Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()}
Retrieve a order.
Link to this function
update(id, params, opts \\ [])
View Source
update(id, params, opts \\ [])
View Source
update(Stripe.id() | t(), params, Stripe.options()) ::
{:ok, t()} | {:error, Stripe.Error.t()}
when params: %{
optional(:active) => boolean(),
optional(:attributes) => map(),
optional(:currency) => String.t(),
optional(:image) => String.t(),
optional(:inventory) => map(),
optional(:metadata) => Stripe.Types.metadata(),
optional(:package_dimensions) => map(),
optional(:price) => non_neg_integer(),
optional(:product) => Stripe.id() | Stripe.Relay.Product.t()
}
update(Stripe.id() | t(), params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ optional(:active) => boolean(), optional(:attributes) => map(), optional(:currency) => String.t(), optional(:image) => String.t(), optional(:inventory) => map(), optional(:metadata) => Stripe.Types.metadata(), optional(:package_dimensions) => map(), optional(:price) => non_neg_integer(), optional(:product) => Stripe.id() | Stripe.Relay.Product.t() }
Update a order.
Takes the id
and a map of changes