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