API Version
Product Catalog
Library

Price variant resource offers businesses the flexibility to manage pricing for multiple variations of an item (plan, addon, or charge) in the Product Catalog. It enables the creation of diverse pricing structures based on variables such as geography, partners, versions, and more.

See also:

For a more detailed understanding of Price Variants, including how to enable, configure, and manage them, as well as their impact on other features, follow these resources:

Sample price variant [ JSON ]

{ "updated_at": 1709200385, "name": "Germany Berlin", "created_at": 1709200385, "attributes": [ { "name": "country", "value": "germany" }, { "name": "city", "value": "berlin" } ], "id": "germany-berlin", "external_name": "Germany", "resource_version": 1709200385728, "status": "active", "object": "price_variant" }

API Index URL GET

https://{site}.chargebee.com/api/v2/price_variants

Model Class

id
string, max chars=100
The unique and immutable identifier of the price variant.
name
string, max chars=100
A unique name of the price variant.
external_name
optional, string, max chars=100
A unique display name for the price variant.
variant_group
optional, string, max chars=100
The variant_group organizes similar price_variants to optimize strategies such as bundling, geo-based pricing experiments, and campaign-specific pricing like cb-atomic-pricing- for effective grouping. The variant_group provides greater flexibility and precision in your pricing models.
description
optional, string, max chars=500
Description of the price variant.
status
optional, enumerated string
Status of a price variant.
Possible values are
activeActive price variant. This price variant can be attached to item prices.archivedArchived price variant. This price variant is no longer active and cannot be attached to new item prices. Existing item prices that already have this price variant attached will continue to remain as is.deletedDeleted price variant. The id and name of the deleted price variant can be reused.
Show all values[+]
created_at
timestamp(UTC) in seconds
Timestamp indicating when this price variant is created.
resource_version
optional, long
The version number of this resource. For every change made to the resource, resource_version is updated with a new timestamp in milliseconds.
updated_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this price variant was last updated.
archived_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this price variant was archived.
business_entity_id
optional, string, max chars=50
The unique ID of the business entity of this price_variant. This is applicable only when multiple business entities have been created for the site. The value of this attribute indicates that the resource is specific to the given business entity.
deleted
boolean
Indicates whether the price variant has been deleted or not.
optional, list of attribute

The list of price variant attribute values.

Attributes can be used to store additional information about the price variant. For example, for a price variant called ‘Germany’, the attributes can be ‘Country’:'Germany', ‘City’:'Berlin' and so on.

id id
string, max chars=100
The unique and immutable identifier of the price variant.
name name
string, max chars=100
A unique name of the price variant.
external_name external_name
optional, string, max chars=100
A unique display name for the price variant.
variant_group variant_group
optional, string, max chars=100
The variant_group organizes similar price_variants to optimize strategies such as bundling, geo-based pricing experiments, and campaign-specific pricing like cb-atomic-pricing- for effective grouping. The variant_group provides greater flexibility and precision in your pricing models.
description description
optional, string, max chars=500
Description of the price variant.
status status
optional, enumerated string
Status of a price variant.
Possible values are
activeActive price variant. This price variant can be attached to item prices.archivedArchived price variant. This price variant is no longer active and cannot be attached to new item prices. Existing item prices that already have this price variant attached will continue to remain as is.deletedDeleted price variant. The id and name of the deleted price variant can be reused.
Show all values[+]
created_at created_at
timestamp(UTC) in seconds
Timestamp indicating when this price variant is created.
resource_version resource_version
optional, long
The version number of this resource. For every change made to the resource, resource_version is updated with a new timestamp in milliseconds.
updated_at updated_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this price variant was last updated.
archived_at archived_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this price variant was archived.
business_entity_id business_entity_id
optional, string, max chars=50
The unique ID of the business entity of this price_variant. This is applicable only when multiple business entities have been created for the site. The value of this attribute indicates that the resource is specific to the given business entity.
deleted deleted
boolean
Indicates whether the price variant has been deleted or not.
attributes
optional, list of attribute

The list of price variant attribute values.

Attributes can be used to store additional information about the price variant. For example, for a price variant called ‘Germany’, the attributes can be ‘Country’:'Germany', ‘City’:'Berlin' and so on.


