Prices
A price is what one product costs, in USD cents, and how often it’s charged. A product can have several prices, for example retail and wholesale terms. One-time prices are charged on invoices and checkout sessions, and recurring prices are billed through subscriptions.
The Price object
- Name
object
- Type
- "price",
- Description
- The object's type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
trueif the object is live, orfalseif it's in a sandbox.
- Name
created_at
- Type
- integer,
- Description
- When the object was created, in milliseconds since the Unix epoch.
- Name
active
- Type
- boolean,
- Description
- Whether the price can be used for new purchases.
- Name
amount
- Type
- integer, at least 0,
- Description
- The amount in cents.
- Name
deleted
- Type
- boolean,
- Description
- Whether the price has been deleted.
- Name
metadata
- Type
- object,
- Description
- Your own key-value data on the object.
- Name
name
- Type
- string or null,
- Description
- An internal name for the price.
- Name
product
- Type
- string or Product,
- Description
- Expandable. The product this price is for.
- Name
recurring
- Type
- object or null,
- Description
- The billing period of a
recurringprice. - Properties
- Name
type
- Type
- enum,
- Description
one_timefor a single purchase, orrecurringfor a subscription.- Properties
- Name
updated_at
- Type
- integer,
- Description
- When the object was last updated, in milliseconds since the Unix epoch.
The Price object
Create a price
Create a new price for a product.
Required parameters
- Name
product
- Type
- string,
- Description
- The ID of the product the price is for.
- Name
amount
- Type
- integer, at least 0,
- Description
- The amount in cents.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
- Name
active
- Type
- boolean or null,
- Description
- Whether the price can be used for new purchases.
- Name
name
- Type
- string or null,
- Description
- An internal name for the price.
- Name
type
- Type
- enum,
- Description
one_timefor a single purchase, orrecurringfor a subscription. Defaults torecurringwhenrecurringis set, andone_timeotherwise.- Properties
- Name
recurring
- Type
- object or null,
- Description
- The billing period. Required for
recurringprices. - Properties
- Name
metadata
- Type
- object or null,
- Description
- Your own key-value data on the object.
Returns
Returns the price object.
Create a price
Response example
Get a price
Retrieve a price by its ID.
Required parameters
- Name
id
- Type
- string,
- Description
- The ID of the price to retrieve.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
Returns
Returns the price object.
Retrieve a price
Response example
Update a price
A price’s amount, type and recurring interval can’t change, so subscriptions billing it keep the same amount. To charge new customers a different amount, create a new price and set active: false on the old one.
Required parameters
- Name
id
- Type
- string,
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
- Name
active
- Type
- boolean,
- Description
- Whether the price can be used for new purchases.
- Name
name
- Type
- string or null,
- Description
- An internal name for the price.
- Name
metadata
- Type
- object or null,
- Description
- Your own key-value data on the object.
Returns
Returns the updated price object.
Update a price
Response example
List all prices
Retrieve a paginated list of prices, most recently created first.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
- Name
ending_before
- Type
- string,
- Description
- The ID of the object to list before, for pagination.
- Name
starting_after
- Type
- string,
- Description
- The ID of the object to list after, for pagination.
- Name
limit
- Type
- integer, at least 1, at most 1000, default is 50
- Description
- The maximum number of objects to return, from 1 to 1000. Defaults to 50.
- Name
filters
- Type
- object, object, or object,
- Description
- Properties
Returns
Returns a list of price objects.