Skip to main content
POST
Check & Deduct Credits
Legacy wallet adapter. It does not apply Feature conversion rates or the product-credit source ledger. New integrations must use Track and Consume Credits.
Atomically check if a customer has sufficient credit balance and deduct in a single database transaction. Uses row-level locking to prevent race conditions under concurrent requests. Auth: sk_ only
string
required
External customer ID
string
required
Feature being consumed
number
required
Number of credits to deduct (must be positive)
boolean
required
Whether sufficient balance existed to fulfill the deduction
number
required
Credit balance after deduction (or unchanged balance if denied)
When allowed is false, no credits are deducted. The remaining field returns the current balance as-is.