Price
Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.
For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.
Related guides: Set up a subscription, create an invoice, and more about products and prices.
Summary
Types
@type t() :: %Stripe.Resources.Price{ active: boolean(), billing_scheme: String.t(), created: integer(), currency: String.t(), currency_options: %{required(String.t()) => Stripe.Resources.Price.CurrencyOptions.t()} | nil, custom_unit_amount: Stripe.Resources.Price.CustomUnitAmount.t(), id: String.t(), livemode: boolean(), lookup_key: String.t(), metadata: %{required(String.t()) => String.t()}, nickname: String.t(), object: String.t(), product: String.t() | Stripe.Resources.Product.t(), recurring: Stripe.Resources.Price.Recurring.t(), tax_behavior: String.t(), tiers: [Stripe.Resources.Price.Tiers.t()] | nil, tiers_mode: String.t(), transform_quantity: Stripe.Resources.Price.TransformQuantity.t(), type: String.t(), unit_amount: integer(), unit_amount_decimal: String.t() }
active- Whether the price can be used for new purchases.billing_scheme- Describes how to compute the price per period. Eitherper_unitortiered.per_unitindicates that the fixed amount (specified inunit_amountorunit_amount_decimal) will be charged per unit inquantity(for prices withusage_type=licensed), or per unit of total usage (for prices withusage_type=metered).tieredindicates that the unit pricing will be computed using a tiering strategy as defined using thetiersandtiers_modeattributes. Possible values:per_unit,tiered.created- Time at which the object was created. Measured in seconds since the Unix epoch. Format: Unix timestamp.currency- Three-letter ISO currency code, in lowercase. Must be a supported currency. Format: ISO 4217 currency code.currency_options- Prices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency. Expandable.custom_unit_amount- When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. Nullable. Expandable.id- Unique identifier for the object. Max length: 5000.livemode- Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.lookup_key- A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. Max length: 5000. Nullable.metadata- Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.nickname- A brief description of the price, hidden from customers. Max length: 5000. Nullable.object- String representing the object's type. Objects of the same type share the same value. Possible values:price.product- The ID of the product this price is associated with. Expandable.recurring- The recurring components of a price such asintervalandusage_type. Nullable. Expandable.tax_behavior- Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One ofinclusive,exclusive, orunspecified. Once specified as eitherinclusiveorexclusive, it cannot be changed. Possible values:exclusive,inclusive,unspecified. Nullable.tiers- Each element represents a pricing tier. This parameter requiresbilling_schemeto be set totiered. See also the documentation forbilling_scheme. Expandable.tiers_mode- Defines if the tiering price should begraduatedorvolumebased. Involume-based tiering, the maximum quantity within a period determines the per unit price. Ingraduatedtiering, pricing can change as the quantity grows. Possible values:graduated,volume. Nullable.transform_quantity- Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined withtiers. Nullable. Expandable.type- One ofone_timeorrecurringdepending on whether the price is for a one-time purchase or a recurring (subscription) purchase. Possible values:one_time,recurring.unit_amount- The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set ifbilling_scheme=per_unit. Nullable.unit_amount_decimal- The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set ifbilling_scheme=per_unit. Format: decimal string. Nullable.