Overview
Configure credits products and manage customer unit balances with an auditable ledger.
Credits products sell integer usage units such as API calls, AI tokens, or game currency. Each dedicated credits product owns exactly one default CREDITS variant and can define ordered, non-overlapping rate tiers.
Each balance belongs to one store, customer, and credits product. Adding, spending, or adjusting credits updates the balance and adds a permanent transaction record together. Supply an idempotency_key for every transaction: retrying identical input returns the existing entry; reusing the key for different input is rejected.
All credit quantities and balances are integers. Base prices use integer minor currency units in price_cents. Exact tier unit prices remain decimal strings with at most four decimal places and must never be sent as JSON floats.
For API keys, product endpoints require the listing ability; balance and transaction endpoints require the credit ability. OAuth uses products:read or products:write for product endpoints and payments:read or payments:write for balances and transactions. The account's current store permissions also apply.