Create a price
create_priceCreate immutable product prices for one-time, subscription, fixed-term, lifetime, credit-pack, and pay-what-you-want models, with options for trials, caps, tiers, and refund terms.
Instructions
Create a price.
Every model: one_time, pay_what_you_want (with a minimum), fixed_term (N days of access), subscription (interval, trial, grace, prepay), lifetime (optional cap and cohort tiers), credit_pack. Amounts are immutable; make a new price to change one.
Body is one of: model = one_time: needs product, model, unit_amount; model = pay_what_you_want: needs product, model, custom_amount; model = fixed_term: needs product, model, unit_amount, term_days; model = subscription: needs product, model, unit_amount, recurring; model = lifetime: needs product, model; model = credit_pack: needs product, model, unit_amount, credits.
Test keys only: refused with a live key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| credits | No | Credits one pack holds. | |
| product | Yes | A product id, `prod_…`. | |
| refunds | No | Refund terms the buyer accepts at checkout. | |
| currency | No | USD or EUR. Default: your account's currency. | |
| lifetime | No | ||
| metadata | No | Your own key–value pairs (≤ 50 keys, values ≤ 500 characters). On an update they are merged in; an empty value removes its key. | |
| nickname | No | ||
| recurring | No | ||
| term_days | No | Days of access one purchase gives. | |
| unit_amount | No | ||
| custom_amount | No |