Checks whether a customer currently has enough balance to use a feature.
Use this to gate access before a feature action. Enable sendEvent when you want to check and consume balance atomically in one request.
allowed: true if they have sufficient balance, the feature is unlimited, or it’s a boolean feature included in their plan.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the customer.
The ID of the feature.
The ID of the entity for entity-scoped balances (e.g., per-seat limits).
Minimum balance required for access. Returns allowed: false if the customer's balance is below this value. Defaults to 1.
Additional properties to attach to the usage event if send_event is true.
If true, atomically records a usage event while checking access. The required_balance value is used as the usage amount. Combines check + track in one call.
If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls.
OK
Whether the customer is allowed to use the feature. True if they have sufficient balance or the feature is unlimited/boolean.
The ID of the customer that was checked.
The customer's balance for this feature. Null if the customer has no balance for this feature.
{
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}The ID of the entity, if an entity-scoped check was performed.
The required balance that was checked against.
Upgrade/upsell information when access is denied. Only present if with_preview was true and allowed is false.