Check API
The usage meter route your server calls to check access. Read GET /v1/entitlements with a usage key, and every field, answer and status code it has.
Your app checks a customer's access on the usage meter, the same service at https://usage.comecero.com that takes usage events. Call it from your server: it does not answer browsers. It does not take Comecero API tokens, only usage keys. The SDK is coming soon and is not on npm yet. Use plain HTTP today.
Every query field, response schema and status code is in Check feature access.
Check a customer's entitlements
GET https://usage.comecero.com/v1/entitlements
Headers
| Header | Value |
|---|---|
Authorization | Bearer apk_live_... or Bearer apk_test_... |
The key decides the account and the mode (live or test). Nothing in the query can change them.
Query
| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string | Yes | 1 to 128 of A-Z a-z 0-9 _ . : -. Your id for the customer, the one usage events send as external_customer_id. It is the customer's external_id, or their Comecero customer_id when none is set. |
feature | string | No | 1 to 64 of a-z 0-9 _ . -. One feature's key. Leave it out for every feature. |
curl "https://usage.comecero.com/v1/entitlements?customer_id=user_8412" \
-H "Authorization: Bearer $COMECERO_USAGE_KEY"Answer
{
"customer_id": "user_8412",
"checked_at": "2026-11-15T10:30:00.000Z",
"rules_revision": {
"catalog_version": 3,
"customer_version": 1,
"revisions": { "fs_pro|2026-11-01T00:00:00.000Z": 1 }
},
"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"
}
]
},
{
"feature": "sso",
"type": "boolean",
"has_access": true,
"reason": null,
"value": true,
"limit": null,
"used": null,
"remaining": null,
"reset_at": null,
"hard_limit": false,
"limit_reached": false,
"valid_until": null
}
]
}One row per feature in your catalog, or only the one asked for. A customer the meter doesn't know gets every feature with has_access: false and reason: "not_entitled".
| Field | Type | Description |
|---|---|---|
customer_id | string | The id you sent. |
checked_at | string | When the answer was made, ISO 8601 in UTC. |
rules_revision | object | The catalog and customer versions and the feature set revisions used for this answer. Versions can be null when no record has synced. |
entitlements[].feature | string | The feature's key. |
entitlements[].type | string | boolean, number or metered. |
entitlements[].has_access | boolean | Whether the customer may use the feature now. |
entitlements[].reason | string or null | Why not: not_entitled (never granted), ended (the access ended), denied (an override took it away), limit_reached (a hard limit) or usage_not_read (a hard limit whose usage this check of every feature did not read, so ask for the feature alone; or a finite hard limit whose usage can't be read). Null when has_access is true. |
entitlements[].value | boolean, string or null | boolean: true or false. number: the value as a decimal string, null for unlimited. metered: null. |
entitlements[].limit | string or null | metered: the limit in the window, null for unlimited. See no pooling. |
entitlements[].used | string or null | metered: the usage in the window. |
entitlements[].remaining | string or null | metered: what is left, never below 0. Null when unlimited. |
entitlements[].reset_at | string or null | metered: when the window ends and usage starts again from zero. Null for a window that never resets. |
entitlements[].hard_limit | boolean | Whether reaching the limit stops access. |
entitlements[].limit_reached | boolean | Whether usage reached the limit. With a soft limit, has_access stays true. |
entitlements[].valid_until | string or null | The earliest moment the answer may change by itself: an override expiring, access ending, a window resetting. Null when none is known. |
entitlements[].items | array | metered: one item per purchase (or the override alone), with source, has_access, limit, used, remaining, reset_at, hard_limit, limit_reached and valid_until. |
entitlements[].usage_unavailable | boolean | Present and true when the usage could not be read. used and remaining are then null. A soft limit then does not deny access; a finite hard limit whose usage was not read, for any reason, is denied with usage_not_read. |
Quantities are decimal strings, such as "12840" or "0.5".
Status codes
| Status | Meaning |
|---|---|
200 | The rows. |
400 | { "error": "<code>" } with invalid_customer_id or invalid_feature: the value is missing or not in the allowed format. |
401 | No Authorization header ({ "message": "Unauthorized" }). |
403 | The usage key is unknown, revoked, not active yet, or in the wrong format ({ "message": "Forbidden" }). |
404 | feature_not_found: your catalog has no feature with that key. |
429 | too_many_requests: the account sent over its checks-per-second limit (500 by default) (live and test together), or the route is over its limit. Try again after the Retry-After seconds. |
503 | try_again: a temporary problem. Try again. |
Rules
- Cache the answer. Keep it until
valid_untilor for 60 seconds, whichever comes first, and drop it whenentitlement:changedarrives for the customer. - Seconds behind. Usage is read from the meter's totals, which are seconds behind the events you send. A burst can pass a hard limit by a little.
- Usage is read hard limits first. When usage can't be read, the row has
usage_unavailable: trueand a soft limit or an unlimited one does not take access away. A check of every feature reads at most 32 separate usages (one metric in one window), hard limits first. A hard limit past that is denied withreason: "usage_not_read"rather than granted unchecked: ask for thatfeaturealone, which reads all of its usage. A soft limit past it keeps access withusage_unavailable. A finite hard limit is also denied withusage_not_readwhile its usage can't be read, because it may already be over the limit. - No pooling. Purchases of the same feature are never added up. See no pooling.
- Your server only. The key must stay on your server. Pages ask your backend, which asks the meter. See HTTP integration.
Quickstart
Create features, publish a feature set, sell it with a product, then check access from your backend over HTTP and hear about changes by webhook.
Customer entitlements
Read what one customer can do from the Comecero API, with the override and the purchase behind each feature, for support tools and your back office.