API Version
Product Catalog
Library

Subscriptions are created in Chargebee using items. Items represent the products or services that you offer to your customers. Items often differ in the number of product features that are available to them. The Features API helps you define the various features offered as part of your product line. It also defines the entitlements that items and subscriptions can have towards said features.

Note

The maximum number of features a site can have is 400.

Features of this API

The Features API enables you to:

  • Define the set of features provided by your product.
  • Specify the entitlements that items have towards said features.
  • For a given subscription, modify the entitlements inherited from items in the subscription.
  • Offer additional feature entitlements to subscriptions than those inherited from items in the subscription.
  • Serve as a source of truth to your provisioning systems for subscription entitlements.
  • Use entitlement information to understand which features drive value and revenue.

Sample feature [ JSON ]

{ "feature": { "description": "Integration of Chargebee with Quickbooks", "id": "fea-4c163c85-f873-46d4-a268-5a80ddf40971", "levels": [], "name": "Quickbooks Integration_123", "object": "feature", "status": "draft", "type": "switch" } }

API Index URL GET

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

Model Class

id
string, max chars=50
A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, number-of-users-ccjht01. When not provided, a random value is automatically set.
name
string, max chars=50
A case-sensitive unique name for the feature. For example: user license, data storage, Salesforce Integration, devices, UHD Streaming, and so on.
Note: This name is not displayed on any customer-facing documents or pages such as invoice PDFs or hosted pages. However, in the future, it is likely to be introduced on the Self-Serve Portal.

description
optional, string, max chars=500
A brief description of the feature. For example: Access to 10TB cloud storage.
status
optional, enumerated string
The current status of the feature.
Possible values are
activeA draft or an archived feature can be changed to active. Any entitlements or subscription entitlements defined for the feature take effect immediately.archivedAn active feature can be changed to archived. Once archived, no new entitlements or subscription entitlements can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was active, remain effective.draftThe feature is in an unpublished state. Entitlements and subscription entitlements can be created for a draft feature but they are not effective until the feature is active. A feature status cannot be changed back to draft once it is in active or archived status.
Show all values[+]
type
optional, enumerated string
The type of feature.
Possible values are
switchA switch or toggle is a feature that an item or subscription can be either fully entitled to or not entitled to at all.customThe entitlement levels available for this feature are defined as a set of custom values. For example, a feature Email Support can have entitlement levels as 24×7 and 24×5.quantityThe feature is quantity-based and entitlement levels available for it are a set of predefined number of quantity units. For example, a feature with name such as number of users can have entitlement levels of say, 5, 20, 50, and 100. levels[is_unlimited] is used for specifying the “unlimited” entitlement level.rangeThe feature is quantity-based and the entitlement levels available for it are the set of whole numbers within a range. The range is defined by a minimum and a maximum value. For example, a feature such as number of users can have entitlement levels starting at 5 users and go up to 50000. levels[is_unlimited] is used for specifying the “unlimited” entitlement level.
Show all values[+]
unit
optional, string, max chars=50
For features of type quantity or range, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as user licenses, the unit can be license.
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
The version number of this resource. For every change made to the resource, resource_version is updated with a new timestamp in milliseconds.
created_at
timestamp(UTC) in seconds
When the feature was created.
optional, list of level
An ordered list of entitlement levels available for the feature. This is only applicable when type is other than switch.
Note: When the type of the feature is switch, this is not applicable. This is because any given entity can be either fully entitled to a switch feature or not entitled at all; there are no intermediate entitlement levels.
id id
string, max chars=50
A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, number-of-users-ccjht01. When not provided, a random value is automatically set.
name name
string, max chars=50
A case-sensitive unique name for the feature. For example: user license, data storage, Salesforce Integration, devices, UHD Streaming, and so on.
Note: This name is not displayed on any customer-facing documents or pages such as invoice PDFs or hosted pages. However, in the future, it is likely to be introduced on the Self-Serve Portal.

