Mastering SaaS Billing
Billing is one of the highest-risk parts of a SaaS stack. If your state machine is wrong, revenue, access control and user trust break together.
At Obelisk Labs we run billing as an event-driven system around Stripe webhooks, with database-first reconciliation and explicit organization scope.
Billing Is More Than Checkout
Production billing needs to handle:
- Subscription lifecycle and seat changes.
- One-time purchases (credit packs, lifetime plans).
- Webhook retries, idempotency and reconciliation.
- Access gating based on latest valid state.
Why Stripe Works for This Pattern
Stripe provides the primitives, but product correctness still depends on your internal logic. We use webhook signatures, durable event logs and controlled side effects to keep state consistent.
Hybrid Model: Subscription + Credits
For AI-heavy products, subscriptions and credits solve different problems:
- Subscriptions provide predictable baseline access.
- Credits track bursty usage and model costs.
- Auto top-up keeps critical workloads online.
Webhooks Are the Source of Truth
Key events like checkout.session.completed, invoice.payment_succeeded, and subscription updates must update your local system deterministically, with replay-safe handlers.
If billing is treated as core infrastructure early, feature velocity improves because plan gates and usage limits become dependable instead of fragile.