Items represent the products or services that you offer to your customers. Items often differ from each other in the product features that are available in them. An item entitlement object represents the entitlement an item has towards a feature. An item can have multiple such entitlements, each corresponding to a unique feature it is entitled to.
Item entitlements can be created while creating a feature. All subscriptions containing an item also inherit its entitlements.
{
"feature_id": "fea-38eae836-73b4-4056-9704-254818d145de",
"feature_name": "Quickbooks Integration_123",
"id": "item-ent-56a6f379-f8e1-44f7-9e83-a7d57522fa1b",
"item_id": "enterprise",
"item_type": "plan",
"name": "Available",
"object": "item_entitlement",
"value": "true"
}
type
of the item
to which this entitlement belongs.id
of the feature towards which this entitlement has been granted.name
of the feature
towards which this entitlement 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 available
or true
.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
.aitem_entitlements
for the item
specified.
curl https://{site}.chargebee.com/api/v2/items/enterprise/item_entitlements \ -G \ -u {site_api_key}:\ --data-urlencode limit=2 \ --data-urlencode offset="0"
curl https://{site}.chargebee.com/api/v2/items/enterprise/item_entitlements \ -G \ -u {site_api_key}:\ --data-urlencode limit=2 \ --data-urlencode offset="0"
item_entitlement
s for the feature
specified.
curl https://{site}.chargebee.com/api/v2/features/fea-66ee05d2-2800-449f-a418-eaa863a67f9f/item_entitlements \ -G \ -u {site_api_key}:\ --data-urlencode limit=2 \ --data-urlencode offset="0"
curl https://{site}.chargebee.com/api/v2/features/fea-66ee05d2-2800-449f-a418-eaa863a67f9f/item_entitlements \ -G \ -u {site_api_key}:\ --data-urlencode limit=2 \ --data-urlencode offset="0"
item_entitlement
s for an feature
depending on the action
specified. The API returns the upserted or deleted item_entitlements
after successfully completing the operation. The operation returns an error when the first item_entitlement
fails to be processed. Either all the item_entitlement
s provided in the request are processed or none.
# Adding item entitlements for a feature curl https://{site}.chargebee.com/api/v2/features/fea-38eae836-73b4-4056-9704-254818d145de/item_entitlements \ -X POST \ -u {site_api_key}:\ -d action="upsert" \ -d item_entitlements[value][0]="true" \ -d item_entitlements[item_id][0]="enterprise" \ -d item_entitlements[item_type][0]="plan"
item_entitlement
specified.item_entitlement
already exists for the feature_id
and item_id
combination, the value
of the item_entitlement
is updated. If it doesn’t exist, a new item_entitelment
is created.removeDeletes the item_entitlement
for the feature_id
and item_id
combination, if it exists.id
of the item
to which this entitlement belongs.
type
of the item
to which this entitlement belongs.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 available
or true
.Upserts or removes a set of item_entitlements
for an item
depending on the action
specified. The API returns the upserted or deleted item_entitlements
after successfully completing the operation. The operation returns an error when the first item_entitlement
fails to be processed. Either all the item_entitlement
s provided in the request are processed or none.
# Adding item entitlements for an item curl https://{site}.chargebee.com/api/v2/items/basic/item_entitlements \ -X POST \ -u {site_api_key}:\ -d action="upsert" \ -d item_entitlements[value][0]="true" \ -d item_entitlements[feature_id][0]="fea-2959f91d-a517-4440-a7d0-b00cf2fcec62"
item_entitlement
specified.item_entitlement
already exists for the feature_id
and item_id
combination, the value
of the item_entitlement
is updated. If it doesn’t exist, a new item_entitelment
is created.removeDeletes the item_entitlement
for the feature_id
and item_id
combination, if it exists.id
of the feature towards which this entitlement 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 available
or true
.