stripity_stripe v2.7.0 Stripe.Relay.Product View Source
Work with Stripe products.
Stripe API reference: https://stripe.com/docs/api#products
Link to this section Summary
Functions
Create a product.
Delete a product.
List all product.
Retrieve a product.
Update a product.
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %Stripe.Relay.Product{
active: boolean(),
attributes: %{optional(String.t()) => String.t()},
caption: String.t(),
created: Stripe.timestamp(),
deactivate_on: [Stripe.id()],
deleted: boolean() | nil,
description: String.t(),
id: Stripe.id(),
images: [String.t()],
livemode: boolean(),
metadata: Stripe.Types.metadata(),
name: String.t(),
object: String.t(),
package_dimensions:
nil | %{height: float(), length: float(), weight: float(), width: float()},
shippable: boolean(),
statement_descriptor: String.t(),
unit_label: String.t(),
updated: Stripe.timestamp(),
url: String.t()
}
t() :: %Stripe.Relay.Product{ active: boolean(), attributes: %{optional(String.t()) => String.t()}, caption: String.t(), created: Stripe.timestamp(), deactivate_on: [Stripe.id()], deleted: boolean() | nil, description: String.t(), id: Stripe.id(), images: [String.t()], livemode: boolean(), metadata: Stripe.Types.metadata(), name: String.t(), object: String.t(), package_dimensions: nil | %{height: float(), length: float(), weight: float(), width: float()}, shippable: boolean(), statement_descriptor: String.t(), unit_label: String.t(), updated: Stripe.timestamp(), url: String.t() }
Link to this section Functions
Link to this function
create(params, opts \\ [])
View Source
create(params, opts \\ [])
View Source
create(params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()}
when params:
%{
optional(:caption) => String.t(),
optional(:deactive_on) => [Stripe.id()],
optional(:description) => String.t(),
optional(:id) => String.t(),
optional(:images) => [Stripe.id()],
optional(:description) => String.t(),
optional(:attributes) => list(),
:name => String.t(),
:type => String.t(),
optional(:metadata) => Stripe.Types.metadata(),
optional(:package_dimensions) => map(),
optional(:shippable) => boolean(),
optional(:url) => String.t()
}
| %{}
create(params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ optional(:caption) => String.t(), optional(:deactive_on) => [Stripe.id()], optional(:description) => String.t(), optional(:id) => String.t(), optional(:images) => [Stripe.id()], optional(:description) => String.t(), optional(:attributes) => list(), :name => String.t(), :type => String.t(), optional(:metadata) => Stripe.Types.metadata(), optional(:package_dimensions) => map(), optional(:shippable) => boolean(), optional(:url) => String.t() } | %{}
Create a product.
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 a product.
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(:created) => Stripe.date_query(),
optional(:ending_before) => t() | Stripe.id(),
optional(:ids) => Stripe.List.t(Stripe.id()),
optional(:limit) => 1..100,
optional(:shippable) => boolean(),
optional(:starting_after) => t() | Stripe.id(),
optional(:type) => String.t(),
optional(:url) => String.t()
}
| %{}
list(params, Stripe.options()) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.Error.t()} when params: %{ optional(:active) => boolean(), optional(:created) => Stripe.date_query(), optional(:ending_before) => t() | Stripe.id(), optional(:ids) => Stripe.List.t(Stripe.id()), optional(:limit) => 1..100, optional(:shippable) => boolean(), optional(:starting_after) => t() | Stripe.id(), optional(:type) => String.t(), optional(:url) => String.t() } | %{}
List all product.
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 product.
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) => list(),
optional(:caption) => String.t(),
optional(:deactive_on) => [Stripe.id()],
optional(:description) => String.t(),
optional(:images) => [Stripe.id()],
optional(:metadata) => Stripe.Types.metadata(),
optional(:name) => String.t(),
optional(:package_dimensions) => map(),
optional(:shippable) => boolean(),
optional(:url) => String.t()
}
| %{}
update(Stripe.id() | t(), params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ optional(:active) => boolean(), optional(:attributes) => list(), optional(:caption) => String.t(), optional(:deactive_on) => [Stripe.id()], optional(:description) => String.t(), optional(:images) => [Stripe.id()], optional(:metadata) => Stripe.Types.metadata(), optional(:name) => String.t(), optional(:package_dimensions) => map(), optional(:shippable) => boolean(), optional(:url) => String.t() } | %{}
Update a product.
Takes the id
and a map of changes.