# Customer entitlements (/docs/entitlements/customer-entitlements)

[Get a customer's entitlements](/api/customer-entitlements/get-customer-entitlements) answers the same rows as the [check API](/docs/entitlements/check-api), plus why each feature has the value it has. It is meant for your back office and support tools. Your app should check access with the check API: it is faster, needs no Comecero API token, and is what the 60-second cache rules are made for.

**GET** `https://api.comecero.com/api/v1/customers/{customer_id}/entitlements`

| | |
| --- | --- |
| Path | `customer_id`: the Comecero customer id (not the `external_id`). |
| Query | `feature` (optional): one feature's key. Leave it out for every feature. |
| Tokens | Secret and trusted tokens. A limited token gets `403`. |

````bash
curl "https://api.comecero.com/api/v1/customers/0091304300408CuoxY9Pf3/entitlements?feature=api_calls" \
  -H "Authorization: Bearer $COMECERO_SECRET_TOKEN"
````

## Answer [#answer]

````json
{
  "object": "customer_entitlements",
  "customer_id": "0091304300408CuoxY9Pf3",
  "external_id": "user_8412",
  "checked_at": "2026-11-15T10:30:00.000Z",
  "entitlements": [
    {
      "feature": "api_calls",
      "type": "metered",
      "has_access": true,
      "reason": null,
      "value": null,
      "limit": "50000",
      "used": "12840",
      "remaining": "37160",
      "reset_at": "2026-12-01T00:00:00.000Z",
      "hard_limit": true,
      "limit_reached": false,
      "valid_until": "2026-12-01T00:00:00.000Z",
      "items": [
        {
          "source": "SB0123456789:1",
          "has_access": true,
          "limit": "50000",
          "used": "12840",
          "remaining": "37160",
          "reset_at": "2026-12-01T00:00:00.000Z",
          "hard_limit": true,
          "limit_reached": false,
          "valid_until": "2026-12-01T00:00:00.000Z"
        }
      ],
      "plan_value": "10000",
      "override": {
        "override_id": "eo_9b2e6c1d4a7f4e3b8c5d0a1f2e3d4c5b",
        "feature_key": "api_calls",
        "limit": "50000",
        "expires_at": "2026-12-31T23:59:59.000Z"
      },
      "source": "SB0123456789:1"
    }
  ]
}
````

`external_id` is your id for the customer: the one the check API and usage events use. It is the `customer_id` when you haven't set one.

Each row has every field the [check API](/docs/entitlements/check-api#answer) answers, and three more:

| Field | Type | Description |
| --- | --- | --- |
| `plan_value` | boolean, string or null | What the customer's purchases give without the override, in the same form as `value` (boolean and number) or `limit` (metered). Here the plan gives 10,000 calls and the override raises it to 50,000. |
| `override` | object or null | The active [override](/docs/entitlements#overrides) for the feature: `override_id`, `feature_key`, `value`, `limit` or `unlimited`, and `expires_at`. Null when there is none. |
| `source` | string or null | For boolean features, the first granting purchase; for number features, the purchase with the highest value (unlimited wins). Both are null when an override applies. For metered features, the single item's source: the purchase source even when its limit is overridden, or `"override"` when only an override grants access. Null for multiple metered items, when nothing grants the feature, or when an override denies it. |

## When usage can't be read [#when-usage-cant-be-read]

If the usage meter doesn't answer in time, Comecero still answers. The rows come from what the customer bought and their overrides, without usage: `used` and `remaining` are null and `usage_unavailable` is true. Soft limits and unlimited grants keep access. A finite hard limit is denied with `reason: "usage_not_read"`, since Comecero can't tell whether it was reached.

## Errors [#errors]

| Status | Code | Meaning |
| --- | --- | --- |
| `403` | `insufficient_permissions` | The token is a limited token. |
| `403` | `entitlements_not_enabled` | Entitlements are not turned on for the account. |
| `404` | `customer_not_found` | No customer has this id. |
| `404` | `feature_not_found` | `feature` is not a feature of your catalog. |
| `500` | `request_failure` | Comecero's own records of the customer could not be read in time. Try again. |

## Change a customer's access [#change-a-customers-access]

You don't change entitlements on this route. To change what one customer gets, [create an override](/api/entitlement-overrides/create-entitlement-override), or [delete one](/api/entitlement-overrides/delete-entitlement-override) to go back to what they bought. To change what a plan gives, [publish a new revision](/api/feature-sets/publish-feature-set-revision) of its feature set.
