Skip to main content
An adjustment changes a customer’s credits outside a plan or credit pack: a goodwill credit after an outage, a support fix, or taking credits back after a refund. For one-off fixes, use Adjust credits on the customer’s page in the dashboard. From code:
  • Positive credits add a new grant that never expires, unless you set expiresAt. It’s spent after plan credits, alongside packs (spend order).
  • Negative credits remove credits in spend order and never take the balance below zero: asking for more returns 409 insufficient_credits with the availableCredits you can remove.
  • reason is required. It shows on the customer’s page and in billing history, with who made the change.
  • idempotencyKey is required, per customer. A retry with the same key and body returns the first adjustment and changes nothing; the same key with a different body returns 409 idempotency_key_reused.
The key needs the billing:write permission.

Grant a payment Ledger didn’t

If a customer paid and Ledger granted nothing, for example an invoice with a coupon that Ledger refused, add the credits with the payment’s stripeInvoiceId, or stripeCheckoutSessionId for a pack. Ledger checks with Stripe that the payment is paid and belongs to this customer, then marks it granted so it can’t be granted twice (409 stripe_object_already_granted). Adjust a customer’s balance lists every error.