Products are offerings that can be sold to customers either as one-time purchases or as recurring subscriptions. These products could include physical items, digital goods, or services that are delivered over a period of time. Chargebee's API allows developers to interact with and manipulate product data, enabling businesses to seamlessly integrate their product offerings into their subscription management workflows.
Sample product [ JSON ]
{
"created_at": 1678784632,
"deleted": false,
"description": "Tshirt for men",
"external_name": "HRX-TSHIRT",
"has_variant": false,
"id": "01GVFNS59M840MZFWPY188H2A1",
"metadata": {
"brand": "HRX"
},
"name": "HRX TSHIRT",
"object": "product",
"resource_version": 1678784632143,
"shippable": true,
"status": "active",
"updated_at": 1678784632
}
API Index URL GET
https://{site}.chargebee.com/api/v2/products
string, max chars=100 The immutable unique identifier of the product.
string, max chars=100 A unique display name for the product. This is visible only in Chargebee.
string, max chars=100 This is a unique name appears for each product to the end user.
optional, string, max chars=500 Description of the product.
boolean, default=true Whether the product has variants or not.
enumerated string, default=active Status of the product. Possible values are
activeThe active products are visible on the storefront, subscription, or checkout.inactiveThe inactive products are not visible on the storefront, subscription, or checkout.
Show all values[+]
boolean, default=true Whether a product is shippable or not.
optional, string, max chars=100 A unique identifier code a seller assigns to each product or item. Retailers and merchants use SKUs to keep track of inventory and sales data and help organize products within a store or warehouse. SKUs can include a combination of letters, numbers, and symbols and can vary in length depending on the seller's needs.
timestamp(UTC) in seconds Timestamp when the product was created.
optional, long Version number of this resource. The resource_version
is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
optional, timestamp(UTC) in seconds Timestamp indicating when this product was last updated
boolean, default=false Determines if the product is deleted or not. If the value is true
then the product has been deleted else it exists. Once the product is deleted, you can reuse the product id
and name
.
optional, jsonobject A collection of key-value pairs that provides extra information about the product. Note: There's a character limit of 65,535.
Learn more. optional, list of option
Array of option list which helps in the product variant creation.
optional, string, max chars=100 The identifier of an option.
optional, string, max chars=100 Name of the option.
optional List of values for the option.
optional, string, max chars=100 Default value for the option.
optional, enumerated string Type of options.
This is a list of the event types we currently support. We will continue
to add more events moving forward. All events follow a uniform pattern -
<resource>_<event_name>. The resources that will be
present in the event content are provided beneath each event type's
description.
Note: If consolidated invoicing is enabled, the
attributes invoice.subscription_id and
credit_note.subscription_id should not be used
(as it will not be present if the invoice / credit note has lines from
multiple subscriptions). Instead to know the related subscriptions,
their line_items' subscription_id attribute should be referred.
string, max chars=100 The immutable unique identifier of the product.
string, max chars=100 A unique display name for the product. This is visible only in Chargebee.
string, max chars=100 This is a unique name appears for each product to the end user.
optional, string, max chars=500 Description of the product.
boolean, default=true Whether the product has variants or not.
enumerated string, default=active Status of the product. Possible values are
activeThe active products are visible on the storefront, subscription, or checkout.inactiveThe inactive products are not visible on the storefront, subscription, or checkout.
Show all values[+]
boolean, default=true Whether a product is shippable or not.
optional, string, max chars=100 A unique identifier code a seller assigns to each product or item. Retailers and merchants use SKUs to keep track of inventory and sales data and help organize products within a store or warehouse. SKUs can include a combination of letters, numbers, and symbols and can vary in length depending on the seller's needs.
timestamp(UTC) in seconds Timestamp when the product was created.
optional, long Version number of this resource. The resource_version
is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
optional, timestamp(UTC) in seconds Timestamp indicating when this product was last updated
boolean, default=false Determines if the product is deleted or not. If the value is true
then the product has been deleted else it exists. Once the product is deleted, you can reuse the product id
and name
.
optional, jsonobject A collection of key-value pairs that provides extra information about the product. Note: There's a character limit of 65,535.
Learn more.
optional, list of option Array of option list which helps in the product variant creation. This API creates a new product.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"product": {
"created_at": 1678784632,
"deleted": false,
"description": "Tshirt for men",
"external_name": "HRX-TSHIRT",
"has_variant": false,
"id": "01GVFNS59M840MZFWPY188H2A1",
"metadata": {
"brand": "HRX"
},
"name": "HRX TSHIRT",
"object": "product",
"resource_version": 1678784632143,
"shippable": true,
"status": "active",
"updated_at": 1678784632
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/products
required, string, max chars=100 A unique internal name for the product. This is only visible in Chargebee.
required, string, max chars=100 The unique name that appears to the end user for each product.
required, enumerated string, default=active Status of the product. Possible values are
activeThe active products are visible on the storefront, subscription, or checkout.inactiveThe inactive products are not visible on the storefront, subscription, or checkout.
Show all values[+]
optional, string, max chars=100 The immutable unique identifier of the product. If not passed, it will get autogenerated.
optional, string, max chars=500 Description of the product.
optional, string, max chars=100 A unique identifier code a seller assigns to each product or item. Retailers and merchants use SKUs to keep track of inventory and sales data and help organize products within a store or warehouse. SKUs can include a combination of letters, numbers, and symbols and can vary in length depending on the seller's needs.
optional, jsonobject A collection of key-value pairs that provides extra information about the product. Note: There's a character limit of 65,535.
Learn more.
optional, boolean, default=true Whether a product is shippable or not. Pass the value as true
if it is a shippable physical product, else pass the value as false
.
always returned required
Resource object representing product
Sample admin console URL
https://{site}.chargebee.com/admin-console/products/123x
Retrieve a product using product_id
.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"product": {
"created_at": 1678815216,
"deleted": false,
"description": "Tshirt for men",
"external_name": "HRX-TSHIRT",
"has_variant": false,
"id": "01GVGJYGTDJ72V7NFD3B0TY8N8",
"metadata": {
"brand": "HRX"
},
"name": "HRX TSHIRT",
"object": "product",
"options": [
{
"default_value": "gray",
"id": "01GVGJYMWBRVMSDND0GREE94X1",
"name": "color",
"type": "select",
"values": [
"red",
{..}
]
},
{..}
],
"resource_version": 1678815216000,
"shippable": true,
"status": "active",
"updated_at": 1678815216
}
}
URL Format
GET
https://{site}.chargebee.com/api/v2/products/{product-id}
always returned required
Resource object representing product
Sample admin console URL
https://{site}.chargebee.com/admin-console/products/123x
This API allows you to update specific product details.
The following table will help you to understand the status of the mapped item and item_price after passing product status value during product updation.
Product Status(Input parameter) | Item and Item Price Status |
active | active |
inactive | archived |
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"product": {
"created_at": 1678815492,
"deleted": false,
"description": "Spl Tshirt for mens",
"external_name": "HRX-TSHIRT",
"has_variant": false,
"id": "01GVGK6Y2V82CM94TCX717PRGB",
"metadata": {
"brand": "HRX"
},
"name": "HRX TSHIRT SPL",
"object": "product",
"options": [
{
"default_value": "gray",
"id": "01GVGK6ZWBTX76G6Q0ZTKDZGF7",
"name": "color",
"type": "select",
"values": [
"red",
{..}
]
},
{..}
],
"resource_version": 1678815494406,
"shippable": true,
"status": "inactive",
"updated_at": 1678815494
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/products/{product-id}
optional, string, max chars=100 A unique internal name for the product. This is only visible in Chargebee.
optional, string, max chars=100 The unique name that appears for each product to the end user.
optional, string, max chars=500 Description of the product.
optional, enumerated string, default=active Status of the product. Refer to the table for more information. Possible values are
activeThe active products are visible on the storefront, subscription, or checkout.inactiveThe inactive products are not visible on the storefront, subscription, or checkout.
Show all values[+]
optional, string, max chars=100 A unique identifier code a seller assigns to each product or item. Retailers and merchants use SKUs to keep track of inventory and sales data and help organize products within a store or warehouse. SKUs can include a combination of letters, numbers, and symbols and can vary in length depending on the seller's needs.
optional, boolean, default=true Whether a product is shippable or not. Pass the value as true
if it is a shippable physical product, else pass the value as false
.
optional, jsonobject A collection of key-value pairs that provides extra information about the product. Note: There's a character limit of 65,535.
Learn more.
always returned required
Resource object representing product
Sample admin console URL
https://{site}.chargebee.com/admin-console/products/123x
This API deletes a product and changes the delete attribute value to true
. Deletion of a product is not allowed if there are active
or archived
variants under the product or if there are items mapped to the product. Once deleted, the name
of the product can be reused.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"product": {
"created_at": 1678815777,
"deleted": true,
"description": "Tshirt for men",
"external_name": "HRX-TSHIRT",
"has_variant": false,
"id": "01GVGKFKQXFVCXC5NA37FFHG4D",
"metadata": {
"brand": "HRX"
},
"name": "HRX TSHIRT",
"object": "product",
"options": [
{
"default_value": "gray",
"id": "01GVGKFKZFW0EQV6TPTY41JM7F",
"name": "color",
"type": "select",
"values": []
},
{..}
],
"resource_version": 1678815776956,
"shippable": true,
"status": "active",
"updated_at": 1678815776
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/products/{product-id}/delete
always returned required
Resource object representing product
Sample admin console URL
https://{site}.chargebee.com/admin-console/products/123x
This API allows you to add, remove, or update product options.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"product": {
"created_at": 1678815622,
"deleted": false,
"description": "Tshirt for men",
"external_name": "HRX-TSHIRT",
"has_variant": false,
"id": "01GVGKAWFV6M8P6FWMXXSTE2K6",
"metadata": {
"brand": "HRX"
},
"name": "HRX TSHIRT",
"object": "product",
"options": [
{
"default_value": "gray",
"id": "01GVGKAX3SS90R1GW9T6433RMK",
"name": "color",
"type": "select",
"values": [
"red",
{..}
]
},
{..}
],
"resource_version": 1678815622000,
"shippable": true,
"status": "active",
"updated_at": 1678815622
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/products/{product-id}/update_options
remove_options[[0..n]][0..n]
optional, list of string List of options that you want to remove from the product. You can provide option names.
optional, array Parameters for options. Multiple options can be passed by specifying unique indices.
Parameters for options. Multiple options can be passed by specifying unique indices.
pass parameters as options[<param name>][<idx:0..n>]
required, string, max chars=100 options[default_value][0..n] optional, string, max chars=100
always returned required
Resource object representing product
Sample admin console URL
https://{site}.chargebee.com/admin-console/products/123x
This API retrieves the list of products that are active
or inactive
. Use include_deleted
parameter to include deleted products with active
and inactive
products.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"list": [
{
"product": {
"created_at": 1678815870,
"deleted": false,
"description": "Tshirt for men",
"external_name": "LP-TSHIRT",
"has_variant": false,
"id": "01GVGKJESTP3X5S394G3TW7ZVH",
"metadata": {
"brand": "LP"
},
"name": "LP TSHIRT",
"object": "product",
"options": [
{
"default_value": "blue",
"id": "01GVGKJEK51XKRD9WTDJK4DE4P",
"name": "color",
"type": "select",
"values": [
"pink",
{..}
]
},
{..}
],
"resource_version": 1678815870000,
"shippable": true,
"status": "active",
"updated_at": 1678815870
}
},
{..}
]
}
URL Format
GET
https://{site}.chargebee.com/api/v2/products
optional, integer, default=10, min=1, max=100 The number of resources to be returned.
optional, string, max chars=1000 Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set 'offset' to the value of 'next_offset' obtained in the previous iteration of the API call.
optional, boolean, default=false If set to true, includes the deleted resources in the response. For the deleted resources in the response, the 'deleted' attribute will be 'true'.
optional, string filter
Sorts based on the specified attribute.
Supported attributes : name, id, created_at, updated_at
Supported sort-orders : asc, desc
Example → sort_by[asc] = "name"
This will sort the result based on the 'name'
attribute in ascending(earliest first) order.
optional, string filter Filter product based on their id. Possible values are : Supported operators : is, is_not, starts_with, in, not_in
Example → id[is] = "basic" Filter product based on their id. pass parameters as id[<param name>][<operator>] optional, string, min chars=1 filter
Possible values are :
Supported operators :
Example →
optional, string, min chars=1 filter
Possible values are :
Supported operators :
Example →
id[starts_with][operator] id[starts_with][operator] optional, string, min chars=1 filter
Possible values are :
Supported operators :
Example →
optional, string filter
Possible values are :
Supported operators :
Example →
optional, string filter
Possible values are :
Supported operators :
Example →
optional, string filter
Filter product based on their name
s. Possible values are :
Supported operators : is, is_not, starts_with, in, not_in
Example → name[is] = "basic"
Filter product based on their name
s.
pass parameters as name[<param name>][<operator>]
optional, string, min chars=1 filter
Possible values are :
Supported operators :
Example →
optional, string, min chars=1 filter
Possible values are :
Supported operators :
Example →
name[starts_with][operator] name[starts_with][operator] optional, string, min chars=1 filter
Possible values are :
Supported operators :
Example →
optional, string filter
Possible values are :
Supported operators :
Example →
optional, string filter
Possible values are :
Supported operators :
Example →
optional, enumerated string filter
Filter product based on their status
. Possible values are : active, inactive
Supported operators : is, is_not, in, not_in
Example → status[is] = "basic"
Filter product based on their status
.
pass parameters as status[<param name>][<operator>]
optional, enumerated string filter
Possible values are : active, inactive
Supported operators :
Example →
optional, enumerated string filter
Possible values are : active, inactive
Supported operators :
Example →
optional, string filter
Possible values are :
Supported operators :
Example →
optional, string filter
Possible values are :
Supported operators :
Example →
optional, enumerated string filter
Filter product based on whether it is shippable or not. Possible values are : true, false
Supported operators : is
Example → shippable[is] = "true"
Filter product based on whether it is shippable or not.
pass parameters as shippable[<param name>][<operator>]
optional, enumerated string filter
Possible values are : true, false
Supported operators :
Example →
optional, enumerated string filter
Filter product based on whether it has variants or not. Possible values are : true, false
Supported operators : is
Example → has_variant[is] = "true"
Filter product based on whether it has variants or not.
pass parameters as has_variant[<param name>][<operator>]
has_variant[is][operator] has_variant[is][operator] optional, enumerated string filter
Possible values are : true, false
Supported operators :
Example →
optional, timestamp(UTC) in seconds filter
Filter product based on their created time
. Possible values are :
Supported operators : after, before, on, between
Example → created_at[after] = "1243545465"
Filter product based on their created time
.
pass parameters as created_at[<param name>][<operator>]
created_at[after][operator] created_at[after][operator] optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :
Example →
created_at[before][operator] created_at[before][operator] optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :
Example →
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :
Example →
created_at[between][operator] created_at[between][operator] optional, string filter
Possible values are :
Supported operators :
Example →
optional, timestamp(UTC) in seconds filter
Filter product based on their updated time
. Possible values are :
Supported operators : after, before, on, between
Example → updated_at[after] = "1243545465"
Filter product based on their updated time
.
pass parameters as updated_at[<param name>][<operator>]
updated_at[after][operator] updated_at[after][operator] optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :
Example →
updated_at[before][operator] updated_at[before][operator] optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :
Example →
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :
Example →
updated_at[between][operator] updated_at[between][operator] optional, string filter
Possible values are :
Supported operators :
Example →
always returned required
Resource object representing product
always returned optional, string, max chars=1000
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.
Sample admin console URL
https://{site}.chargebee.com/admin-console/products/123x