description description
optional, string, max chars=500
A brief description of the feature. For example: Access to 10TB cloud storage.
status status
optional, enumerated string
The current status of the feature.
type type
optional, enumerated string
The type of feature.
unit unit
optional, string, max chars=50
For features of type quantity or range, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as user licenses, the unit can be license.
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
The version number of this resource. For every change made to the resource, resource_version is updated with a new timestamp in milliseconds.
created_at created_at
timestamp(UTC) in seconds
When the feature was created.
levels
optional, list of level
An ordered list of entitlement levels available for the feature. This is only applicable when type is other than switch.
Note: When the type of the feature is switch, this is not applicable. This is because any given entity can be either fully entitled to a switch feature or not entitled at all; there are no intermediate entitlement levels.

Retrieves a list of features meeting all the conditions specified in the filter parameters.

Notes

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

Sample Response [ JSON ]

Show more...
{
    "list": [
        {
            "feature": {
                "description": "Integration of Chargebee with Quickbooks",
                "id": "fea-4c163c85-f873-46d4-a268-5a80ddf40971",
                "levels": [],
                "name": "Quickbooks Integration_123",
                "object": "feature",
                "status": "draft",
                "type": "switch"
            }
        },
        {..}
    ]
}

URL Format GET

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

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.
Filter Params
For operator usages, see the Pagination and Filtering section.
name[<operator>]
optional, string filter
A case-sensitive unique name for the feature. For example: user license, data storage, Salesforce Integration, devices, UHD Streaming, and so on.
Note: This name is not displayed on any customer-facing documents or pages such as invoice PDFs or hosted pages. However, in the future, it is likely to be introduced on the Self-Serve Portal.
Possible values are :
Supported operators : is, is_not, starts_with, in, not_in

Example name[is] = "User licenses"
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
id[<operator>]
optional, string filter
A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, number-of-users-ccjht01. When not provided, a random value is automatically set. Possible values are :
Supported operators : is, is_not, starts_with, in, not_in

Example id[is] = "fea-user-licenses"
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
status[<operator>]
optional, enumerated string filter
The current status of the feature. Possible values are : active, archived, draft
Supported operators : is, is_not, in, not_in

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

Example
status[is_not][operator]
optional, enumerated string filter
Possible values are : active, archived, draft
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
type[<operator>]
optional, enumerated string filter
The type of feature. Possible values are : switch, custom, quantity, range
Supported operators : is, is_not, in, not_in

Example type[is] = "boolean"
type[is][operator]
optional, enumerated string filter
Possible values are : switch, custom, quantity, range
Supported operators :

Example
type[is_not][operator]
optional, enumerated string filter
Possible values are : switch, custom, quantity, range
Supported operators :

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

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

Example
feature feature
always returned
Resource object representing feature
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/features/123x
Creates a new feature.

Notes

Sample Request
# create a switch feature
curl  https://{site}.chargebee.com/api/v2/features \
     -u {site_api_key}:\
     -d name="Quickbooks Integration_123" \
     -d type="SWITCH" \
     -d description="Integration of Chargebee with Quickbooks"
# create a custom type feature
curl  https://{site}.chargebee.com/api/v2/features \
     -u {site_api_key}:\
     -d name="Phone Support" \
     -d type="CUSTOM" \
     -d levels[level][0]=0 \
     -d levels[value][0]="24 * 5" \
     -d levels[name][0]="24 * 5" \
     -d levels[level][1]=1 \
     -d levels[value][1]="24 * 7" \
     -d levels[name][1]="24 * 7" 
# create a quantity type feature
curl  https://{site}.chargebee.com/api/v2/features \
     -u {site_api_key}:\
     -d name="User Licenses" \
     -d type="QUANTITY" \
     -d description="Maximum user licenses allowed" \
     -d levels[level][0]=0 \
     -d levels[value][0]="5" \
     -d levels[name][0]="5 Users" \
     -d levels[level][1]=1 \
     -d levels[value][1]="10" \
     -d levels[name][1]="10 Users" \
     -d levels[level][2]=2 \
     -d levels[value][2]="Unlimited" \
     -d levels[name][2]="Unlimited Users" \
     -d levels[is_unlimited][2]=true 
