Skip to content

BLOG

SaaS Subscription Billing: What to Build and What to Buy

By , FounderPublished 11 min read

Your product is close to ready and customers will pay monthly or yearly. Now somebody has to decide how the money is collected. SaaS subscription billing looks like one feature on a list. In practice it is a chain of events that repeats for every customer, every period, and has to be right each time: charge, renew, upgrade, fail, retry, refund, cancel. The question for a founder is how much of that chain to build and how much to buy.

We are a product engineering team at Infopark in Kochi, and we build SaaS platforms for businesses in India, the UAE and Australia. This guide explains where the line between build and buy usually falls, and why.

The short answer

Buy payment collection and the subscription engine. Build the layer that tells your product what each customer is entitled to. Never store card details yourself. If you have only a handful of customers, do not automate billing at all yet: send invoices by hand and record each customer's plan in an admin screen.

What subscription billing has to do

A one-time sale ends when the payment succeeds. A subscription is a relationship that carries on, and each of these events will happen sooner or later.

A customer starts a trial, and the trial ends.

A customer picks a plan and pays for the first period.

The subscription renews without the customer doing anything.

A customer upgrades or downgrades in the middle of a period, and the amount has to be adjusted for the days used. This is called proration.

A customer adds or removes users on a per-user plan.

A renewal payment fails because a card has expired or a balance is short. The charge is retried and the customer is reminded.

An invoice is issued for every charge, with the right tax.

A customer asks for a refund, or cancels and expects access until the end of the paid period.

Each event is simple alone. The difficulty is in the combinations: an upgrade on the day a payment failed, a refund after a plan change, a cancellation during a trial. Billing services exist because those combinations have already been worked through by someone else.

The layers, and who provides each

It helps to see billing as four layers. Three can be bought. One is yours.

Payment gateway

The gateway moves the money. It takes the customer's card, UPI or bank details on its own secure pages, obtains approval and settles the amount to your bank account. Stripe and Razorpay are two widely used examples. Which gateways you can use depends on where your company is registered and where your customers are.

Subscription engine

The engine keeps the schedule. It knows each customer's plan, renewal date and amount, raises the charge when it falls due, applies proration on plan changes, retries failed payments and produces invoices. Many gateways offer this as part of their product. There are also separate subscription management services, such as Chargebee, that sit on top of a gateway.

Merchant of record

A merchant of record is a company that sells your product to the customer on your behalf. It collects the payment, takes responsibility for sales tax in the customer's country and pays you the remainder. Paddle is a well-known example. This can suit a small team selling to customers in many countries, in return for a larger share of each sale. Whether such a service accepts your business and your country is something to confirm with the provider.

Your own product

No provider knows what your plans mean inside your product. That a customer on the basic plan may have five users and no export feature is your rule, and your code has to apply it. This is the part you build.

What to buy and what to build

PartBuy or buildWhy
Taking card, UPI or bank paymentsBuyHandling payment details is regulated and security-critical. A gateway keeps those details off your servers.
Renewals and the billing scheduleBuyA subscription engine already handles dates, periods and time zones.
Proration on plan changesBuyThe arithmetic is easy to get wrong and customers notice when it is.
Retrying failed payments and remindersBuy, then configureProviders offer retry schedules and reminder emails. You decide the timing and the wording.
Invoices and receiptsBuy, then check with your accountantProviders generate them. The format and tax treatment must suit your business.
A page where customers manage their own payment methodUsually buyMost providers offer a hosted page. Build your own only if it must match the product closely.
Plans, limits and what each plan unlocksBuildThis is your product's own logic. No provider can know it.
Keeping the product in step with the providerBuildWhen a payment succeeds or a subscription ends, your product has to react correctly.
Measuring usage for usage-based pricingBuild the measuring, buy the chargingOnly your product knows what was used. The provider can bill the figure you report.
Admin views for support and financeBuildYour team needs to see a customer's plan, payments and limits in one place.

The part you always build: entitlements

An entitlement is what a customer is allowed to use: which features, how many users, how much volume. The entitlement layer is a small part of your product that holds this for every customer account and answers one question whenever the product asks: is this customer allowed to do this? It is recorded for each tenant, alongside the account model described in our guide to multi-tenant SaaS architecture.

The reason to keep it separate is that billing and access are different things. A customer whose card failed yesterday should usually keep access for a few days while the charge is retried. A customer on a negotiated annual contract may pay by bank transfer and never touch the billing provider. A pilot customer may have full access and pay nothing. If the product asks the billing provider directly whether someone has paid, none of these cases fit.

We build it this way. The product talks to an entitlement layer and not to the provider directly, so switching provider later is a contained change. It also means plan and pricing changes can be shipped as configuration instead of new code.

Keeping the two in step

Providers send your product a message whenever something happens: a payment succeeded, a payment failed, a subscription was cancelled. These messages are called webhooks. Your product listens for them and updates entitlements. The code has to cope with a message arriving twice, arriving late or arriving out of order, because all three happen. A regular reconciliation, comparing what the provider says each customer has paid for with what the product is giving them, catches whatever slips through.

