Prices
Prices are immutable commercial terms for an exact Product. Each Price belongs to one Product, while a Product can retain multiple current or historical Prices—for example, retail and wholesale terms or a new amount introduced over time. Amounts are expressed in USD cents. Prices are referenced when creating checkout sessions or line items.
The Price object
- Name
object
- Type
- "price",
- Description
- Literal representing the object's type.
- Name
id
- Type
- string,
- Description
- Unique identifier for the object.
- Name
live
- Type
- boolean,
- Description
- Has the value
trueif the object exists in a production environment or the valuefalseif the object exists in a sandbox environment.
- Name
created_at
- Type
- integer,
- Description
- Time at which the object was created. Measured 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 price in cents
- Name
deleted
- Type
- boolean,
- Description
- Whether the price has been deleted.
- Name
metadata
- Type
- object,
- Description
- A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration's internal use.
- Name
name
- Type
- string or null,
- Description
- An optional customer-facing name for these commercial terms, such as
Retail.
- Name
product
- Type
- string or Product,
- Description
- Expandable. The exact product these commercial terms purchase.
- Name
type
- Type
- enum,
- Description
- The price type.
- Properties
- Name
updated_at
- Type
- integer,
- Description
- Time at which the object was last updated. Measured in milliseconds since the Unix epoch.
The Price object
Create a price
Creates a new price for a product.
Required parameters
- Name
product
- Type
- string,
- Description
- The product this price belongs to
- Name
amount
- Type
- integer, at least 0,
- Description
- The price in cents
Optional parameters
- Name
expand
- Type
- object,
- 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 optional customer-facing name for these commercial terms, such as
Retail.
- Name
type
- Type
- enum, default is one_time
- Description
- The price type.
- Properties
- Name
metadata
- Type
- object or null,
- Description
- A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration's internal use.
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,
- Properties
Returns
Returns the price object.
Retrieve a price
Response example
Update a price
Updates the specified price by setting the values of the parameters passed. Note that you cannot update the product, amount, or type of an existing price.
Required parameters
- Name
id
- Type
- string,
Optional parameters
- Name
expand
- Type
- object,
- Properties
- Name
active
- Type
- boolean,
- Description
- Whether the price can be used for new purchases.
- Name
name
- Type
- string or null,
- Description
- An optional customer-facing name for these commercial terms, such as
Retail.
- Name
metadata
- Type
- object or null,
- Description
- A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration's internal use.
Returns
Returns the updated price object.
Update a price
Response example
List all prices
Returns a list of your prices. Prices are returned in reverse chronological order, with the most recently created prices appearing first.
Optional parameters
- Name
expand
- Type
- object,
- Properties
- Name
ending_before
- Type
- string,
- Description
- A cursor for use in pagination.
ending_beforeis an object ID that results will end before. Used to move backward through the list.
- Name
starting_after
- Type
- string,
- Description
- A cursor for use in pagination.
starting_afteris an object ID that results will start after. Used to move forward through the list.
- Name
limit
- Type
- number, at least 1, at most 1000, default is 50
- Description
- Maximum number of objects to return.
- Name
filters
- Type
- object, object, or object,
- Description
- Filters to apply to the list. Combine multiple conditions with
andandor. - Properties
Returns
Returns a list of price objects.