Check Balance
Core Endpoints
Check Balance
POST
Check Balance
Checks whether a customer currently has enough balance to use a feature. Optionally combines checking and consuming balance in a single atomic operation.
Authentication
Requires a valid API secret key in theAuthorization header:
Request Body
string
required
The ID of the customer.
string
required
The ID of the feature to check access for.
string
The ID of the entity for entity-scoped balances (e.g., per-seat limits).
number
default:1
Minimum balance required for access. Returns
allowed: false if the customer’s balance is below this value.boolean
If true, atomically records a usage event while checking access. The
required_balance value is used as the usage amount. This combines check + track in one call.object
Additional properties to attach to the usage event if
send_event is true. Accepts any key-value pairs.boolean
If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls.
Query Parameters
boolean
If true, bypasses the cache and fetches fresh data.
string
Comma-separated list of fields to expand. Available options:
balance.feature: Include full feature object in the balance response
Response
boolean
Whether the customer is allowed to use the feature. True if they have sufficient balance or the feature is unlimited/boolean.
string
The ID of the customer that was checked.
string
The ID of the entity, if an entity-scoped check was performed.
number
The required balance that was checked against.
object
The customer’s balance for this feature. Null if the customer has no balance for this feature.
string
The feature ID this balance is for.
number
Total balance granted (included + prepaid).
number
Remaining balance available for use.
number
Total usage consumed in the current period.
boolean
Whether this feature has unlimited usage.
boolean
Whether usage beyond the granted balance is allowed (with overage charges).
number
Maximum quantity that can be purchased as a top-up, or null for unlimited.
number
Timestamp when the balance will reset, or null for no reset.
array
Detailed breakdown of balance sources when stacking multiple plans or grants.
string
The unique identifier for this balance breakdown.
string
The plan ID this balance originates from, or null for standalone balances.
number
Amount granted from the plan’s included usage.
number
Amount granted from prepaid purchases or top-ups.
number
Remaining balance available for use.
number
Amount consumed in the current period.
boolean
Whether this balance has unlimited usage.
object
object
Pricing configuration if this balance has usage-based pricing.
number
Timestamp when this balance expires, or null for no expiration.
object
The full feature object if
expand=balance.feature was used.object
Upgrade/upsell information when access is denied. Only present if
with_preview was true and allowed is false.Example Request
Simple Check
Check and Consume (Atomic)
Example Response
Error Responses
object
string
Human-readable error message.
string
Machine-readable error code. Common codes:
customer_not_found: The specified customer doesn’t existfeature_not_found: The specified feature doesn’t existinvalid_inputs: Request validation failedentity_not_found: The specified entity doesn’t existinsufficient_balance: Customer doesn’t have enough balance (whensend_eventis true)