We’ve been working on credit-based billing systems, and one recurring issue we kept running into was how messy credit purchases become once real payments are involved.
Credits are easy when they’re manual or promotional. Things get complicated when customers need to: - buy credits through a proper checkout, - receive an invoice, - complete payment asynchronously, and only then have credits become usable.
Most teams end up stitching this together manually: Invoices in one system, payment links in another, wallet balances updated via scripts or cron jobs, and reconciliation handled later.
We built a checkout flow where credit top-ups, invoices, payment links, and wallet state transitions are part of a single workflow: - an invoice is generated, - a payment link is created automatically, - credits stay on hold until payment succeeds, and are applied immediately once the payment clears.
Docs here if you want to see how the flow works end-to-end: https://docs.flexprice.io/docs/wallet/top-up-wallet
Would love feedback from folks who’ve built usage-based or credit-driven billing, or thoughts on edge cases we should be thinking about.
Happy to answer questions or feel free to join our community : http://bit.ly/4huvkDm