ChargebeeAPI

Entitlements

The entitlement resource establishes a connection between a 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.

Sample EntitlementJSON

Entitlements attributes

id
required, string, max chars=100

A unique identifier for the entitlement. This is auto-generated.

entity_id
optional, string, max chars=100

The unique identifier of the entity being granted entitlement to a specific feature.

entity_type
optional, enumerated string

The type of the entity that holds this entitlement.

Possible Enum Values
plan

Indicates that the entity is an item with type set to plan.

addon

Indicates that the entity is an item with type set to addon.

charge

Indicates that the entity is an item with type set to charge.

plan_price

Indicates that the entity is an item_price associated with an item of type plan.

addon_price

Indicates that the entity is an item_price associated with an item with type set to addon.

feature_id
optional, string, max chars=50

The unique identifier of the feature to which the entity gains entitlement.

feature_name
optional, string, max chars=50

The name of the feature associated with this entitlement.

value
optional, string, max chars=50

The level of entitlement that the entity has towards the feature. The possible values depend on the value of feature.type :

  • When feature.type is quantity and:

  • If feature.levels[is_unlimited] is not true for any one of feature.levels[], then the value can be any one of feature.levels[value][].

  • If feature.levels[is_unlimited] is true for one of the feature.levels[], then the value can be:

    • any one of feature.levels[value][]
    • or it can be unlimited (case-insensitive), indicating unlimited entitlement.
  • When type is range and:

  • If 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).

  • If feature.levels[is_unlimited] is true for one of the feature.levels[], then the value can be:

    • any whole number equal to or greater than levels[value][0]
    • or it can be unlimited (case-insensitive), indicating unlimited entitlement.
  • When type is custom, then the value can be any one of feature.levels[value][].

  • When type is switch, then the value is set as available or true.

name
optional, string, max chars=50

The display name for the entitlement level. The value is automatically generated based on feature.type:

  • When 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.
  • When feature.type is custom, the name matches the value.
  • When feature.type is switch, the name is set to Available when value is true; it's set to Not Available when value is false.