Credit Balance
Track account credit as a ledger and apply it automatically to future charges.
What it adds
An append-only record of credits granted and consumed, with a derived balance that is applied to invoices and explained on them.
What your agent is told to do
5
What your agent is told to do
5-
1
Store credit as an immutable ledger of entries with a reason, amount, currency and source. Derive the balance from the ledger; do not keep a mutable number as the truth.
-
2
Correct mistakes by writing a reversing entry, never by editing or deleting a past one. The history is the accounting record.
-
3
Apply available credit to invoices automatically and show the applied amount and remaining balance as invoice lines.
-
4
Define, in writing, whether credit expires, whether it is refundable to a payment method, and whether it moves between workspaces. Undecided rules become support decisions made under pressure.
-
5
Do NOT let credit push a balance below zero. Reserve the amount when a charge begins so two concurrent charges cannot spend the same credit.
Edge cases it handles
6
Edge cases it handles
6- Two invoices finalising at the same moment must not both consume the last of the balance. Claim credit atomically before charging.
- Credit is denominated in a currency. Do not apply a credit in one currency to an invoice in another; hold separate balances.
- Refunding a charge that was partly paid with credit must return the credit portion as credit and the money portion as money.
- Expiring credit must be a ledger entry too, so the balance history stays reconcilable after the expiry runs.
- If credit exceeds the invoice total, the invoice is fully covered and the remainder carries forward — the charge must not be attempted for a negative amount.
- Where the billing provider holds its own customer balance, pick one system as authoritative and reconcile the other. Two independent balances will diverge.
Definition of done
8
Definition of done
8- Balance is computed from an append-only ledger, and no code path edits or deletes an existing entry.
- Concurrent charges cannot spend the same credit twice.
- Balances are held and applied per currency, never converted implicitly.
- Invoices show the credit applied and the balance remaining after application.
- Expiry, refundability and transferability rules are defined and enforced consistently.
- Every balance change, including expiry and reversal, is traceable to a ledger entry with a reason.
- The feature matches the existing design system.
- No existing functionality is broken.
Related features
Usage Limits
Usage Limits
Cap what free accounts can do — visibly and fairly.
What it does
Per-plan usage limits, enforced server-side, with the user always able to see where they stand.
How it works
- 1 Define limits per plan in one place. Do not scatter magic numbers through the codebase.
- 2 Enforce on the server at the point of creation. A client-side check is decoration.
- 3 Show current usage BEFORE the user hits the wall — surprise limits feel like a bug.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/usage-limits
Upgrade Modal
Upgrade Modal
Sell the upgrade at the exact moment someone wants it.
What it does
A focused upsell that appears when a free user reaches for a paid capability.
How it works
- 1 Trigger it at the point of intent — when they click the locked thing — not on a timer or on page load.
- 2 Name the specific feature they just tried to use. A generic pricing modal converts far worse.
- 3 State the price plainly and give one button to upgrade.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/upgrade-modal
Billing Portal
Billing Portal
Let people manage their own subscription.
What it does
A billing area where users can see their plan, change payment method, get invoices, and cancel.
How it works
- 1 Use the payment provider's hosted billing portal if it has one. Do not rebuild card management — it's a PCI liability you don't need.
- 2 Show the current plan, renewal date, and payment method on your own account page.
- 3 Make cancelling possible without emailing support. Dark patterns here generate chargebacks.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/billing-portal
How it works
-
1
Copy the link
Grab the Markdown instruction URL for this feature.
-
2
Give it to your AI
Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.
-
3
It inspects, then implements
Your agent reads your existing app first, then adds the feature to fit it.
Works with your stack
These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.
Need it tighter than that? Customize the feature and tell it exactly what you're running.