Credit consumption & expiry
Credit consumption & expiry
How Solvimon draws down a customer’s credit balance when several grants are live at once, what the different balance figures mean, and what happens to credits that are never used.
Why this matters
A customer rarely holds a single block of credits. A recurring monthly grant, a promotional grant, and a purchased top-up can all sit in the same wallet with different expiry dates. Which block gets consumed first determines how much value the customer keeps at the end of the month, and it determines your deferred revenue and breakage numbers.
Drawdown order
Credits are consumed earliest expiry first. Solvimon orders the customer’s active grants in the wallet by expire_at and draws down the grant closest to expiring before touching any other.
Grants with no expiry are consumed last, after every expiring grant is exhausted. When two grants share the same expire_at, the older grant (earlier start_at) is consumed first.
Worked example. A customer holds two grants in the same wallet:
The customer consumes 1,200 credits during August. The first 1,000 come out of the monthly grant, because it expires on 31 August. The remaining 200 come out of the top-up. On 1 September the monthly grant is spent, the top-up holds 4,800, and a fresh 1,000-credit monthly grant is created.
Had the order been reversed, the customer would have lost 1,000 credits to expiry while still holding a paid balance. Earliest-expiry-first protects the customer’s paid credits and puts the shortest-lived credits to work first.
Drawdown order is fixed platform behavior. There is no per-grant priority or weighting field, and there is no way to make consumption draw from a specific grant.
Reading a balance
A wallet balance is not a single number. POST /v{version}/wallets/{resourceIdOrReference}/balance returns four figures:
Use open_balance for anything customer-facing, such as a “credits remaining” figure in your product. Use balance when reconciling against accounting.
Pass balance_at to ask for a historical balance. The default is now(), so omitting it gives the current balance. This is how you reproduce a month-end balance after the fact, which is what a reconciliation needs.
To read every wallet a customer holds in a single call, use POST /v{version}/customers/{resourceIdOrReference}/wallets/balance. The response returns one wallet_balance per wallet_id.
Expiry
Expiry is configured on the wallet grant in the pricing plan, as a period rather than a fixed date. The expiry_period on the grant’s expiry policy is measured from the grant’s start_at, so a one-month expiry period on a monthly recurring grant means each month’s credits expire as the next month’s credits arrive.
At expire_at, whatever is left in that grant stops being spendable. The remaining credits do not roll into another grant and they do not extend: the grant simply stops contributing to balance. Other grants in the same wallet are unaffected.
A grant with no expiry policy never expires. Its credits stay spendable until they are consumed.
Expiry applies per grant, not per wallet. A wallet balance can drop at the turn of a period even though no usage was recorded, because an expiring grant left the balance. Reconcile per grant (GET /v{version}/wallet-grants) when a balance change looks unexplained.
Rollover on top-ups
A top-up pricing item exposes a rollover flag. With rollover enabled, an unused balance from the previous period carries into the next period instead of expiring with it. With it disabled, the balance resets each period. Rollover is a property of the top-up configuration, not of the wallet, so two top-up items funding the same wallet can behave differently.
Edge cases
- Balance never goes negative. Once a wallet is empty, further usage is either charged in currency through a credit overage item or not charged at all. See Credits in pricing plans.
- A refunded or reversed top-up does not claw credits back automatically. Create a compensating adjustment if credits were already consumed.
- Low balance is an event, not a block. A
WalletThresholdand the wallet balance workflow trigger notify you or trigger an automatic top-up; they do not stop consumption.
See Credit revenue and breakage for how consumption and expiry translate into recognised revenue.