Skip to main content
A customer’s balance is the sum of their unexpired grants from plans and packs, minus what they’ve spent. Credits and balances explains where grants come from and the order they’re spent in.

The customer

Response
  • availableCredits is the prepaid balance, plan and pack credits together, and never goes below zero.
  • currentPlan is null when the customer has no plan. That isn’t a zero balance: they may hold pack credits.
  • currentPlan.status is pending_checkout while a paid plan’s Checkout is open; until it’s paid, the customer keeps their previous plan’s credits.
  • overage is this period’s overage, or null when the plan has none.

Subscriptions

listCustomerSubscriptions returns each plan the customer has had, newest first. Each has its numeric id, planId, status (see subscription statuses), the current period, and a cancellation object that drives renewal controls.

Purchases

listCustomerPurchases returns each credit pack the customer has bought, newest first, with its status (pending_checkout or paid) and creditAmount. While a purchase is pending_checkout, its creditAmount is null and nothing has been granted. Both lists return 25 items a page. Pass limit (up to 100), and the previous page’s nextCursor as cursor, for more.

In the dashboard

Customers shows each customer’s balance as a meter, one segment per grant. Usage lists every tracked request, charged or blocked, and opening one shows which grants paid for it.