Products
Products are the items or services that you sell to customers. Each product can have multiple prices and can be associated with discounts. Products contain information like name, description, images, and metadata, but the actual pricing information is stored separately in Price objects.
The Product object
- Name
object
- Type
- "product",
- 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 product can be used for new purchases.
- Name
default_price
- Type
- string or Price or null,
- Description
- Expandable. The default price for this product.
- Name
deleted
- Type
- boolean,
- Description
- Whether the product has been deleted.
- Name
description
- Type
- string or null,
- Description
- An optional description of the product.
- Name
images
- Type
- array of Files or null,
- Description
- Visual media representing the product.
- 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,
- Description
- The product's name.
- Name
prices
- Type
- array of Prices or null or null,
- Description
- Expandable. All prices for this product.
- Name
updated_at
- Type
- integer,
- Description
- Time at which the object was last updated. Measured in milliseconds since the Unix epoch.
The Product object
Create a product
Creates a new product.
Required parameters
- Name
name
- Type
- string,
- Description
- The product's name.
Optional parameters
- Name
description
- Type
- string or null,
- Description
- An optional description of the product.
- Name
active
- Type
- boolean or null,
- Description
- Whether the product can be used for new purchases.
- Name
images
- Type
- array of string or null,
- Description
- Visual media representing the product.
- 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 product object.
Create a product
Response example
Get a product
Retrieve a product 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 product object.
Retrieve a product
Response example
Update a product
Updates the specified product by setting the values of the parameters passed.
Optional parameters
- Name
name
- Type
- string,
- Description
- The product's name.
- Name
description
- Type
- string or null,
- Description
- An optional description of the product.
- Name
active
- Type
- boolean,
- Description
- Whether the product can be used for new purchases.
- Name
default_price
- Type
- string or null,
- Description
- The ID of the default price for this product.
- Name
images
- Type
- array of string or null,
- Description
- Visual media representing the product.
- 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 product object.
Update a product
Response example
List all products
Returns a list of your products. Products are returned in reverse chronological order, with the most recently created products 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 product objects.
List all products
Response example
Delete a product
Deletes a product. Deleted products cannot be retrieved or used for new purchases, but existing prices associated with the product will continue to work until they are also deleted.
Returns
A deleted object stub.