# create a range type feature
curl  https://{site}.chargebee.com/api/v2/features \
     -u {site_api_key}:\
     -d name="API call limit" \
     -d type="RANGE" \
     -d description="API call limit" \
     -d levels[level][0]=0 \
     -d levels[value][0]="5" \
     -d levels[name][0]="5 calls/month" \
     -d levels[level][1]=1 \
     -d levels[value][1]="100" \
     -d levels[name][1]="100 calls/month" 
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "feature": {
        "description": "Integration of Chargebee with Quickbooks",
        "id": "fea-0e400372-75e0-432a-ae30-82f796a5b7e6",
        "levels": [],
        "name": "Quickbooks Integration_123",
        "object": "feature",
        "status": "draft",
        "type": "switch"
    }
}

URL Format POST

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

Method

id[]
optional, string, max chars=50
A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, number-of-users-ccjht01. When not provided, a random value is automatically set.
name[]
required, string, max chars=50
A case-sensitive unique name for the feature. For example: user license, data storage, Salesforce Integration, devices, UHD Streaming, and so on.
Note: This name is not displayed on any customer-facing documents or pages such as invoice PDFs or hosted pages. However, in the future, it is likely to be introduced on the Self-Serve Portal.
description[]
optional, string, max chars=500
A brief description of the feature. For example: Access to 10TB cloud storage.
type[]
optional, enumerated string
The type of feature.
Possible values are
switchA switch or toggle is a feature that an item or subscription can be either fully entitled to or not entitled to at all.customThe entitlement levels available for this feature are defined as a set of custom values. For example, a feature Email Support can have entitlement levels as 24×7 and 24×5.quantityThe feature is quantity-based and entitlement levels available for it are a set of predefined number of quantity units. For example, a feature with name such as number of users can have entitlement levels of say, 5, 20, 50, and 100. levels[is_unlimited] is used for specifying the “unlimited” entitlement level.rangeThe feature is quantity-based and the entitlement levels available for it are the set of whole numbers within a range. The range is defined by a minimum and a maximum value. For example, a feature such as number of users can have entitlement levels starting at 5 users and go up to 50000. levels[is_unlimited] is used for specifying the “unlimited” entitlement level.
Show all values[+]
status[]
optional, enumerated string
The current status of the feature.
Possible values are
activeA draft or an archived feature can be changed to active. Any entitlements or subscription entitlements defined for the feature take effect immediately.draftThe feature is in an unpublished state. Entitlements and subscription entitlements can be created for a draft feature but they are not effective until the feature is active. A feature status cannot be changed back to draft once it is in active or archived status.
Show all values[+]
unit[]
optional, string, max chars=50
For features of type quantity or range, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as user licenses, the unit can be license.
levels[name][0..n]
optional, string, max chars=50
levels[value][0..n]
optional, string, max chars=50
levels[is_unlimited][0..n]
optional, boolean
levels[level][0..n]
optional, integer
feature feature
always returned
Resource object representing feature

Sample admin console URL

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

Updates a specific feature.

Note

The list of objects levels[] provided as part of this operation fully replaces the existing list of objects levels[] of the feature.

Considerations when modifying levels

This section describes validations that are performed by Chargebee when modifying the levels list of objects for the feature, using this operation.

Adding levels

Adding a new object to the levels[] list is allowed if and only if the feature type is quantity or custom

Removing levels

Removing an existing object in the levels[] list is not allowed if the value for that object is currently mapped to one or more item_entitlements or subscription_entitlements.

Reordering levels

Note

The validation described in this section is only applicable for features of type custom

If any of levels[].value are currently mapped to item_entitlements or subscription_entitlements, then the relative order of the corresponding levels[].level must be preserved when invoking this operation.

For example, consider that the levels[] list is currently in the state shown below. (For brevity, only the value and level key are shown here and the JSONs have been compacted.)

