POST /entitlements
Create, update, or remove a set of entitlement
s for a feature.
The behavior depends on the specified action
. It tries to create, update, or delete entitlement
objects. If any of the entitlement objects fail to process, the entire operation stops with an error, and no entitlements are processed. In essence, the request processes either all the provided entitlements or none of them.
Grandfathering subscriptions {#grandfathering}
Early Access
Grandfathering support for entitlements is in early access. Write to eap@chargebee.com to get this enabled.
By default, this operation impacts all subscriptions that contain the item or item price. However, if you set apply_grandfathering
to true
, the existing subscriptions are not impacted by the change.
Example
Consider the following example:
On January 1st
- You have a plan price (
id
:premium-monthly-usd
) entitled to a feature (user_licenses
) at value10
. - You have a subscription (
id
:AzZjAiTl1btqS2lEj
) that contains the plan price (premium-monthly-usd
).
On January 2nd
- Using this API operation, you change the entitlement level of the plan price
premium-monthly-usd
for theuser_licenses
feature tovalue
20
. You also setapply_grandfathering
totrue
. - After the API operation completes, you create a new subscription (
id
:6oqNGUlMd9Yn4Ui
) that contains the same plan price (premium-monthly-usd
). - The existing subscription (
id
:AzZjAiTl1btqS2lEj
) is grandfathered in, so it continues to be entitled touser_licenses
atvalue
10
. The new subscription (id
:6oqNGUlMd9Yn4Ui
) is entitled touser_licenses
atvalue
20
.
On January 3rd
- Using this API operation, you change the entitlement level of the plan price
premium-monthly-usd
for theuser_licenses
feature tovalue
30
. You also setapply_grandfathering
tofalse
. - After the API operation completes, you create another subscription (
id
:99CRh8UgMXTq77tl
) that contains the same plan price (premium-monthly-usd
). - Because grandfathering was not enabled, all three subscriptions (
AzZjAiTl1btqS2lEj
,6oqNGUlMd9Yn4Ui
, and99CRh8UgMXTq77tl
) are now entitled touser_licenses
atvalue
30
.
Servers
- {protocol}://{site}.{environment}:{port}/api/v2
- {protocol}://{site}-test.{environment}:{port}/api/v2
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:
|
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:
|
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-event-email |
String | No |
skip only emails Possible values:
|
Request body fields
Name | Type | Required | Description |
---|---|---|---|
action |
String | Yes |
The specific action to be performed for each Possible values:
|
change_reason |
String | No |
Comments or reason for this entitlement change. |
entitlements |
Object | No |
Parameters for entitlements |
entitlements.entity_id[] |
Array | Yes |
The unique identifier of the entity being granted entitlement to a specific In the case of an |
entitlements.apply_grandfathering[] |
Array | No |
Early Access Grandfathering support for entitlements is in early access. Write to eap@chargebee.com to get this enabled. Determines whether to grandfather in existing subscriptions affected by this entitlement.
|
entitlements.value[] |
Array | No |
The level of entitlement that the entity has towards the feature. The possible values depend on the value of
|
entitlements.feature_id[] |
Array | Yes |
The unique identifier of the |
entitlements.entity_type[] |
Array | No |
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.