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 {#considerations}

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}

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

Removing levels {#removing}

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 {#reorder}

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

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

Possible values:

  • "all-disabled"
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

Possible values:

  • "all-disabled"
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

Possible values:

  • "all-disabled"

Request body fields

Name Type Required Description
name String No

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 String No

A brief description of the feature. For example: Access to 10TB cloud storage.

levels Object No

Parameters for levels

levels.is_unlimited[] Array No

When type is quantity or range, this attribute indicates whether the entitlement level corresponds to unlimited units of the feature. Possible values are:

  • true: The entitlement level corresponds to unlimited units of the feature. levels[].value is ignored for this level. This can only be set for the level that has the highest value for levels[].level.
  • false: The entitlement level does not correspond to unlimited units of the feature.

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 Email Support can have entitlement levels named as All weekdays, All days, 40 hours per week and so on. When not provided for feature.type quantity or range, this name is auto-generated as the space-separated concatenation of levels[].value and the pluralized version of unit. For example, if levels[].value is 20 and unit is user, then levels[].name becomes 20 users.

levels.level[] Array No

Represents the order of the entitlement levels from lowest to highest.

  • When type is quantity: Provide the level for the lowest entitlement level as 0, the next higher level as 1, followed by 2, and so on.
  • When type is custom: Provide the level for the lowest entitlement level as 0, the next higher level as 1, followed by 2, and so on. Note: There are some validations to be considered.
  • When type is range: Provide 0 for the minimum value and 1 for the maximum value in the range.

When not defined, it is assumed as the index of the levels[] array.

levels.value[] Array No

The value denoting the entitlement level granted.

  • When type is quantity: this attribute denotes the quantity of units of the feature for this entitlement level. For example, a feature such as number of users can have levels[].value as 5, 20, 50, and 100. levels[].is_unlimited is used to set the entitlement level to "unlimited".
  • When type is range: there can be only two elements in the levels[] array; one corresponding to the minimum value (levels[0]) and the other to the maximum value (levels[1]) of the range of possible entitlement levels. For example, a feature such as number of users may have levels[0].value = 5 and levels[1].value = 50000. When the upper limit is "unlimited", then levels[1].value is not set and levels[1].is_unlimited is true.
  • When type is custom: this attribute denotes the value of this custom entitlement level. For example, a feature Email Support can have levels[].value as one of say, 24×7 and 24×5.

Note

This must be provided exactly as it already exists for the feature if the value is currently mapped to an entitlements or subscription_entitlements.

status String No

The current status of the feature. * active - A draft or an archived feature can be changed to active. Any or subscription entitlements defined for the feature take effect immediately. * 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. * archived - An active feature can be changed to archived. Once archived, no new 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.

Possible values:

  • "active"
  • "archived"
  • "draft"
unit String No

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.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. 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.
  3. Click Test request to test run your request to the API and see the API's response.