Skip to Content
Docs
API referenceAuthorization API

Billing entitlements

POST
/v1/entitlements/check

billing.entitlement.v1.EntitlementService/CheckEntitlement (39-entitlements-and-controls.md, API Surface; Check, list, consume). No side effects. A denial is a 200 with allowed false and a reason (not_entitled, allowance_exhausted, balance_exhausted, access_restricted), never an error (Error Handling). value is the feature's value: true, a decimal string, or a metered feature's allowance; when the Customer is not entitled to it, false for a boolean feature and null otherwise. limit is a metered feature's state, null for other types. Only external subjects resolve until Phase 4. The RPC writes nothing and takes no idempotency key, so X-Idempotency-Key is not read.

Authorization

BearerAuth
headerAuthorization<token>

Access token as "Bearer "

Response Body

An entitlement_check object: { allowed, value, reason, limit }

application/json
  1. response
id?string

ID is its prefixed id.

object?string

Object names the kind: customer, invoice, contract, …

Example Request
curl -X POST 'https://authz.us.pontive.com/v1/entitlements/check'
Example Response
{  "id": "string",  "object": "string"}
POST
/v1/entitlements/consume

billing.entitlement.v1.EntitlementService/ConsumeEntitlement (39-entitlements-and-controls.md, API Surface; Check, list, consume). Resolves, decides as a check would and, when allowed, records the usage event, in one transaction. Idempotent on transaction_id, not on X-Idempotency-Key, which is not read: a retry of an allowed consume answers the first decision with replayed true and consumes nothing again; a denied consume records nothing and is decided again on retry (billing-svc docs/questions.md, P9). A denial is a 200 with allowed false and a reason, never an error. properties is a JSON object, kept as sent. The usage event is checked against its event type's schema as ingest checks it: with validation warn, an allowed consume lists warnings, each { code, property, expected }; with reject, one that does not fit is refused with 422 schema_mismatch and records nothing: the error's details list each violation as { field: its property, message: its code and what was expected } (billing-svc docs/questions.md, P99, P111).

Authorization

BearerAuth
headerAuthorization<token>

Access token as "Bearer "

Response Body

An entitlement_consumption object: { allowed, value, reason, limit, event_id, replayed, warnings }

application/json
  1. response
id?string

ID is its prefixed id.

object?string

Object names the kind: customer, invoice, contract, …

Example Request
curl -X POST 'https://authz.us.pontive.com/v1/entitlements/consume'
Example Response
{  "id": "string",  "object": "string"}