Engagements - A complete Stripe billing system: subscriptions, usage, dunning, webhooks
Stripe looks easy in the docs and turns into a liability in production. Dropped webhooks, double charges, customers stuck on the wrong plan, proration math that's just wrong, entitlements that don't match what someone paid for, and revenue quietly leaking through failed payments nobody retries. A Stripe billing system build treats billing as the system it actually is: one senior engineer, one outcome, a month or more of focused work, shipping an increment you review every week. Not a queue of billing tickets and not a generic SaaS development engagement with billing squeezed into the last sprint — the whole subscription billing implementation, designed once, correctly.
- SaaS with real revenue
- Usage-based products
- Fintech
What you'll have at launch
A billing system you trust: subscriptions, metered usage, entitlements, proration, dunning, and webhooks that never drop or double-charge.
- Subscriptions, Checkout, and Stripe customer portal setup wired end to end, with trials, coupons, upgrades, downgrades, and cancellations handled cleanly.
- Idempotent Stripe webhook handlers that survive retries and out-of-order events, backed by an event log so nothing is dropped or processed twice.
- Metered and usage-based billing that invoices for what customers actually used, with proration that adds up.
- Entitlement gates in your product that read from one source of truth, so what a customer can do always matches the plan they're paying for.
- Dunning and failed-payment recovery plus billing observability — alerts, reconciliation, a dashboard finance trusts — so you stop silently losing revenue every month.
How we build it
A build runs 4–7 weeks typical, shipped week by week in increments you review and merge.
Weeks 1–2 · Billing architecture & webhook backbone
We design the billing architecture against your plans and pricing — the data model, the entitlement source of truth, what lives in Stripe versus your database — then build the webhook backbone first: signature verification, an idempotent event log, and retry-safe processing. Getting this foundation right is what separates billing that holds up from billing that double-charges.
Weeks 3–5 · Subscriptions, usage, entitlements & the portal
Checkout, Stripe customer portal setup, plan changes, trials, coupons, proration, metered usage, and the entitlement gates get built on top of the backbone, shipping in weekly increments you test against Stripe's test mode. Every ugly state — mid-cycle upgrades, downgrades, cancellations, failed trials — gets handled explicitly rather than left to chance.
Weeks 6–7 · Migration, dunning, testing & cutover
Existing customers get migrated and backfilled, failed-payment retries and dunning flows go in, and the tax and invoicing edges get closed. Then the QA pass: a billing test suite over the ugly paths, replayed webhook fixtures, reconciliation against Stripe, and a flagged cutover with a rollback path — so switching to live keys is a decision, not a leap.
What's included
- A billing architecture designed up front: the subscription data model, plan and price mapping, and a clear line between what Stripe owns and what your database owns.
- Subscriptions, Checkout, trials, coupons, and Stripe customer portal setup, with plan upgrades, downgrades, and cancellations handled end to end.
- Idempotent Stripe webhook handlers with signature verification, an event log, and safe processing under retries and out-of-order delivery.
- Metered and usage-based billing: usage reporting, tiered pricing, overage, and invoices that match real consumption.
- Entitlements and plan gating from one source of truth, so features unlock and lock the moment a subscription changes — including on downgrade and cancellation.
- Proration and dunning done right, plus failed-payment retries and recovery emails to recover revenue you're currently losing.
- A billing migration path when you're moving off payment links, a hand-rolled integration, or an older Stripe API: customer and subscription backfill, dual-write where it's needed, and a reconciliation report before anything is switched over.
- A billing test suite against Stripe test mode — replayed webhook fixtures, clock-advanced renewal and dunning paths, proration cases — so a change to pricing logic doesn't need a prayer.
- Billing observability and rollback: reconciliation between Stripe and your database, alerts on stuck subscriptions and failing webhooks, and a feature-flagged cutover you can reverse.
- Stripe Tax and invoicing wired so the correct tax lands on every charge in every region you sell to.
What a build like this looks like
Scopes we've shaped this engagement around. Yours is one of them, or close enough that week one settles it.
- Subscription billing implementation from scratch. You have a product and no way to charge for it. Plans, Checkout, the customer portal, entitlements, webhooks, and invoices go in as one system, so a stranger can subscribe, upgrade, and cancel without anyone on your side touching Stripe by hand.
- Usage billing implementation. Metering, tiered and hybrid pricing, overage, and usage-based invoicing wired into a product that currently only bills a flat fee. Usage is where proration and edge-case math gets hardest, which is exactly why it's worth building as a system rather than piecemeal.
- Migration off a brittle billing integration. Payment links, a half-finished integration, or an older Stripe API a former contractor left behind. The build stabilises what's live, backfills customers and subscriptions onto the new model, reconciles against Stripe, and cuts over behind a flag with a rollback path.
- Entitlements and plan gating retrofit. Billing works, but what customers can actually do drifts from what they pay for — downgrades that never lock features, cancelled accounts still using the product. One entitlement source of truth, driven by webhooks, gating every feature check in the app.
Stack
- Stripe
- Express
- PostgreSQL
- Next.js
How this build lowers your risk
- The webhook backbone goes in first. Signature verification, an idempotent event log keyed on Stripe's event IDs, and retry-safe processing land in week one — before any billing feature sits on top. It's the layer that decides whether a retried event is ignored or charges someone twice, so it's never the thing that gets rushed at the end.
- Money paths get tested, not hoped over. Renewals, dunning, proration, and plan changes run against Stripe test mode with replayed webhook fixtures and an advanced test clock. You go live off a suite that exercised the ugly paths, and the cutover is feature-flagged with a rollback you can pull if reconciliation looks wrong.
- Billing is the outcome, not a sprint inside a bigger project. SaaS development agencies package billing as one workstream inside a broad build, sold as a lump-sum quote with a project manager on top; freelance marketplaces hand you the sourcing and management to do yourself. Here, billing is the entire engagement for a month or more — one senior engineer holding the whole subscription, usage, and entitlement model in their head. When your problem is genuinely a broader product build, we'll say so and point you at the SaaS MVP build instead.
- No contract, no lump-sum quote. It runs on the flat monthly subscription, with multiple plans available. You pay for the active weeks, reprioritize which billing edge matters most as you go, and pause between phases. Everything ships into your repo and your Stripe account stays yours, so leaving is never a hostage negotiation.
Is this the right build for you?
A good fit when
- You need a real subscription or usage billing system, and what you have is payment links, a half-finished integration, or nothing at all.
- You want one senior engineer for a month or more on this one billing outcome, not a task queue and not a five-person pod.
- Revenue is leaking somewhere you can't see — failed payments nobody retries, stuck subscriptions, entitlements that don't match the plan.
- You're moving to usage-based or hybrid pricing and the metering, proration, and invoicing have to be right the first time.
Not a fit when
- You want a one-off bugfix or a handful of small billing tickets; a build is a month-plus engagement by design, not a fix shop.
- You need a seat on your existing team's sprint board — this is one engineer owning one outcome, not staff augmentation.
- You want someone to run your Stripe account, payouts, chargebacks, or compliance decisions; we build against those, we don't take them over.
- Your question is a single tax-registration or accounting one rather than a billing system to build.
How it runs on the subscription
Billing done right is a designed system, not a stack of quick tasks, so it runs as a build — the board dedicated to your billing, shipping the webhook backbone, subscriptions, entitlements, and dunning in weekly increments. We match the monthly plan to the workload, with most billing systems landing in four to seven weeks. You reprioritize which billing edge matters most as you go, and after launch the same setup handles the inevitable new plan or edge case one task at a time.
Frequently asked questions
- How is this different from a SaaS development agency doing our billing?
- A SaaS development agency treats billing as one workstream inside a broader build — quoted as a lump sum, staffed with a rotating team, and usually the piece that gets compressed when the schedule slips. This is a Stripe billing system build: billing is the whole outcome for a month or more, owned by one senior engineer who holds the subscription, usage, and entitlement model in their head, shipping an increment you review every week. If what you actually need is the whole product, the SaaS MVP build covers that instead.
- Can you take over a Stripe integration someone else left broken?
- Yes — most billing work is inherited. Send the repo and the symptoms (double charges, stuck subscriptions, webhooks timing out), and the build starts by tracing and stabilising what's there, then rebuilds the parts that can't be trusted. It doesn't need to be clean first. It does need to be worth a month-plus of engineering: a single broken endpoint is a task, not a build.
- Do you build usage-based and metered billing?
- Yes. Usage reporting, tiered and metered pricing, overage handling, and invoices that match what customers actually consumed are core to this build. Usage billing is where the proration and edge-case math gets hardest, which is exactly why it's worth building as a system rather than piecemeal.
- How do you make sure webhooks don't drop or double-process?
- The webhook backbone goes in first: signature verification, an idempotent event log keyed on Stripe's event IDs, and processing that's safe under retries and out-of-order delivery. That means a retried or duplicated event is recognised and ignored rather than charging someone twice.
- How do entitlements and plan gating work?
- One source of truth in your database, driven by the webhook backbone rather than by whatever the UI last saw. Every feature check in the product reads from it, so an upgrade unlocks immediately and a downgrade, cancellation, or failed payment locks the right things back down — including the paths teams usually forget, like a subscription that lapses mid-session.
- Can you migrate our existing customers onto the new billing system?
- Yes, and it's planned as its own phase rather than a switch someone flips on a Friday. Customers and subscriptions get backfilled onto the new model, dual-write covers the overlap where it's needed, and a reconciliation report against Stripe has to come back clean before cutover. The cutover itself sits behind a flag, so rolling back is a config change rather than an incident.
- How is billing tested before it touches real money?
- Against Stripe test mode, with a suite over the paths that actually break: replayed webhook fixtures, renewals and dunning driven with an advanced test clock, proration on mid-cycle plan changes, and reconciliation between Stripe and your database. After launch you get alerts on failing webhooks and stuck subscriptions, so a billing problem surfaces from monitoring instead of from a customer email.
- Do you touch our Stripe account or just the code?
- Just the code. The build ships the integration — Checkout, webhooks, billing logic, the customer portal, entitlements, dunning — into your repo. Your Stripe account settings, payouts, and compliance decisions stay entirely yours; we build against them, we don't take them over.
- How long does a billing system build take?
- Most take four to seven weeks, depending on how many plans, how much usage-based logic, whether existing customers have to be migrated, and how many tax and regional edges are in play. It runs on the flat monthly subscription — with multiple plans available — not a fixed project price, so you pay for the active weeks and can pause between phases.
Got a project? Let's ship it.
3 spots open. Tell us what you need shipped. We’ll match the plan and timeline to the work on a short sales call, then deliver it in reviewable increments.