Skip to content
Proudly Canadian, serving Windsor to Toronto, Ontario · clients welcome from every countryContact usClient login
CodeLumaDevelopment Inc.

Home / Blog / Article

CodeLuma insights · May 3, 2026 · 5 min read

Handling Subscription Billing and Dunning Management Without Losing Revenue

Subscriptions live or die on billing details. Learn how to design plans, proration, trials, tax, failed-payment recovery (dunning), retries, card updaters and cancellation flows that protect recurring revenue.

Subscription revenue is prized because it is predictable. But predictability depends on a chain of small operational details working: charges succeeding on time, plan changes prorating correctly, taxes calculated properly, and cards that expire being updated. Businesses often discover that a surprising fraction of their churn is not customers deciding to leave; it is payments quietly failing. This guide covers how to design subscription billing and dunning so recurring revenue stays recurring.

Not all churn is a customer decision: a large share can be recovered with better billing operations.
Not all churn is a customer decision: a large share can be recovered with better billing operations.

Design the plans thoughtfully

Billing complexity starts with pricing. Decide on a small number of clear plans, billing intervals such as monthly and annual with a discount for annual, add-ons, and usage-based components if relevant. Every extra variant multiplies the number of edge cases. Consider trials: free trials with or without a card on file behave very differently for conversion and for payment failures. Define how upgrades, downgrades, pauses and cancellations work, and write the rules down before building, including what happens to access at each step.

Payment cards and a card terminal
Original CodeLuma 3D render: payment cards and a card terminal.

Use a billing provider, but understand it

For most businesses, building subscription billing from scratch is unnecessary and risky. Payment platforms with billing features handle recurring charges, invoices, proration, tax integrations, retries and customer portals. The trade-off is that your application must stay in sync with the provider. Treat the provider as the system of record for billing state, and your app as the system of record for entitlements, meaning what each customer can do. Keep a mapping between them and update it through webhooks. Our article on payment integrations describes the webhook patterns you need.

Get proration and plan changes right

When a customer upgrades mid-cycle, should they pay the difference immediately, or at the next renewal? When they downgrade, do they get credit? Proration bugs cause disputes and support tickets. Choose a policy that is easy to explain, configure it in the billing provider, and test many scenarios: upgrade on the first day, on the last day, across intervals, with discounts and with taxes. Display a clear preview of the charge before the customer confirms.

Handle tax and invoices correctly

Recurring charges must include the right tax, which depends on the customer's location and the type of product. Use a tax calculation service or the provider's built-in support rather than hard-coding rates, and store the customer's location and tax identifiers. Issue proper invoices and receipts, keep them accessible in a portal, and support currency rules. We discuss this in our guide to automated tax calculation.

Understand involuntary churn

Payments fail for many reasons: expired or replaced cards, insufficient funds, bank fraud filters, temporary network problems and authentication requirements. Industry observations commonly attribute a significant share of total churn to failed payments, in many businesses somewhere between a fifth and a half. Because these customers did not choose to leave, they are the cheapest revenue to save.

Build a dunning process

Dunning is the sequence of retries and communications used to recover failed payments. A good process has four parts:

  1. Smart retries. Do not retry immediately and repeatedly. Space retries over days and time them sensibly, for example around typical paydays or the time of day the previous attempt failed. Many providers offer machine-learning-based retry scheduling. Stay within card network rules on retry counts.
  2. Timely notifications. Send an email at the first failure with a direct link to update the payment method, and follow up as the schedule proceeds. Keep the tone helpful, not accusatory, and state clearly what will happen and when.
  3. Card updaters. Use network services, often available through your provider, that automatically refresh stored card details when banks reissue cards.
  4. A clear end state. After the final attempt, pause or downgrade access, or cancel, and make reactivation trivial. Keep the customer's data for a grace period.
A staged dunning sequence combines automatic retries with clear, respectful communication.
A staged dunning sequence combines automatic retries with clear, respectful communication.

Prevent failures before they happen

  • Email customers before their card expires and invite them to update it.
  • Offer multiple payment methods, including bank debit where appropriate, since bank-based methods do not expire like cards.
  • Support annual billing, which reduces the number of chances for failure.
  • Make the update-payment flow one click from any email and available in the account area.
  • Handle strong authentication smoothly for renewals that require it.
A smartphone showing an app
Original CodeLuma 3D render: a smartphone showing an app.

Reduce voluntary churn with better cancellation flows

Not every departure is inevitable. Offer alternatives at the cancellation moment: pause for a few months, switch to a cheaper plan, or reduce usage. Ask why they are leaving with a short optional question, and use the answers to improve the product. Do not hide the cancel button or use dark patterns; they generate chargebacks, complaints and legal risk, and in many jurisdictions consumer rules require cancellation to be as easy as sign-up.

Keep your data honest

Subscription systems drift: a webhook is missed, a status is updated in one place and not another, a refund happens in the provider dashboard. Build a daily reconciliation job that compares your subscription records with the provider's, flags mismatches and repairs them. Track metrics that reveal health: monthly recurring revenue, gross and net revenue retention, involuntary versus voluntary churn, failed payment rate, recovery rate from dunning, and days sales outstanding for invoiced customers.

Test the ugly cases

  • Failed renewal, then successful update, then successful retry.
  • Card expiring before renewal.
  • Plan change during a trial or during dunning.
  • Refunds and credits, and how they affect proration.
  • Customers in different tax jurisdictions and currencies.
  • Duplicate and out-of-order webhooks.
  • Cancellation with immediate versus end-of-period effect.

Build or configure?

Provider-hosted billing portals and dunning features cover many needs. Custom development helps when you need usage-based metering, complex contracts, integrations with accounting and CRM, custom entitlements or a branded experience. A development partner can connect these pieces so your billing is reliable, auditable and easy for customers to manage.


Put this into practice with CodeLuma

CodeLuma builds subscription billing systems with smart retries, dunning emails and clean reconciliation, so failed cards and messy plan changes stop quietly draining your recurring revenue.

Start a conversation. Tell us about your project and we will reply with practical next steps, or browse all CodeLuma services. CodeLuma Development Inc. is a Canadian company that works with teams in Windsor, Essex, London, Toronto, Mississauga and across Ontario, throughout Canada and remotely.

Keep reading

Share this article: Facebook · LinkedIn · X · Email

← All articles

Ready to put this into practice?

Talk to a Canadian full-stack team that builds complex, connected systems for clients across Canada and worldwide.

Start a project