subscriptions
inherit item_entitlements
from item
s that are in them. Even so, there are many reasons why you may want to override the inherited entitlements on a subscription:
feature
that the item
s on their subscription
are not entitled to.feature.level
without having to pay more.feature
because it is irrelevant to them.feature
bundles for each subscription
instead of grouping feature
s into a product catalog of item
s. This API helps you implement each of the above use cases by providing you a way to specify the entitlement_overrides
component
for any subscription_entitlement
. Such an override, when present, becomes the effective entitlement, thereby overriding any inherited_entitlements
for the subscription
.
entitlement_override
expiry
If expires_at
has been set, then the entitlement_override
object is no longer returned after expires_at
has passed. The expiration of an entitlement_override
does not trigger any event immediately. However, after expiry, the entitlement_override
record gets deleted within 12 hours. This deletion triggers the entitlement_overrides_auto_removed
event which can be considered as a notification, albeit delayed, for one or more entitlement_overrides
having expired.
{
"entity_id": "Jdf63vklssSDFdb",
"entity_type": "subscription",
"feature_id": "fea-be1a9281-d8df-48ce-82e2-294667eb4d94",
"feature_name": "Quickbooks Integration_123",
"id": "override-1935f8d6-b791-4181-9fa2-65fd8bfbd7ae",
"name": "Available",
"object": "entitlement_override",
"value": "true"
}
id
of the subscription to which this entitlement override belongs.subscription
.id
of the feature
towards which this entitlement override has been granted.name
of the feature
towards which this entitlement override has been granted.feature.type
:
feature.type
is quantity
and:feature.levels[is_unlimited]
is not true
for any one of feature.levels[]
, then the value can be any one of feature.levels[value][]
.feature.levels[is_unlimited]
is true
for one of the feature.levels[]
, then the value can also be:
feature.levels[value][]
unlimited
(case-insensitive), indicating unlimited entitlement.type
is range
and:feature.levels[is_unlimited]
is not true
for any one of feature.levels[]
, then the value can be any whole number between levels[value][0]
and levels[value][1]
(inclusive).feature.levels[is_unlimited]
is true
for one of the feature.levels[]
, then the value can be:
levels[value][0]
unlimited
(case-insensitive), indicating unlimited entitlement.type
is custom
, then the value can be any one of feature.levels[value][]
.type
is switch
, then the value is set as true
if the feature is available; it is set as false
when the feature is unavailable.feature.type
as follows:
feature.type
is quantity
or range
, then name
is the space-separated concatenation of value
and the pluralized version of feature.unit
. For example, if value
is 20
and feature.unit
is user
, then name
becomes 20 users
.feature.type
is custom
, then name
is the same as value
entitlement_overrides
for a subscription
depending on the action
specified. The API returns the upserted or deleted entitlement_overrides
after successfully completing the operation. The operation returns an error when the first entitlement_override
fails to be processed. Either all the entitlement_overrides
provided in the request are processed or none.
# Adding entitlement overrides for a feature curl https://{site}.chargebee.com/api/v2/subscriptions/Jdf63vklssSDFdb/entitlement_overrides \ -X POST \ -u {site_api_key}:\ -d action="upsert" \ -d entitlement_overrides[feature_id][0]="fea-be1a9281-d8df-48ce-82e2-294667eb4d94" \ -d entitlement_overrides[value][0]="true"
entitlement_override
specified. .entitlement_override
already exists for the feature_id
and {subscription_id}
combination, the value
of the entitlement_override
is updated. If it doesn’t exist, a new entitlement_override
is created.removeDeletes the entitlement_override
for the feature_id
and item_id
combination, if it exists.id
of the feature
towards which this entitlement override has been granted.
feature.type
:
feature.type
is quantity
and:feature.levels[is_unlimited]
is not true
for any one of feature.levels[]
, then the value can be any one of feature.levels[value][]
.feature.levels[is_unlimited]
is true
for one of the feature.levels[]
, then the value can also be:
feature.levels[value][]
unlimited
(case-insensitive), indicating unlimited entitlement.type
is range
and:feature.levels[is_unlimited]
is not true
for any one of feature.levels[]
, then the value can be any whole number between levels[value][0]
and levels[value][1]
(inclusive).feature.levels[is_unlimited]
is true
for one of the feature.levels[]
, then the value can be:
levels[value][0]
unlimited
(case-insensitive), indicating unlimited entitlement.type
is custom
, then the value can be any one of feature.levels[value][]
.type
is switch
, then the value is set as true
if the feature is available; it is set as false
when the feature is unavailable.entitlement_override
. When not passed, the entitlement_override
does not expire. This must be a value in the future and is relevant only when the action
is upsert
. The entitlement_override
object is no longer returned after this date has passed.
curl https://{site}.chargebee.com/api/v2/subscriptions/Jdf63vkLssSDFdb/entitlement_overrides \ -G \ -u {site_api_key}:\ --data-urlencode limit=1 \ --data-urlencode offset="0"
curl https://{site}.chargebee.com/api/v2/subscriptions/Jdf63vkLssSDFdb/entitlement_overrides \ -G \ -u {site_api_key}:\ --data-urlencode limit=1 \ --data-urlencode offset="0"