Demo
Charge an Active Permission
First collect and store a permission with the Spend Permissions guide. At each billing time, check its current status before preparing calls.TypeScript backend
Every call receipt succeeds, the period’s
remainingSpend decreases, and the recipient receives the scheduled amount.Handle Renewal Failures
Treat these outcomes as normal billing states:- Revoked or expired: stop retries and ask the buyer for a new permission.
- Insufficient token balance: notify the buyer and retry according to your billing policy.
- Period allowance exhausted: wait for
nextPeriodStartor collect a new permission.
See Also
Spend Permissions SDK
Request, inspect, spend, and revoke permissions.
Subscriptions API Reference
Review the subscription lifecycle and SDK surface.