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.
The Features API enables you to:
{
"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"
}
}user license, data storage, Salesforce Integration, devices, UHD Streaming, and so on. 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. type is other than switch.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.user license, data storage, Salesforce Integration, devices, UHD Streaming, and so on. number-of-users-ccjht01. When not provided, a random value is automatically set. user license, data storage, Salesforce Integration, devices, UHD Streaming, and so on. 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. 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.
levelsThis section describes validations that are performed by Chargebee when modifying the levels list of
objects for the feature, using this operation.
levelsAdding a new object to the levels[] list is allowed if and only if the feature type is quantity or custom
levelsRemoving 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.
levelsNote
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
}]
}
user license, data storage, Salesforce Integration, devices, UHD Streaming, and so on. 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. status of the feature is active.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.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.status of the feature to active. The feature status must be archived when calling this endpoint.