POST /features/{feature-id}
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
}]
}
Servers
- {protocol}://{site}.{environment}:{port}/api/v2
- {protocol}://{site}-test.{environment}:{port}/api/v2
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
feature-id |
String | Yes |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
chargebee-request-origin-device |
String | No |
The device from which the customer has made the request |
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/x-www-form-urlencoded" |
chargebee-event-webhook |
String | No |
skip only webhooks Valid values:
|
chargebee-business-entity-id |
String | No |
If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation. |
chargebee-event-actions |
String | No |
skip all actions to be done on the events Valid values:
|
chargebee-request-origin-user |
String | No |
The email address of your customer/user. Use this when the email address has only ASCII characters. |
chargebee-request-origin-ip |
String | No |
The IP address of the customer where the request originated |
chargebee-request-origin-user-encoded |
String | No |
The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored. |
chargebee-event-email |
String | No |
skip only emails Valid values:
|
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
name |
String | No |
A case-sensitive unique name for the feature. For example: 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 |
String | No |
A brief description of the feature. For example: |
levels |
Object | No |
Parameters for levels |
levels.is_unlimited[] |
Array | No |
When
Either this or levels[value] should be passed. |
levels.name[] |
Array | No |
A case-sensitive display name for the entitlement level. Provide a name that helps you clearly identify the entitlement level. For example: a feature such as When not provided for |
levels.level[] |
Array | No |
Represents the order of the entitlement levels from lowest to highest.
When not defined, it is assumed as the index of the |
levels.value[] |
Array | No |
The value denoting the entitlement level granted.
Note This must be provided exactly as it already exists for the feature if the |
status |
String | No |
The current status of the feature.
Valid values:
|
unit |
String | No |
For features of |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.