v1

latestOpenAPI 3.1.02026-07-265817860.8 KB
balances

Create a balance for a customer feature.

post/v1/balances.create

Headers

x-api-versionstring required

Request body

customer_idstring required

The ID of the customer.

feature_idstring required

The ID of the feature.

entity_idstring

The ID of the entity for entity-scoped balances (e.g., per-seat limits).

included_grantnumber

The initial balance amount to grant. For metered features, this is the number of units the customer can use.

unlimitedboolean

If true, the balance has unlimited usage. Cannot be combined with 'included_grant'.

expires_atnumber

Unix timestamp (milliseconds) when the balance expires. Mutually exclusive with reset.

next_reset_atnumber

Unix timestamp (milliseconds) for the first reset boundary, allowing a custom (e.g. shorter) first period. Requires 'reset', and must occur before 'expires_at' if both are provided. Subsequent resets advance by one reset interval from this boundary.

balance_idstring

A unique identifier for this balance. Use this to target the balance in future update / delete calls.

Example request

{
  "customer_id": "cus_123",
  "feature_id": "api_calls",
  "included": 1000,
  "reset": {
    "interval": "month"
  }
}

Response

OK

successboolean required
All 58 operations