stripity_stripe v2.7.0 Stripe.SubscriptionItem View Source
Work with Stripe subscription item objects.
Stripe API reference: https://stripe.com/docs/api#subscription_items
Link to this section Summary
Functions
Create a subscription item.
Delete a subscription.
List all subscriptions.
Retrieve a subscription.
Update a subscription item.
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %Stripe.SubscriptionItem{
billing_thresholds: Stripe.Types.subscription_billing_thresholds() | nil,
created: Stripe.timestamp(),
deleted: boolean() | nil,
id: Stripe.id(),
metadata: Stripe.Types.metadata(),
object: String.t(),
plan: Stripe.Plan.t(),
quantity: non_neg_integer(),
subscription: Stripe.id() | Stripe.Subscription.t() | nil,
tax_rates: [Stripe.TaxRate.t()]
}
t() :: %Stripe.SubscriptionItem{ billing_thresholds: Stripe.Types.subscription_billing_thresholds() | nil, created: Stripe.timestamp(), deleted: boolean() | nil, id: Stripe.id(), metadata: Stripe.Types.metadata(), object: String.t(), plan: Stripe.Plan.t(), quantity: non_neg_integer(), subscription: Stripe.id() | Stripe.Subscription.t() | nil, tax_rates: [Stripe.TaxRate.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: %{
:plan => Stripe.id() | Stripe.Plan.t(),
:subscription => Stripe.id() | Stripe.Subscription.t(),
optional(:metadata) => Stripe.Types.metadata(),
optional(:prorate) => boolean(),
optional(:proration_date) => Stripe.timestamp(),
optional(:quantity) => float(),
optional(:tax_rates) => [String.t()]
}
create(params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ :plan => Stripe.id() | Stripe.Plan.t(), :subscription => Stripe.id() | Stripe.Subscription.t(), optional(:metadata) => Stripe.Types.metadata(), optional(:prorate) => boolean(), optional(:proration_date) => Stripe.timestamp(), optional(:quantity) => float(), optional(:tax_rates) => [String.t()] }
Create a subscription item.
Link to this function
delete(id, params \\ %{}, opts \\ [])
View Source
delete(id, params \\ %{}, opts \\ [])
View Source
delete(Stripe.id() | t(), params, Stripe.options()) ::
{:ok, t()} | {:error, Stripe.Error.t()}
when params: %{
optional(:clear_usage) => boolean(),
optional(:prorate) => boolean(),
optional(:proration_date) => Stripe.timestamp()
}
delete(Stripe.id() | t(), params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ optional(:clear_usage) => boolean(), optional(:prorate) => boolean(), optional(:proration_date) => Stripe.timestamp() }
Delete a subscription.
Takes the id
and an optional map of params
.
Link to this function
list(id, params \\ %{}, opts \\ [])
View Source
list(id, params \\ %{}, opts \\ [])
View Source
list(Stripe.id(), params, Stripe.options()) ::
{:ok, Stripe.List.t(t())} | {:error, Stripe.Error.t()}
when params: %{
optional(:ending_before) => t() | Stripe.id(),
optional(:limit) => 1..100,
optional(:starting_after) => t() | Stripe.id()
}
list(Stripe.id(), params, Stripe.options()) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.Error.t()} when params: %{ optional(:ending_before) => t() | Stripe.id(), optional(:limit) => 1..100, optional(:starting_after) => t() | Stripe.id() }
List all subscriptions.
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 subscription.
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(:metadata) => Stripe.Types.metadata(),
optional(:plan) => Stripe.id() | Stripe.Plan.t(),
optional(:prorate) => boolean(),
optional(:proration_date) => Stripe.timestamp(),
optional(:quantity) => float(),
optional(:tax_rates) => [String.t()]
}
update(Stripe.id() | t(), params, Stripe.options()) :: {:ok, t()} | {:error, Stripe.Error.t()} when params: %{ optional(:metadata) => Stripe.Types.metadata(), optional(:plan) => Stripe.id() | Stripe.Plan.t(), optional(:prorate) => boolean(), optional(:proration_date) => Stripe.timestamp(), optional(:quantity) => float(), optional(:tax_rates) => [String.t()] }
Update a subscription item.
Takes the id
and a map of changes.