{ "levels":[{ "value":"email-basic", "level":0 },{ "value":"email-rise", "level":1 },{ "value":"email-advanced", "level":2 },{ "value":"email-pro", "level":3 },{ "value":"email-scale", "level":4 }] }

Now consider that email-rise, email-advanced, and email-pro have already been mapped to item_entitlements or subscription_entitlements. As seen in the above object, the relative order of levels[].level is such that email-rise < email-advanced < email-pro.

Invoking this API to change levels[] to the state below is allowed since the relative order of level corresponding to email-rise, email-advanced, and email-pro has been preserved.

{ "levels":[{ "value":"email-basic", "level":0 },{ "value":"email-rise", "level":1 },{ "value":"email-scale", "level":2 },{ "value":"email-advanced", "level":3 },{ "value":"email-pro", "level":4 }] }

However, changing levels[] to the state shown below is not permissible because the level of email-advanced is provided as greater than the level of email-pro, thereby disrupting the original order.

{ "levels":[{ "value":"email-basic", "level":0 },{ "value":"email-rise", "level":1 },{ "value":"email-pro", "level":2 },{ "value":"email-advanced", "level":3 },{ "value":"email-scale", "level":4 }] }

Notes

Sample Request
# update a quantity type feature
curl  https://{site}.chargebee.com/api/v2/features/fea-a5d1f7de-c58c-45da-a08b-6934e3ab3ede \
     -u {site_api_key}:\
     -d name="User Licenses (updated name)" \
     -d description="Maximum number of user licenses allowed" \
     -d status="ACTIVE" \
     -d levels[level][0]=0 \
     -d levels[value][0]="25" \
     -d levels[name][0]="25 Users" \
     -d levels[level][1]=1 \
     -d levels[value][1]="100" \
     -d levels[name][1]="100 Users" \
     -d levels[level][2]=2 \
     -d levels[value][2]="Unlimited" \
     -d levels[name][2]="Unlimited Users" \
     -d levels[is_unlimited][2]=true 
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "feature": {
        "description": "Maximum number of user licenses allowed",
        "id": "fea-a5d1f7de-c58c-45da-a08b-6934e3ab3ede",
        "levels": [
            {
                "is_unlimited": false,
                "level": 0,
                "name": "25 Users",
                "value": "25"
            },
            {..}
        ],
        "name": "User Licenses (updated name)",
        "object": "feature",
        "status": "active",
        "type": "quantity"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/features/{feature-id}

Method

name[]
optional, string, max chars=50
A case-sensitive unique name for the feature. For example: user license, data storage, Salesforce Integration, devices, UHD Streaming, and so on.
Note: This name is not displayed on any customer-facing documents or pages such as invoice PDFs or hosted pages. However, in the future, it is likely to be introduced on the Self-Serve Portal.
description[]
optional, string, max chars=500
A brief description of the feature. For example: Access to 10TB cloud storage.
status[]
optional, enumerated string
The current status of the feature.
Possible values are
activeA draft or an archived feature can be changed to active. Any entitlements or subscription entitlements defined for the feature take effect immediately.archivedAn active feature can be changed to archived. Once archived, no new entitlements or subscription entitlements can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was active, remain effective.draftThe feature is in an unpublished state. Entitlements and subscription entitlements can be created for a draft feature but they are not effective until the feature is active. A feature status cannot be changed back to draft once it is in active or archived status.
Show all values[+]
unit[]
optional, string, max chars=50
For features of type quantity or range, this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as user licenses, the unit can be license.
levels[name][0..n]
optional, string, max chars=50
levels[value][0..n]
optional, string, max chars=50
levels[is_unlimited][0..n]
optional, boolean
levels[level][0..n]
optional, integer
feature feature
always returned
Resource object representing feature

Sample admin console URL

https://{site}.chargebee.com/admin-console/features/123x
Retrieve a specific feature using its ID.

Notes

Sample Request
curl  https://{site}.chargebee.com/api/v2/features/fea-user-licenes \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "feature": {
        "id": "fea-custom-id-121",
        "name": "User Licenses",
        "description": "Maximum Available User Licenses",
        "status": "draft",
        "type": "range",
        "levels": [
            {
                "name": "3 Users",
                "value": "3",
                "is_unlimited": false,
                "level": 1
            },
            {..}
        ],
        "object": "feature"
    }
}

