Skip to Content
Paycose Docs
Prices

Prices

The price object

A price sets how much a product costs, in which currency and how often it is billed: once, on a recurring interval, or per unit of usage reported to a meter. The amount and billing terms of a price can't be changed after it is created; create a new price instead, and archive the old one with active: false.

Attributes

  • idstringRequired

    Unique identifier for the object.

  • objectstringRequired

    String naming the object's type.

  • livemodebooleanRequired

    true when the object exists in live mode, false in test mode.

  • createdtimestampRequired

    Time the object was created, in Unix seconds.

  • updatedtimestampRequired

    Time the object last changed, in Unix seconds.

  • productstringRequired

    ID of the product this price belongs to.

  • currencystringRequired

    Three-letter ISO 4217 currency code, in lowercase.

  • amountintegerRequired

    Unit amount in the smallest currency unit (for example, 49900 is 499.00 THB). For a usage-based price it is charged per unit of usage. 0 for a tiered price created without amount and for a price set with a fractional unit_amount_decimal.

  • billing_schemestringRequired

    How the unit amount is worked out: per_unit uses amount, tiered uses tiers.

    • per_unit

      Each unit costs amount.

    • tiered

      The unit price comes from tiers.

  • recurring_intervalenumRequired

    Billing period of a recurring or usage-based price: day, week, month or year. Empty string for a one-time price.

    • A one-time price, billed once.

    • day

      Bills every recurring_interval_count days.

    • week

      Bills every recurring_interval_count weeks.

    • month

      Bills every recurring_interval_count months.

    • year

      Bills every recurring_interval_count years.

  • recurring_interval_countintegerRequired

    Number of recurring_intervals between billings; for example 3 with month bills every three months. 1 for a one-time price.

  • usage_typestringRequired

    metered for a usage-based price, which is billed on the usage reported to its meter; empty string otherwise.

    • metered

      Billed on the usage reported to the price's meter during each period.

  • scaling_factorintegerRequired

    Number of smallest currency units in one major unit of currency (for example, 100 for THB), so amount / scaling_factor is the amount in major units.

  • tiersarray of objectsRequiredNullable

    Tiers of a tiered price, in order. Each has up_to, the highest quantity the tier covers (null for the last, unbounded tier), unit_amount, the price per unit in the smallest currency unit, unit_amount_decimal in its place for a fractional unit price, and, when set, flat_amount, a fixed amount added once for the tier. Null when the price is not tiered.

    Show child attributes
    • tiers.up_tointegerRequiredNullable

      Highest quantity this tier covers; null on the last tier, which covers every quantity above the one before.

    • tiers.unit_amountintegerRequired

      Price per unit in this tier, in the smallest currency unit. 0 when the tier is priced with unit_amount_decimal.

    • tiers.unit_amount_decimalstringNullable

      Price per unit in this tier as a decimal string in the smallest currency unit, for a fractional unit price. Omitted when the tier is priced with unit_amount.

    • tiers.flat_amountinteger

      A fixed amount added once when the quantity reaches this tier, in the smallest currency unit. Omitted when the tier has none.

  • tiers_modestringRequiredNullable

    How a tiered price uses its tiers, as Stripe does. Null when the price is not tiered.

    • graduated

      The default. Units in each tier are priced at that tier's unit_amount, and the flat_amount of every tier the quantity reaches is added.

    • volume

      Every unit is priced at the tier the whole quantity falls in, plus that tier's flat_amount.

  • metadataobjectRequired

    Key-value pairs for your own use, set when the price is created; an update that sends metadata replaces it. {} when none was set.

  • unit_amount_decimalstringRequiredNullable

    Unit amount in the smallest currency unit as a decimal string with up to 12 decimal places, for example "0.04", for usage prices below one minor unit. Null when the price was created with amount or tiers.

  • unit_amountintegerRequiredNullable

    Unit amount in the smallest currency unit, as Stripe names it: the same as amount for a per-unit price. Null for a tiered price and for a price set with a fractional unit_amount_decimal.

  • recurringobjectRequiredNullable

    Billing schedule of a recurring or usage-based price, in Stripe's shape (interval, interval_count, usage_type, meter). Null for a one-time price.

    Show child attributes
    • recurring.intervalstringRequired

      Billing period: day, week, month or year.

      • day

        Bills every interval_count days.

      • week

        Bills every interval_count weeks.

      • month

        Bills every interval_count months.

      • year

        Bills every interval_count years.

    • recurring.interval_countintegerRequired

      Number of intervals between billings; for example 3 with month bills every three months.

    • recurring.usage_typestringRequired

      licensed bills the subscription quantity each period; metered bills the usage reported to meter during the period.

      • licensed

        Billed on the quantity of the subscription item.

      • metered

        Billed on the usage reported to the meter during each period.

    • recurring.meterstringRequiredNullable

      ID of the meter a metered price bills from. Null otherwise.

  • activebooleanRequired

    Whether the price can be used on new documents. false once the price is archived with PATCH /prices/{id}: it stays readable, and the invoices, quotes and subscriptions that already bill it keep it, but a new invoice, quote, subscription or checkout line naming it is refused. Send active: true to restore it.

  • tax_behaviorstringRequired

    Whether amount includes tax, as Stripe's tax_behavior. Set when the price is created and fixed afterwards.

    • inclusive

      The amount includes tax: every tax rate on a line of this price is taken out of it, even a rate created as exclusive, so a ¥1,100 price at 10% is ¥1,000 plus ¥100 of tax.

    • exclusive

      The amount excludes tax, so every tax rate on a line of this price is added on top of it.

    • unspecified

      Each tax rate's own inclusive setting decides whether it is inside the amount or added on top.