Use a computer

For full performance and fluidity, please open Pay Engineers on a desktop or laptop. On mobile, the experience is limited — especially authenticated sections and advanced tools after login.

Payment Infrastructure

Subscription Billing Engine

Recurring revenue done right

Presentation

Overview

Recurring billing looks simple until you actually try to build it well: plan changes mid-cycle, trials that convert or lapse, proration on upgrades and downgrades, failed card payments that need intelligent retry logic, and invoices that satisfy tax requirements across multiple jurisdictions. Pay Engineers builds subscription billing engines that get these details right, because in a recurring revenue business, small billing errors compound into meaningful revenue leakage.

We build the billing engine as a layer that sits alongside your existing payment gateway rather than replacing it, since most SaaS and membership businesses already have a gateway relationship they are satisfied with. The billing engine focuses on the logic of what to charge, when, and how to recover failed payments, while delegating the actual card processing to your existing infrastructure.

This separation of concerns keeps the engine focused and lets it be genuinely excellent at billing logic, rather than a mediocre generalist that also happens to process cards.

Who This Is For

  • SaaS businesses whose current billing logic is scattered across application code and spreadsheets
  • Membership and subscription-box businesses managing complex plan structures and trial conversions
  • Platforms migrating off a third-party billing tool that has become too rigid or expensive at scale
  • Any recurring revenue business measuring meaningful involuntary churn from failed payment recovery

What You Get

  • A plan catalogue supporting multiple pricing tiers, add-ons and billing frequencies, managed through configuration rather than code changes
  • Proration and trial handling that correctly calculates charges and credits for plan changes and trial conversions
  • Smart dunning logic that retries failed payments intelligently, factoring in card decline reasons and optimal retry timing
  • Invoice generation producing tax-ready documents suitable for the jurisdictions your customers are billed in

Technical Approach

The engine is built on Laravel with PostgreSQL storing the subscription, invoice and dunning state, and a dedicated scheduler driving billing cycle events, renewal attempts and dunning retries on precise, auditable timing rather than ad hoc cron jobs scattered through application code. Invoice PDF generation produces documents that include the tax breakdown, line items and payment history required for business customers and accounting compliance.

Dunning logic is modelled as a configurable sequence of retry attempts, communication touchpoints and eventual downgrade or cancellation, informed by the specific decline reason returned by the card issuer where available, since a retry strategy that works for an insufficient-funds decline is different from one appropriate for an expired card. Proration calculations are centralised in one tested module rather than duplicated across multiple billing scenarios, reducing the risk of subtle calculation errors reaching customer invoices.

Delivery Process

  • Discovery of your current plan structures, billing pain points and gateway relationship
  • Billing data model and dunning strategy design, reviewed against your actual churn and payment failure patterns
  • Sprint-based build of the plan catalogue and core billing cycle logic, followed by dunning and invoicing
  • Parallel-run testing against your existing billing data to validate charges before cutover
  • Phased migration of customers onto the new engine, starting with new signups before migrating existing subscribers

Outcomes and Benefits

  • Reduced involuntary churn through smarter, decline-aware dunning strategies
  • Fewer billing support tickets thanks to accurate proration and clear, correct invoices
  • A plan catalogue your commercial team can evolve without engineering involvement for every pricing change
  • Tax-ready invoicing that reduces manual finance and accounting overhead

Technologies

Laravel PostgreSQL Scheduler Invoice PDF

FAQ

The engine supports flat recurring subscriptions, usage-based billing, tiered and volume pricing, one-off add-ons, and proration for mid-cycle upgrades or downgrades, so you are not constrained to a single pricing model as your product evolves. Plan changes, trials, discounts and coupon logic are handled centrally so pricing experiments can be configured without engineering involvement each time. We design the data model so historical invoices remain accurate even after pricing rules change, which is essential for audit and customer dispute resolution. This flexibility is scoped against your actual current and near-term planned pricing models during discovery, not built as an unbounded generic system.
Failed recurring charges trigger a configurable retry schedule with smart retry timing based on failure reason, since a card declined for insufficient funds behaves very differently to one declined for an expired card. We implement dunning communication sequences, grace periods and automatic card updater integration where your card network and processor support it, all aimed at recovering revenue that would otherwise be lost to involuntary churn. Subscription status transitions, such as past due, suspended or cancelled, are modelled explicitly so your product can gate access appropriately at each stage. This is typically one of the highest-ROI parts of a billing engine, since involuntary churn recovery directly affects revenue.
Yes, proration is calculated automatically for mid-cycle plan changes, correctly crediting unused time on the old plan and charging the prorated amount for the new plan, with the resulting invoice line items broken out clearly for the customer and for your finance team. We test proration logic extensively against edge cases such as changes spanning multiple billing cycles or combined with active discounts, since these are exactly the scenarios that generate customer support tickets and revenue recognition errors if handled incorrectly. Upgrade and downgrade rules, including any restrictions you want to apply, are configurable rather than hard-coded. This accuracy is essential both for customer trust and for correct revenue reporting.
The engine generates invoice and revenue event data structured to support proper revenue recognition, including deferred revenue for prepaid periods and correct handling of proration, refunds and credits, which we map to your accounting system's requirements during integration. We build export or direct integration to your accounting or ERP platform so finance does not need to manually reconcile subscription activity against recognised revenue each period. Tax calculation, where required across jurisdictions, is integrated through your chosen tax engine rather than built as a simplified approximation. This integration work is scoped explicitly because subscription revenue recognition is an area finance and audit teams scrutinise closely.
A first release covering core recurring billing, proration, dunning and basic reporting typically takes 3 to 5 months, with usage-based billing, advanced discounting and deep accounting integration often delivered as a subsequent phase. Timeline depends significantly on how many distinct pricing models and billing edge cases need to be supported at launch, and on the complexity of migrating any existing subscriber base into the new engine. We recommend a careful, tested migration plan for existing subscribers, since billing errors during migration directly affect customer trust and revenue. Ongoing support after launch typically focuses on new pricing model additions as your product line grows.

Similar services