URL Format GET

https://{site}.chargebee.com/api/v2/features/{feature-id}

Method

feature feature
always returned
Resource object representing feature

Sample admin console URL

https://{site}.chargebee.com/admin-console/features/123x
Deletes a feature. Any entitlements and subscription entitlements defined for the feature are also removed. This action is not permissible when the status of the feature is active.

Notes

Sample Request
curl  https://{site}.chargebee.com/api/v2/features/fea-d49b2371-572b-439d-993d-04b8135194c3/delete \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "feature": {
        "description": "Integration of Chargebee with Quickbooks",
        "id": "fea-d49b2371-572b-439d-993d-04b8135194c3",
        "levels": [],
        "name": "Quickbooks Integration_123",
        "object": "feature",
        "status": "draft",
        "type": "switch"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/features/{feature-id}/delete

Method

feature feature
always returned
Resource object representing feature

Sample admin console URL

https://{site}.chargebee.com/admin-console/features/123x
Activates a draft feature so that any entitlements or subscription entitlements defined towards it take effect immediately. This operation changes the status of the feature to active. The feature status must be draft when calling this endpoint.

Notes

Sample Request
curl  https://{site}.chargebee.com/api/v2/features/fea-8f2fb6c8-d582-435a-9d92-b3e04ec7f40e/activate_command \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "feature": {
        "description": "Maximum user licenses allowed",
        "id": "fea-8f2fb6c8-d582-435a-9d92-b3e04ec7f40e",
        "levels": [
            {
                "is_unlimited": false,
                "level": 0,
                "name": "5 Users",
                "value": "5"
            },
            {..}
        ],
        "name": "User Licenses af",
        "object": "feature",
        "status": "active",
        "type": "quantity"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/features/{feature-id}/activate_command

Method

feature feature
always returned
Resource object representing feature

Sample admin console URL

https://{site}.chargebee.com/admin-console/features/123x
Archives an active feature so that no new entitlements or subscription entitlements can be created towards the feature. Any pre-existing item or subscription entitlements from the time that the feature was active remain effective. This operation changes the status of the feature to archived. The feature status must be active when calling this endpoint.

Notes

Sample Request
curl  https://{site}.chargebee.com/api/v2/features/fea-c3c68438-9f26-4a88-b2cb-88428a8d85f5/archive_command \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "feature": {
        "description": "Maximum user licenses allowed",
        "id": "fea-c3c68438-9f26-4a88-b2cb-88428a8d85f5",
        "levels": [
            {
                "is_unlimited": false,
                "level": 0,
                "name": "5 Users",
                "value": "5"
            },
            {..}
        ],
        "name": "User Licenses arf",
        "object": "feature",
        "status": "archived",
        "type": "quantity"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/features/{feature-id}/archive_command

Method

feature feature
always returned
Resource object representing feature

Sample admin console URL

https://{site}.chargebee.com/admin-console/features/123x
Reactivates an archived feature so that new entitlements or subscription entitlements can be created towards the feature. This operation changes the status of the feature to active. The feature status must be archived when calling this endpoint.

Notes

Sample Request
curl  https://{site}.chargebee.com/api/v2/features/fea-a2dbb732-c54d-4a96-aaa3-b8c0b362e578/reactivate_command \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "feature": {
        "description": "Maximum user licenses allowed",
        "id": "fea-a2dbb732-c54d-4a96-aaa3-b8c0b362e578",
        "levels": [
            {
                "is_unlimited": false,
                "level": 0,
                "name": "5 Users",
                "value": "5"
            },
            {..}
        ],
        "name": "User Licenses rf",
        "object": "feature",
        "status": "active",
        "type": "quantity"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/features/{feature-id}/reactivate_command

Method

feature feature
always returned
Resource object representing feature

Sample admin console URL

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