How to Implement Credit-Based Pricing: Rate Card, Ledger, Billing and Accounting
How to implement credit-based pricing, in short: price one credit from your real unit costs, publish a rate card that says how many credits each action uses, record every grant and deduction in an append-only ledger, check and deduct the balance in one atomic step before the work runs, split credits into a bucket that resets and a bucket that rolls over, and decide in advance what happens at zero. Your billing system invoices the result; the real-time balance lives in your own database.
This is the build guide: the data model, the order of operations, the accounting question, and how to move existing customers onto credits without a revolt. If you want the buyer's view first — what credits are and when they beat per-seat pricing — read how credits work in software pricing. Both sit in our CRM and sales tool pricing hub.
Key takeaways
- Start from cost, not from competitors. Fix the price of one credit, then set each action's rate to clear your margin.
- A ledger, not a counter. The balance is the sum of transactions, which also answers “where did my credits go?”
- Atomic check-and-deduct. Lock the balance row or use a conditional update, or two requests will spend the same credits.
- Two buckets: plan credits that reset, purchased credits that roll over; spend the expiring bucket first.
- Billing tools invoice; they do not gate. Stripe credit grants apply when an invoice finalises, not at the moment of use.
- Unused prepaid credits are an accounting question. Under ASC 606 and IFRS 15, expected breakage is recognised in proportion to use, not when credits expire.
When should you switch to credit-based pricing?
Switch to credits when your cost to serve varies a lot between customers on the same plan and that variation comes from actions you can count. AI generation, voice minutes, video rendering, data enrichment and outbound messages all qualify: one customer can cost you fifty times what another costs on an identical seat licence.
| Signal | Credits fit | Keep per-seat or flat |
|---|---|---|
| Cost to serve per customer | Varies 10× or more | Roughly the same |
| What drives your cost | Countable actions (generations, minutes, lookups) | Headcount or storage |
| Several metered features | Yes — one currency covers them all | One metric is enough |
| Buyers need a fixed budget | Credits with a hard stop give one | Flat pricing gives one more simply |
| Supplier prices change often | Change the action's rate, keep the credit price | Repricing means a plan change |
If only one feature is metered, you may not need credits at all: charge for that unit directly (per minute, per lookup). Credits earn their complexity when several features with different costs need one budget. The trade-offs for buyers are covered in how CRM pricing models compare.
Step 1: How do you price a credit?
Price a credit by listing every action with a marginal cost, converting each cost to credits at a fixed credit price, and adding your margin. Keep the credit price stable and move the per-action rates instead; customers budget in credits, and a credit that changes value breaks every budget at once.
| Action | Your cost (example) | Target margin | Credits at $0.01 each |
|---|---|---|---|
| Short AI text generation | $0.002 | 80% | 1 |
| AI image | $0.03 | 75% | 12 |
| One minute of AI voice call | $0.09 | 70% | 30 |
| Contact enrichment lookup | $0.05 | 60% | 13 |
| One minute of rendered video | $0.40 | 70% | 134 |
Illustrative costs for the arithmetic only — use your own supplier invoices. Credits = cost ÷ (1 − margin) ÷ credit price, rounded up.
Three rules keep the rate card usable. Round to whole credits, because fractional credits confuse everyone. Charge nothing for actions with no marginal cost (logging in, storing records, viewing reports), or customers start rationing the product. And publish the rate card: an unpublished rate card is the fastest way to lose trust in a credit model.
Step 2: What does the data model look like?
The minimum is three tables: an account balance per customer, an append-only transaction ledger, and the rate card. The balance is a cache of the ledger, never the source of truth.
| Table | Key fields | Why |
|---|---|---|
| credit_account | customer, plan_balance, purchased_balance, plan_reset_at | Fast reads for gating; two buckets so expiry is explicit |
| credit_transaction | account, kind (grant, usage, purchase, refund, expiry, adjustment), amount, bucket, action, user, job_id, created_at | Audit trail and the usage report customers ask for |
| rate_card | action, credits, effective_from | Rates can change without rewriting history |
| credit_reservation (optional) | account, job_id, estimated, status | Holds credits for long jobs until they settle |
Store the rate that was applied on each usage row, not just the action name. When you later change the price of an action, old rows still explain old charges. Recompute the balance from the ledger in a nightly job and alert on any drift; drift means a code path wrote to the balance without writing a transaction.
Step 3: How do you deduct credits safely?
Deduct credits by checking and deducting in one atomic operation before the work starts. If two requests each read a balance of 10 and each spend 8, a read-then-write implementation lets both through.
- Row lock: in a transaction, select the account row with
SELECT … FOR UPDATE, check the balance, write the usage transaction, update the balance, commit. - Conditional update:
UPDATE credit_account SET plan_balance = plan_balance - 12 WHERE id = … AND plan_balance >= 12, and treat zero affected rows as “insufficient credits”. - Long jobs: reserve the estimate up front, settle the actual amount at the end, and release the reservation automatically if the job fails or times out.
- Retries: make each charge idempotent with a job id, so a retried request cannot charge twice.
- Failures: refund automatically when the work fails on your side. A charge for a failed generation is a support ticket.
Step 4: Should credits expire or roll over?
Most products use both: credits included in a plan reset each billing cycle, and credits a customer buys separately roll over, often with a long expiry such as twelve months. Spend the resetting bucket first, or customers lose the credits they paid extra for while the cheaper ones lapse.
| Policy | Customer sees | Risk |
|---|---|---|
| Plan credits reset to the plan amount | A predictable monthly allowance | Unused credits feel wasted; publish it clearly |
| Plan credits accumulate | Generous | Balances grow into a liability you must honour |
| Purchased credits roll over (with long expiry) | Fair for what they paid | Needs the two-bucket model |
| Purchased credits never expire | Most generous | Open-ended obligation on your books |
Check local consumer and gift-card rules before selling prepaid credits to consumers; some jurisdictions restrict expiry on prepaid value. Business-to-business plans are usually governed by your contract terms, so state the expiry rules in them.
Step 5: What happens when the balance hits zero?
Pick one behaviour and make it visible: a hard stop, a top-up prompt, or auto-recharge with a customer-set cap. Hard stops are safest for the buyer; uncapped auto-recharge earns the most and is the fastest way to a chargeback.
- Warn at 80% and 95% used, by email and in the app, with the date the plan credits reset.
- Make the zero-balance error actionable: say what was refused, how many credits it needed, and how to continue.
- Never stop a job half-way without saving the work; reserve credits up front so this rarely happens.
- Give admins a per-user or per-feature cap so one person cannot spend the team's month on day three.
Step 6: How do you connect credits to billing?
Connect credits to billing by letting your billing system sell plans and top-ups and invoice overage, while your own ledger decides in real time whether an action can run. Billing platforms aggregate usage for invoices; they are not built to refuse a request at the moment of use.
On Stripe, meters aggregate usage events by sum, count or last value, and billing credit grants apply prepaid or promotional credit to invoices, with optional expiry and a priority order. Credit grants apply only to subscription items on metered prices and only when an invoice finalises, and Stripe's terms rule out using billing credits as stored value or gift cards (Stripe billing credits). Usage-billing platforms such as Orb, Metronome and the open-source Lago offer prepaid-credit features too; check whether their balance is available in real time for gating before you rely on it.
| Job | Your app | Billing system |
|---|---|---|
| Is there enough balance for this action? | Yes | No |
| Record the usage event | Yes (ledger) | Optional (for overage invoicing) |
| Sell the plan and top-up packs | Shows the offer | Yes |
| Grant monthly plan credits | Yes, on the paid invoice webhook | Triggers it |
| Invoice overage | Reports usage | Yes |
| Show usage by user and feature | Yes | Rarely detailed enough |
Grant plan credits from the “invoice paid” webhook, not from the renewal date, so a failed payment does not hand out a month of credits. Make the grant idempotent on the invoice id.
Step 7: How do you account for prepaid credits?
Prepaid credits are a contract liability until they are used. Under ASC 606 and IFRS 15, revenue is recognised as customers use credits, and the share you expect never to be used (“breakage”) is recognised in proportion to the pattern of use if you expect to be entitled to it; otherwise only when the chance of use becomes remote (ASC 606-10-55-46 to 55-49; IFRS 15 paragraphs B44–B47). Credits included in a subscription are usually recognised with the subscription. This is the general rule, not accounting advice; agree the treatment with your accountant before launch, because it shapes what your ledger has to report.
Practically, your ledger should be able to report, per month: credits granted, used, expired and outstanding, split by bucket. That is the data an accountant needs, and it is free if the ledger exists from day one.
Step 8: How do you move existing customers onto credits?
Move existing customers by grandfathering what they already use, showing them a credit estimate before the switch, and giving a generous first-cycle allowance. The first credit invoice is where trust is won or lost.
- Back-test the rate card on three months of real usage and count how many customers would pay more.
- Show each customer their estimate (“last month you would have used 1,840 of 2,000 credits”) before the change.
- Give 60–90 days' notice and a one-off bonus credit pack for the first cycle.
- Keep the old plan available to existing customers for a fixed period if the change raises their bill.
- Ship the usage page first. Customers accept credits they can see being spent.
Scalry bills its AI features in credits: each plan includes a monthly allowance (2,000 on Pro, 6,000 on Scale), plan credits reset each cycle, purchased credits roll over, plan credits are spent first, the balance row is locked while a charge is checked and deducted, and every movement is written to a ledger. When the balance cannot cover an action, the action is refused rather than auto-charged. See the plans for current allowances.
Implementation checklist
| Done? | Item |
|---|---|
| ☐ | Rate card from real unit costs, published |
| ☐ | Ledger with kinds, buckets, applied rate and job id |
| ☐ | Atomic check-and-deduct; idempotent charges |
| ☐ | Reservations for long jobs; automatic refunds on failure |
| ☐ | Reset and rollover rules written into the terms |
| ☐ | Low-balance alerts and an actionable zero-balance error |
| ☐ | Plan credits granted on paid invoice, idempotently |
| ☐ | Nightly balance-vs-ledger reconciliation |
| ☐ | Monthly report of granted, used, expired and outstanding credits |
| ☐ | Usage page by user and feature |
For the wider picture of what your customers' stack costs, see the marketing stack pricing study and what marketing software costs a small business.
Frequently asked questions
How do you implement credit-based pricing?
Price one credit from your unit costs, publish a rate card per action, keep an append-only ledger of grants and usage, check and deduct atomically before each action, separate resetting and rollover credits, and let the billing system invoice while your app gates usage in real time.
Can Stripe handle credit-based pricing on its own?
Partly. Stripe meters and billing credit grants handle invoicing and prepaid credit, but grants apply when an invoice finalises, so they cannot refuse an action at the moment of use. Most products keep their own ledger for gating and use Stripe for charging.
Should unused credits expire?
Plan credits usually reset each billing cycle; purchased credits usually roll over with a long expiry. Spend the resetting bucket first and state both rules in your terms. Check consumer prepaid rules if you sell to consumers.
How are unused prepaid credits treated in accounting?
As a contract liability until used. Under ASC 606 and IFRS 15, expected breakage is recognised in proportion to customers' use if you expect to be entitled to it, otherwise when use becomes remote. Confirm the treatment with your accountant.
How many credits should a plan include?
Back-test on real usage: set the allowance so most customers on the plan use 60–90% of it in a typical month. Too few and everyone hits the wall; too many and the plan is a flat fee with extra steps.
If you are evaluating credit-priced tools rather than building one, count last month's actions and price them on the rate card first. You can rebuild one real campaign inside Scalry before moving anything else.
Start your free trialSee pricing14-day free trial · No credit card required
Build a workspace, import a real list, and run one campaign end to end before you decide anything.
14-day free trial · No credit card required