Prices
Prices define how much and how often to charge for products. Each price belongs to exactly one product, but products can have multiple prices (for example, different price points or currencies). Prices are used 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
description
- Type
- string or null,
- Description
- A short description of the price for internal use. Price descriptions are not shown to customers.
- 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
product
- Type
- string or Product,
- Description
- The product that this price is attached to.
- Name
type
- Type
- enum,
- Description
- The price type.
- 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
active
- Type
- boolean or null,
- Description
- Whether the price can be used for new purchases.
- Name
description
- Type
- string or null,
- Description
- A short description of the price for internal use. Price descriptions are not shown to customers.
- Name
type
- Type
- enum, default is one_time
- Description
- The price type.
- 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.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Optional object that allows you to expand certain ID fields to include related resources.
- 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.
Optional parameters
- Name
active
- Type
- boolean,
- Description
- Whether the price can be used for new purchases.
- Name
description
- Type
- string or null,
- Description
- A short description of the price for internal use. Price descriptions are not shown to customers.
- 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,
- Description
- Optional object that allows you to expand certain ID fields to include related resources.
- 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.