feature
and an item
or an item_price
in Chargebee Billing. By defining this relationship, it specifies the scope of access or rights the item or item price has in relation to that particular feature.{
"entitlement": {
"feature_id": "fea-66ee05d2-2800-449f-a418-eaa863a67f9f",
"feature_name": "Quickbooks Integration_1234",
"id": "ent-15292c03-0b77-426a-aa5b-a18bb0acafdc",
"entity_id": "enterprise",
"entity_type": "plan",
"name": "Available",
"object": "entitlement",
"value": "true"
}
}
Chargebee\Resources\Entitlement\Entitlement
Indicates that the entity is an item
with type
set to plan
.
Indicates that the entity is an item
with type
set to addon
.
Indicates that the entity is an item
with type
set to charge
.
Indicates that the entity is an item_price
associated with an item
of type
plan
.
Indicates that the entity is an item_price
associated with an item
with type
set to addon
.
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 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
.The display name for the entitlement level. The value is automatically generated based on feature.type
:
feature.type
is quantity
or range
, the name
is the space-separated concatenation of value
and the plural form of feature.unit
. For instance, if value
is 20
and feature.unit
is user
, the name
will be 20 users
.feature.type
is custom
, the name
matches the value
.feature.type
is switch
, the name
is set to Available
when value
is true
; it’s set to Not Available
when value
is false
.Retrieves a list of all the entitlement
s associated with the specified feature
.
require __DIR__ . '/vendor/autoload.php'; use Chargebee\ChargebeeClient; $chargebee = new ChargebeeClient(options: [ "site" => "{site}", "apiKey" => "{apiKey}", ]); $result = $chargebee->entitlement()->all([ "limit" => 2, "offset" => "0" ]); foreach($result->list as $entry){ $entitlement = $entry->entitlement; }
require __DIR__ . '/vendor/autoload.php'; use Chargebee\ChargebeeClient; $chargebee = new ChargebeeClient(options: [ "site" => "{site}", "apiKey" => "{apiKey}", ]); $result = $chargebee->entitlement()->all([ "limit" => 2, "offset" => "0" ]); foreach($result->list as $entry){ $entitlement = $entry->entitlement; }
$chargebee->entitlement->all([<param name> : <value>,<param name> : <value> ...])
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.
require __DIR__ . '/vendor/autoload.php'; use Chargebee\ChargebeeClient; $chargebee = new ChargebeeClient(options: [ "site" => "{site}", "apiKey" => "{apiKey}", ]); $result = $chargebee->entitlement()->create([ "action" => "upsert", "entitlements" => [ [ "value" => "true", "feature_id" => "fea-2959f91d-a517-4440-a7d0-b00cf2fcec62", "entity_id" => "enterprise", "entity_type" => "plan" ] ] ]); $entitlement = $result->entitlement;
require __DIR__ . '/vendor/autoload.php'; use Chargebee\ChargebeeClient; $chargebee = new ChargebeeClient(options: [ "site" => "{site}", "apiKey" => "{apiKey}", ]); $result = $chargebee->entitlement()->create([ "action" => "remove", "entitlements" => [ [ "feature_id" => "fea-2959f91d-a517-4440-a7d0-b00cf2fcec62", "entity_id" => "enterprise", "entity_type" => "plan" ] ] ]); $entitlement = $result->entitlement;
$chargebee->entitlement->create([<param name> : <value>,<param name> : <value> ...])
entitlement
specified. entitlement
already exists for the feature_id
and entity_id
combination, the value
of the entitlement
is updated. If it doesn’t exist, a new entitlement
is created.removeDeletes the entitlement
for the feature_id
and entity_id
combination, if it exists.feature
. In the case of an upsert
action
, if the entitlement
resource does not already exist, Chargebee does not validate this ID to confirm its correspondence to an existing entity. The entitlement
is created regardless.
The unique identifier of the feature
to which the entity gains entitlement.
Indicates that the entity is an item
with type
set to plan
.
Indicates that the entity is an item
with type
set to addon
.
item
with type
set to charge
.plan_priceIndicates that the entity is an item_price
associated with an item
of type
plan
.
Indicates that the entity is an item_price
associated with an item
with type
set to addon
.
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 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
.