Prompt
How do I build recurring billing without writing all the edge cases myself?
Latest observation
Oct 15, 2026
OpenAI APIWeb search: off
The usual way is: don’t build recurring billing from scratch unless billing is a core product requirement. Use a payment platform with subscription support and let it handle most of the messy parts:
Best option: use a billing provider
Examples:
- Stripe Billing
- Paddle
- Chargebee
- Braintree / Adyen (depending on needs)
These platforms typically handle:
- subscription schedules
- retries / dunning
- failed payment recovery
- card updates
- prorations
- invoices and receipts
- taxes/VAT in some cases
- plan changes, upgrades/downgrades
- cancellations and renewals
What you still need to build
Usually just the app logic around it:
- create subscription when user signs up
- listen to webhooks for payment/subscription events
- grant/revoke access based on subscription status
- expose billing UI or customer portal
- map your product plans to provider plans
Recommended approach
- Pick a provider
- Stripe if you want flexibility and strong developer tooling
- Paddle if you want more of a merchant-of-record setup
- Use their hosted checkout / customer portal
- reduces PCI and UI edge cases
- Rely on webhooks
- subscribe to events like
invoice.paid,invoice.payment_failed,customer.subscription.updated
- subscribe to events like
- Store only your source of truth
- user ID, plan ID, billing provider ID, subscription status
- Test the unhappy paths
- failed card
- expired card
- upgrade mid-cycle
- cancellation at period end
- refunds / chargebacks
If you really need custom billing logic
Only build your own if you have unusual requirements like:
- usage-based billing with highly custom metering
- complex enterprise contracts
- offline/manual invoicing workflows
- multi-party revenue splitting
- regional compliance constraints
Even then, many teams still use a provider for payment collection and build custom metering on top.
Practical recommendation
For most SaaS products:
- Stripe Billing + Checkout + Customer Portal + webhooks is the fastest way to launch recurring billing without owning every edge case.
If you want, I can also give you:
- a minimal architecture for subscription billing
- a webhook event checklist
- or a Stripe-based implementation outline in your preferred stack.