Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.
Chargebeechargebee API

Update a feature

Idempotency Supported

Updates a specific 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.)

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.

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.

Sample Request

update a quantity type feature

Sample Result[JSON]

URL Format

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

Input Parameters

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.

Enum Values
active

A draft or an archived feature can be changed to active. Any entitlements or subscription entitlements defined for the feature take effect immediately.

archived

An 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.

draft

The 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 .

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[0..n]
Parameters for levels. Multiple levels can be passed by specifying unique indices.
pass parameters as levels[<param name>][<idx:0..n>]

Returns

Feature object
Resource object representing feature