This endpoint allows the creation of a new price variant that can be attached to item prices.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/price_variants \
     -u {site_api_key}:\
     -d id="germany-berlin" \
     -d name="Germany Berlin" \
     -d external_name="Germany" \
     -d "attributes[name][0]"="country" \
     -d "attributes[value][0]"="germany" \
     -d "attributes[name][1]"="city" \
     -d "attributes[value][1]"="berlin" 
copy
Click to Copy
Create a price variant

Sample Response [ JSON ]

Show more...
{
    "price_variant": {
        "updated_at": 1709200385,
        "name": "Germany Berlin",
        "created_at": 1709200385,
        "attributes": [
            {
                "name": "country",
                "value": "germany"
            },
            {..}
        ],
        "id": "germany-berlin",
        "external_name": "Germany",
        "resource_version": 1709200385728,
        "status": "active",
        "object": "price_variant"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/price_variants

Method

id[]
required, string, max chars=100
The unique and immutable identifier of the price variant.
name[]
required, string, max chars=100
A unique name of the price variant.
external_name[]
optional, string, max chars=100
A unique display name for the price variant.
description[]
optional, string, max chars=500
Description of the price variant.
variant_group[]
optional, string, max chars=100
The variant_group organizes similar price_variants to optimize strategies such as bundling, geo-based pricing experiments, and campaign-specific pricing like cb-atomic-pricing- for effective grouping. The variant_group provides greater flexibility and precision in your pricing models.
business_entity_id[]
optional, string, max chars=50
The unique ID of the business entity for this price_variant. This is applicable only when multiple business entities have been created for the site. When provided, the operation will read or write data associated with the specified business entity. If not provided, the resource will be created at the site level, and the business_entity_id will not be included in the API response.
Note

An alternative way of passing this parameter is by means of a custom HTTP header.

.
attributes[name][0..n]
required, string, max chars=100
attributes[value][0..n]
required, string, max chars=100
price_variant price_variant
always returned
Resource object representing price_variant

Sample admin console URL

https://{site}.chargebee.com/admin-console/price_variants/123x

This endpoint retrieves the details of a specific price variant using its unique identifier.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/price_variants/germany-berlin \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "price_variant": {
        "updated_at": 1709200385,
        "name": "Germany Berlin",
        "created_at": 1709200385,
        "attributes": [
            {
                "name": "country",
                "value": "germany"
            },
            {..}
        ],
        "id": "germany-berlin",
        "external_name": "Germany",
        "resource_version": 1709200385728,
        "status": "active",
        "object": "price_variant"
    }
}

URL Format GET

https://{site}.chargebee.com/api/v2/price_variants/{price-variant-id}

Method

price_variant price_variant
always returned
Resource object representing price_variant

Sample admin console URL

https://{site}.chargebee.com/admin-console/price_variants/123x

This endpoint modifies the details of an existing price variant.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/price_variants/germany-munich \
     -u {site_api_key}:\
     -d name="Germany Munich - Web Sales" \
     -d "attributes[name][0]"="country" \
     -d "attributes[value][0]"="germany" \
     -d "attributes[name][1]"="city" \
     -d "attributes[value][1]"="munich" \
     -d "attributes[name][2]"="channel" \
     -d "attributes[value][2]"="web" 
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "price_variant": {
        "updated_at": 1709200387,
        "name": "Germany Munich - Web Sales",
        "created_at": 1709200386,
        "attributes": [
            {
                "name": "country",
                "value": "germany"
            },
            {..}
        ],
        "id": "germany-munich",
        "external_name": "Germany",
        "resource_version": 1709200387080,
        "status": "active",
        "object": "price_variant"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/price_variants/{price-variant-id}

Method

name[]
optional, string, max chars=100
A unique name of the price variant.
external_name[]
optional, string, max chars=100
A unique display name for the price variant.
description[]
optional, string, max chars=500
Description of the price variant.
variant_group[]
optional, string, max chars=100
The variant_group organizes similar price_variants to optimize strategies such as bundling, geo-based pricing experiments, and campaign-specific pricing like cb-atomic-pricing- for effective grouping. The variant_group provides greater flexibility and precision in your pricing models.
status[]
optional, enumerated string
Status of a price variant.
Possible values are
activeActive price variant. This price variant can be attached to item prices.archivedArchived price variant. This price variant is no longer active and cannot be attached to new item prices. Existing item prices that already have this price variant attached will continue to remain as is.
Show all values[+]
attributes[name][0..n]
required, string, max chars=100
attributes[value][0..n]
required, string, max chars=100
price_variant price_variant
always returned
Resource object representing price_variant

Sample admin console URL

https://{site}.chargebee.com/admin-console/price_variants/123x

Deletes the price variant. This is not allowed if price variant is attached to any item price. Once deleted, the id and name of the price variant can be reused.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/price_variants/delete-sample/delete \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "price_variant": {
        "updated_at": 1709200386,
        "name": "delete sample",
        "created_at": 1709200386,
        "attributes": [
            {
                "name": "country",
                "value": "germany"
            },
            {..}
        ],
        "id": "delete-sample",
        "external_name": "delete sample",
        "resource_version": 1709200386268,
        "status": "deleted",
        "object": "price_variant"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/price_variants/{price-variant-id}/delete

Method

price_variant price_variant
always returned
Resource object representing price_variant

Sample admin console URL

https://{site}.chargebee.com/admin-console/price_variants/123x

This endpoint is used to retrieve a list of price variants.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/price_variants \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=2
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "list": [
        {
            "price_variant": {
                "updated_at": 1709200385,
                "name": "Germany Berlin",
                "created_at": 1709200385,
                "attributes": [
                    {
                        "name": "country",
                        "value": "germany"
                    },
                    {..}
                ],
                "id": "germany-berlin",
                "external_name": "Germany",
                "resource_version": 1709200385728,
                "status": "active",
                "object": "price_variant"
            }
        },
        {..}
    ]
}

URL Format GET

https://{site}.chargebee.com/api/v2/price_variants

Method

limit[]
optional, integer, default=10, min=1, max=100
The number of resources to be returned.
offset[]
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.
sort_by[<sort-order>]
optional, string filter
Sorts based on the specified attribute.
Supported attributes : name, id, status, 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.
Filter Params
For operator usages, see the Pagination and Filtering section.
id[<operator>]
optional, string filter
Filter variant based on their id. Possible values are :
Supported operators : is, is_not, starts_with, in, not_in

Example id[is] = "basic"
id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
id[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
name[<operator>]
optional, string filter
Filter variant based on their names. Possible values are :
Supported operators : is, is_not, starts_with, in, not_in

Example name[is] = "basic"
name[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
name[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
name[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
name[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
name[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
status[<operator>]
optional, enumerated string filter
Filter variant based on their status. Possible values are : active, archived
Supported operators : is, is_not, in, not_in

Example status[is] = "active"
status[is][operator]
optional, enumerated string filter
Possible values are : active, archived
Supported operators :

Example
status[is_not][operator]
optional, enumerated string filter
Possible values are : active, archived
Supported operators :

Example
status[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
status[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
updated_at[<operator>]
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"
updated_at[after][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
updated_at[before][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
updated_at[on][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
updated_at[between][operator]
optional, string filter
Possible values are :
Supported operators :

Example
created_at[<operator>]
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"
created_at[after][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
created_at[before][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
created_at[on][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
created_at[between][operator]
optional, string filter
Possible values are :
Supported operators :

Example
business_entity_id[<operator>]
optional, enumerated string filter
The unique ID of the business entity of this price_variant. Learn more about all the scenarios before using this filter. Possible values are : true, false
Supported operators : is_present, is

Example business_entity_id[is_present] = "business_entity_id"
business_entity_id[is_present][operator]
optional, enumerated string filter
Possible values are : true, false
Supported operators :

Example
business_entity_id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
include_site_level_resources[<operator>]
optional, enumerated string filter

Default value is true . To exclude site-level resources in specific cases, set this parameter to false.

Possible values are : true, false
Supported operators : is

Example include_site_level_resources[is] = "null"
include_site_level_resources[is][operator]
optional, enumerated string filter
Possible values are : true, false
Supported operators :

Example
price_variant price_variant
always returned
Resource object representing price_variant
next_offset next_offset
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/price_variants/123x