Software products, subscriptions, rewards
Credits and loyalty
Prepaid credits, API allowances, points and gift cards treated as property the customer owns, buys, refunds and disputes. The liability is derivable at any time.
The problem
What goes wrong without a ledger
Credits are money by another name. Treat them as a counter and you cannot say what this customer paid for, what they used, what you owe them, or what happened to the credits that expired.
How it works on Ledger
The shape of the books
Credits as an asset type
Define a credit unit with the precision you need. Sell packs by moving credits from an issuance account into the customer’s account.
Reserve for a job, commit what was used
Hold the estimated cost when a job starts. Commit the actual cost when it finishes and release the rest. A failed job releases everything.
Refunds and expiry on the books
A refund is a transaction back to the issuance account. Expired points move to an expiry account, which leaves the outstanding liability as the balance of the customer accounts.
Different from metering
A quota service counts consumption against a limit. A ledger records what the customer owns. Use the ledger when the units were bought and can be refunded.
POST /v1/transactions # reserve 40 credits for a job
{
"description": "job 91 estimate",
"pending": true,
"expires_at": "2026-09-06T00:00:00+00:00",
"entries": [
{ "account_id": customer_credits, "direction": "debit", "amount": "40" },
{ "account_id": consumed, "direction": "credit", "amount": "40" }
]
}
# job used 31: commit for 31, the other 9 are releasedWhat you get
Outcomes, and the guarantees behind them
- Liability for unused credits is a balance you can read off the ledger.
- A retried purchase cannot double-credit.
- Expiry and refunds are visible entries, not silent adjustments.
Questions
Asked about this use case
Is a ledger overkill for API credits?
Not when customers pay for them. If credits are refundable, transferable or disputable, they are property and belong on a ledger. If they are only a cap that resets monthly, a metering service is simpler.
Free today. Access is provisioned personally by RODMENA.
Tell us what you keep books of and we will set up a tenant, mint your first key and walk you through the tour.