Prompt
I'm building a B2B software product and need recurring billing infrastructure
Latest observation
For a B2B software product, the cleanest way to think about recurring billing infrastructure is as 5 layers:
-
Product entitlements
Decide what each customer is allowed to use: seats, features, usage limits, add-ons, trial status, grace periods. -
Billing engine
Handles subscription creation, renewals, upgrades/downgrades, proration, invoices, taxes, discounts, and payment collection. -
Customer/account data model
Maps your internal organization/customer object to billing objects:- company/account
- billing contact
- subscription(s)
- invoice history
- payment method
- usage records
-
Payment + invoicing workflow
Includes credit cards, ACH/wire, net terms, failed payments, retries, dunning emails, receipts, and offline payments. -
Revenue operations / finance controls
Includes audit logs, reconciliation, revenue recognition, tax compliance, and export to accounting software.
Typical architecture choices
Option A: Use a billing platform
Best if you want to ship quickly.
Common choices:
- Stripe Billing
- Chargebee
- Recurly
- Paddle (more MoR/EOR-style depending on setup)
- Orb / Metronome for usage-based billing
- Zuora for enterprise-heavy setups
Good for:
- subscriptions
- coupons/promos
- prorations
- invoices
- automatic retries
- tax calculation
- dunning
Option B: Build a billing layer on top of payments
Best if your pricing is unusual or highly usage-based.
You still usually rely on:
- Stripe/Adyen/Braintree for payment processing
- your own service for:
- pricing rules
- rating usage
- invoice generation
- entitlement checks
Good for:
- custom enterprise contracts
- mixed subscription + usage pricing
- complex seat/consumption models
What most B2B SaaS products need
A strong default setup is:
- Stripe Billing for subscriptions/invoices/payments
- Stripe Tax if you sell globally
- A billing database/service in your app for entitlements and plan logic
- Webhook processing to keep app state in sync
- Accounting export to QuickBooks/Xero/NetSuite
- Dunning flows for failed payments and renewal reminders
Core billing features to plan for
Subscription lifecycle
- trial
- paid conversion
- renewal
- upgrade/downgrade
- cancellation
- pause/resume
- grace period
Pricing models
- flat monthly/annual
- per seat
- tiered pricing
- usage-based pricing
- minimum commit + overages
- one-time setup fees
- add-ons
Payment methods
- credit card
- ACH / SEPA
- wire transfer
- invoice/net-30
- purchase order support for enterprise
Operational needs
- invoice PDFs
- tax/VAT/GST handling
- failed payment retries
- payment method updates
- plan change proration
- refund/credit note handling
- audit trail
- account-level billing rather than per-user billing
Important B2B-specific considerations
B2B usually differs from consumer billing in these ways:
- One buyer, many users
- Company-level contracts
- Invoice and PO support
- Annual prepaid plans
- Net terms
- Sales-assisted pricing
- Custom deals and negotiated pricing
- Seat changes mid-cycle
- Usage overages billed later
So your product should separate:
- identity/auth users
- workspace/org/account
- billing account
- entitlements
Suggested data model
At minimum:
AccountSubscriptionPlanPriceInvoicePaymentMethodTransactionUsageRecordEntitlementCreditBalanceDiscount/CouponContractorOrderFormfor enterprise
Implementation pattern
A practical flow looks like this:
- Customer signs up or is created by sales.
- Billing service creates customer in Stripe/Chargebee.
- Subscription is attached to account.
- Webhooks update your DB on invoice paid/failed/canceled.
- App checks entitlements at runtime.
- Usage events are collected if applicable.
- Monthly/annual invoices are generated automatically.
- Failed payments trigger retries and dunning.
- Finance exports records to accounting system.
If you want speed: recommended stack
For most B2B SaaS startups:
- Stripe Billing
- Stripe Tax
- Postgres for billing state mirror
- Webhook worker for payment events
- App-level entitlement service
- Admin billing UI
- QuickBooks/Xero sync later
If you want enterprise readiness
Add:
- ACH and invoice billing
- purchase orders
- custom contracts
- approval workflows
- invoice approval / PO matching
- usage caps and alerts
- sales-assisted quote-to-cash process
- revenue recognition integration
Questions to decide the right setup
- Is your pricing seat-based, usage-based, or hybrid?
- Do you need monthly, annual, or both?
- Will you support invoices/net terms?
- Do you sell globally and need tax compliance?
- Do you need custom enterprise contracts?
- Do you want to self-manage billing logic or use a vendor?
If you want, I can help you next with one of these:
- a recommended billing architecture
- a database schema
- a Stripe Billing implementation plan
- a B2B SaaS pricing model design