# Features

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


Subscriptions are created in Chargebee using items. Items represent the products or services that you offer to your customers. Items often differ in the number of product features that are available to them. The Features API helps you define the various features offered as part of your product line. It also defines the entitlements that items and subscriptions can have towards said features.

**Note**

The maximum number of features a site can have is 400.

## Features of this API[](#features-of-this-api)

The Features API enables you to:

-   Define the set of features provided by your product.
-   Specify the entitlements that items have towards said features.
-   For a given subscription, modify the entitlements inherited from items in the subscription.
-   Offer additional feature entitlements to subscriptions than those inherited from items in the subscription.
-   Serve as a source of truth to your provisioning systems for subscription entitlements.
-   Use entitlement information to understand which features drive value and revenue.

**See also**

-   [Entitlements](/docs/api/entitlements)
-   [Subscription Entitlements](/docs/api/subscription_entitlements)
-   [Entitlement Overrides](/docs/api/entitlement_overrides)

## Sample Feature

```json
{
  "feature": {
    "description": "Integration of Chargebee with Quickbooks",
    "id": "fea-4c163c85-f873-46d4-a268-5a80ddf40971",
    "levels": {},
    "name": "Quickbooks Integration_123",
    "object": "feature",
    "status": "draft",
    "type": "switch"
  }
}
```

## Features attributes

## Input Parameters

- `id` (required, string, max chars=50)
  A unique and immutable identifier for the feature. You can set it yourself, in which case it is recommended that a human-readable format (or slug) be used. For example, `number-of-users-ccjht01`. When not provided, a random value is automatically set.

- `name` (required, string, max chars=50)
  A case-sensitive unique name for the feature. For example: `user license` , `data storage` , `Salesforce Integration` , `devices` , `UHD Streaming` , and so on.
  
  **Note:** This name is not displayed on any customer-facing documents or pages such as [invoice PDFs](/docs/api/invoices/retrieve-invoice-as-pdf) or [hosted pages](/docs/api/hosted_pages). However, in the future, it is likely to be introduced on the [Self-Serve Portal](/docs/api/portal_sessions) .

- `description` (optional, string, max chars=500)
  A brief description of the feature. For example: `Access to 10TB cloud storage` .

- `status` (optional, enumerated string)
  The current status of the feature.
  Possible enum values:
    - `active`
      A `draft` or an `archived` feature can be changed to `active`. Any [entitlements](/docs/api/entitlements) or [subscription entitlements](/docs/api/subscription_entitlements) defined for the feature take effect immediately.
    - `archived`
      An `active` feature can be changed to `archived`. Once `archived` , no **new** [entitlements](/docs/api/entitlements) or [subscription entitlements](/docs/api/subscription_entitlements) can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was `active` , remain effective.
    - `draft`
      The feature is in an unpublished state. [Entitlements](/docs/api/entitlements) and [subscription entitlements](/docs/api/subscription_entitlements) can be created for a draft feature but they are not effective until the feature is active. A feature `status` cannot be changed back to `draft` once it is in `active` or `archived` `status` .

- `type` (optional, enumerated string)
  The type of feature.
  Possible enum values:
    - `switch`
      A switch or toggle is a feature that an item or subscription can be either fully entitled to or not entitled to at all.
    - `custom`
      The entitlement levels available for this feature are defined as a set of custom values. For example, a feature `Email Support` can have entitlement levels as `24×7` and `24×5` .
    - `quantity`
      The feature is quantity-based and entitlement levels available for it are a set of predefined number of quantity units. For example, a feature with `name` such as `number of users` can have entitlement levels of say, `5` , `20` , `50` , and `100`. `levels[is_unlimited]` is used for specifying the "unlimited" entitlement level.
    - `range`
      The feature is quantity-based and the entitlement levels available for it are the set of whole numbers within a range. The range is defined by a minimum and a maximum value. For example, a feature such as `number of users` can have entitlement levels starting at `5` users and go up to `50000`. `levels[is_unlimited]` is used for specifying the "unlimited" entitlement level.

- `unit` (optional, string, max chars=50)
  For features of `type` `quantity` or `range` , this specifies the unit of measure. The value is expected in the singular form and when used by the system, it is pluralized automatically as needed. For example, for a feature such as `user licenses` , the `unit` can be `license` .

- `resource_version` (optional, long)
  The version number of this resource. For every change made to the resource, `resource_version` is updated with a new timestamp in milliseconds.

- `updated_at` (optional, timestamp(UTC) in seconds)
  The version number of this resource. For every change made to the resource, `resource_version` is updated with a new timestamp in milliseconds.

- `created_at` (required, timestamp(UTC) in seconds)
  When the feature was created.

- `metered` (required, boolean)
  Indicates if the feature is a metered feature

- `levels` (optional, list of level)
  An ordered list of entitlement levels available for the feature. This is only applicable when `type` is other than `switch` . **Note:** When the `type` of the feature is `switch` , this is not applicable. This is because any given entity can be either fully entitled to a `switch` feature or not entitled at all; there are no intermediate entitlement levels.
  - `name` (optional, string, max chars=50)
    A case-sensitive display name for the entitlement level. Provide a name that helps you clearly identify the entitlement level. For example: a feature such as `Email Support` can have entitlement levels named as `All weekdays` , `All days` , `40 hours per week` and so on.
    
    When not provided for `feature.type` `quantity` or `range` , this name is auto-generated as the space-separated concatenation of `levels[].value` and the pluralized version of `unit`. For example, if `levels[].value` is `20` and `unit` is `user` , then `levels[].name` becomes `20 users` .
  - `value` (required, string, max chars=50)
    The value denoting the entitlement level granted.
    
    -   **When `type` is `quantity`:** this attribute denotes the quantity of units of the feature for this entitlement level. For example, a feature such as `number of users` can have `levels[].value` as `5`, `20`, `50`, and `100`. `levels[].is_unlimited` is used to set the entitlement level to "unlimited".
    -   **When `type` is `range`:** there can be be only two elements in the `levels[]` array; one corresponding to the minimum value (`levels[0]`) and the other to the maximum value (`levels[1]`) of the range of possible entitlement levels. For example, a feature such as `number of users` may have `levels[0].value` = `5` and `levels[1].value` = `50000`. When the upper limit is "unlimited", then `levels[1].value` is not set and `levels[1].is_unlimited` is `true`.
    -   **When `type` is `custom`:** this attribute denotes the value of this custom entitlement level. For example, a feature `Email Support` can have `levels[].value` as one of say, `24×7` and `24×5`.
  - `level` (required, integer)
    This attribute represents the order of the entitlement levels from lowest to highest.
    
    -   When `type` is `quantity` or `custom`: The lowest entitlement level has the value `0`, the next higher level has the value `1`, followed by `2`, and so on.
    -   When `type` is `range`: This attribute is `0` for the minimum value and `1` for the maximum value in the range.
    
    When not defined, it is assumed as the index of the `levels[]` array.
  - `is_unlimited` (required, boolean)
    When `type` is `quantity` or `range` , this attribute indicates whether the entitlement level corresponds to unlimited units of the feature. Possible values:
    
    -   `true`: The entitlement level corresponds to unlimited units of the feature. `levels[].value` is ignored for this level. This can only be set for the level that has the highest value for `levels[].level.`
    -   `false`: The entitlement level does not correspond to unlimited units of the feature.