Points specific to India

Recurring payments from Indian customers work differently from one-time payments. A repeat charge on a card or through UPI runs on a mandate that the customer sets up and approves, under rules set by the Reserve Bank of India. Your gateway handles the mandate, but it affects the experience: the customer takes an extra step at sign-up, and a renewal can fail if the mandate is not in place. The rules have changed before and may change again. Confirm the current position with your gateway before you design the sign-up flow.

Indian business customers will expect a GST invoice with their GSTIN on it. If you sell abroad as well, tax on those sales follows the customer's country. Involve your accountant before choosing a provider, not after, because the invoice format and the tax treatment are harder to change once customers are being billed.

Larger customers often prefer to pay yearly by bank transfer against an invoice. That is a normal part of selling to businesses in India, and one more reason access should follow entitlements and not card payments alone.

When not to automate billing yet

With only a handful of customers, automated billing rarely earns its cost. Send invoices from your accounting software or send a payment link. Record the plan and the paid-until date in an admin screen. Your team will handle upgrades and cancellations by hand, and will learn what customers ask for.

The one thing to build from day one is the entitlement record itself, even if a person updates it. Then connecting a billing provider later is an addition and not a rebuild. Our guide on how to build a SaaS MVP covers what else belongs in a first release.

When building your own billing makes sense

Rarely, and never for collecting the payment itself. A custom billing engine can be justified when pricing is unusual enough that no service models it: charges calculated from several measures, contracts negotiated for each customer, or revenue shared with partners. Even then, the common pattern is to build the calculation, produce the amount due, and hand that amount to a gateway to collect. Ask any team proposing a custom engine which provider they tried to fit first, and where it fell short.

How to choose a billing provider

Does it operate where your company is registered, and does it accept the payment methods your customers use?

Does it support your pricing model: flat plans, per user, by usage, yearly discounts, trials?

How does it handle recurring payments in each country you sell to?

Do its invoices meet your tax requirements? Ask your accountant to look at a sample.

What does it charge, and how do the charges grow as revenue grows? Fees change, so check the provider's current pricing.

Can you export your customer and subscription data if you leave?

Is the account in your company's name? The payment account and the money in it should never sit with a vendor.

Common mistakes

Storing card numbers in your own database. Use the provider's hosted payment pages so that card details never reach your servers.

Cutting off access the moment a payment fails. Many failures are expired cards, not customers leaving.

Writing plan rules into the code in many places. A price change then becomes a development project.

Ignoring duplicate or late webhooks, so the product and the provider slowly disagree.

Launching a complicated pricing model first. Each pricing rule is code to build and a question for support to answer. Our guide to SaaS development cost in India shows how billing affects a budget.

Leaving finance out. The people who reconcile the bank statement should see the design before it is built.

Frequently asked questions

Should a SaaS company build its own billing system?

Almost never. Payment collection and the subscription schedule should come from a payment gateway or billing service. What a SaaS company builds is the entitlement layer that connects billing to the product, and the admin views its own team needs.

What is the difference between a payment gateway and a billing service?

A payment gateway moves money from the customer to you. A billing service keeps the subscription schedule: plans, renewals, proration, retries and invoices. Some providers offer both, and some billing services work on top of a separate gateway.

What is an entitlement layer?

An entitlement layer is the part of a SaaS product that records what each customer account may use, such as features, user counts and limits. The product checks it before allowing an action. It is updated by the billing provider's messages and, where needed, by your own team.

What happens when a subscription payment fails?

The billing service retries the charge on a schedule and reminds the customer to update their payment method. Your product decides how long access continues in the meantime. A short grace period, followed by restricted access and then suspension, is a common arrangement.

Can we change billing provider later?

Yes, though moving existing subscriptions takes planning, and customers may need to approve their payment method again. The change is far smaller when the product talks to its own entitlement layer and not to the provider directly.

Which billing provider do you use?

We use whichever billing provider you already use or plan to use. The right one depends on where your company is registered, where your customers are and how you price.

Conclusion

SaaS subscription billing is a place to buy more than you build. Let a gateway collect the money and a subscription engine keep the schedule. Put your own effort into entitlements, into keeping the product in step with the provider, and into the views your support and finance teams need. Start by hand if you have few customers, and keep pricing simple until customers show you what they will pay for.

Billing is one of the questions we settle before the first feature ships, within the same six-stage process we follow on every product. If you are deciding how your product should charge, tell us how you plan to charge and we will say which parts we would buy, which we would build, and what can wait.

← All articles

Human. Digital. Future.

NEXT STEP

Want this applied to your product?

Whether you need to automate an existing process, build an intelligent business platform, or develop a new digital product, we help turn business requirements into software that delivers practical outcomes.

START A PROJECT

Tell us what needs to get done.

Four fields. We reply within one business day.

Used only to answer this enquiry — privacy. More to say? Full form.

Free download · PDF

Get the HRMS Suite brochure

Eight pages on attendance, leave, payroll, loans, accounts and the employee app, with real screens from the product.

We use these details to send you the brochure and follow up about HRMS Suite. See our privacy policy.