Products
A product is one exact good, service, SKU or entitlement you sell. Variants, such as a red, large T-shirt, are separate products. Its prices set what it costs.
The Product object
- Name
object
- Type
- "product",
- 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 product can be used for new purchases.
- Name
attributes
- Type
- object,
- Description
- The attributes that distinguish this item, such as its color or size.
- Name
default_price
- Type
- string or Price or null,
- Description
- Expandable. The price the dashboard shows for this product. The first active price added becomes the default.
- Name
deleted
- Type
- boolean,
- Description
- Whether the product has been deleted.
- Name
description
- Type
- string or null,
- Description
- The product's description.
- Name
images
- Type
- array of Files or null,
- Description
- Images of this product.
- Name
metadata
- Type
- object,
- Description
- Your own key-value data on the object.
- Name
name
- Type
- string,
- Description
- The product's name.
- Name
prices
- Type
- array of Prices or null or null,
- Description
- Expandable. The prices available for this product.
- Name
sku
- Type
- string or null,
- Description
- The product's stock keeping unit (SKU).
- Name
source
- Type
- object or null,
- Description
- The Shopify product variant this product syncs from. While the store is connected, only the product's
metadatacan be updated. - Properties
- Name
updated_at
- Type
- integer,
- Description
- When the object was last updated, in milliseconds since the Unix epoch.
The Product object
Create a product
Create a product.
Required parameters
- Name
name
- Type
- string,
- Description
- The product's name.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
- Name
description
- Type
- string or null,
- Description
- The product's description.
- Name
sku
- Type
- string or null,
- Description
- The product's stock keeping unit (SKU).
- Name
attributes
- Type
- object,
- Description
- The attributes that distinguish this item, such as its color or size.
- 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
- The IDs of
product_imagefiles to show for the product.
- Name
metadata
- Type
- object or null,
- Description
- Your own key-value data on the object.
Returns
Returns the product object.
Create a product
Response example
Get a product
Retrieve a product by its ID.
Required parameters
- Name
id
- Type
- string,
- Description
- The ID of the product to retrieve.
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
Returns
Returns the product object.
Retrieve a product
Response example
Update a product
Updates change a product’s details, images or default_price. With active: false, the product can’t be added to checkout sessions or subscriptions, and existing subscriptions keep billing it.
Required parameters
- Name
id
- Type
- string,
Optional parameters
- Name
expand
- Type
- object,
- Description
- Related objects to expand in the response.
- Properties
- Name
name
- Type
- string,
- Description
- The product's name.
- Name
description
- Type
- string or null,
- Description
- The product's description.
- Name
sku
- Type
- string or null,
- Description
- The product's stock keeping unit (SKU).
- Name
attributes
- Type
- object,
- Description
- The product's attributes, replacing the existing ones.
- 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 one of the product's active prices to make its
default_price.
- Name
images
- Type
- array of string or null,
- Description
- The IDs of
product_imagefiles to show for the product.
- Name
metadata
- Type
- object or null,
- Description
- Your own key-value data on the object.
Returns
Returns the updated product object.
Update a product
Response example
List all products
Retrieve a paginated list of products, 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 product objects.
List all products
Response example
Delete a product
Deleting a product also deletes its prices. A product that appears on a line item or a subscription that isn’t canceled can’t be deleted. To stop selling it, set active: false instead.
Required parameters
- Name
id
- Type
- string,
Returns
A deleted object stub.