Solution Blueprint · B2B SaaS

Multi-Tenant SaaS Billing & Subscription Platform

A growing B2B SaaS company outgrows spreadsheets and hand-built invoices. This blueprint shows how we design a billing platform that handles plans, usage-based pricing and invoicing for every tenant, without mixing one customer's data with another's.

This is a solution blueprint: a representative engagement showing how we approach this kind of project. It is not a specific client story.

Multi-Tenant SaaS Billing & Subscription Platform illustration
IndustryB2B SaaS
Timeline4–6 months to a production MVP
Teamproduct lead, 3–4 engineers, 1 designer, part-time DevOps

The Challenge

  • Pricing lives in spreadsheets, so every new plan needs engineering work and manual invoice fixes.
  • Usage data arrives from several services in different formats and is hard to reconcile.
  • Enterprise prospects ask how tenant data is isolated before they will sign.
  • Finance cannot see revenue, churn or failed payments without exporting data by hand.

What the Solution Delivers

  • New plans and price changes launched by configuration instead of code changes
  • Every invoice traceable to the usage events behind it
  • Tenant isolation enforced in the database, not only in application code
  • Finance dashboards for MRR, churn and failed payments without manual exports
Architecture

Billing platform architecture

Billing platform architectureProduct services publish usage events. The metering service aggregates them per tenant, the billing engine prices them against each plan, and Stripe collects payment. Postgres row-level security keeps tenant data separate. Connections: SaaS Product to Event Stream (usage); Customer Portal to API Gateway; Finance Console to API Gateway; Event Stream to Metering Service; API Gateway to Billing Engine; Metering Service to PostgreSQL; Billing Engine to Stripe (charge); Billing Engine to PostgreSQL; Invoicing to PostgreSQL; API Gateway to Revenue Analytics; Revenue Analytics to PostgreSQL (read replica).CLIENTSAPI & EVENTSCORE SERVICESDATA & PAYMENTSSaaS Productemits usage eventsCustomer PortalReactFinance ConsoleReactAPI Gatewayauth · tenant contextEvent StreamKafkaMetering Serviceaggregate per tenantBilling Engineplans · prorationInvoicingPDF · tax · emailRevenue AnalyticsMRR · churn · failedpaymentsPostgreSQLrow-level securityStripepayments · dunningusagechargeread replica
Product services publish usage events. The metering service aggregates them per tenant, the billing engine prices them against each plan, and Stripe collects payment. Postgres row-level security keeps tenant data separate.

The situation

Many B2B SaaS companies start billing with a payment provider’s hosted checkout and a few scripts. That works for a handful of flat-price plans. It stops working when sales starts offering annual contracts, seat-based tiers, usage-based add-ons and custom enterprise terms. Each exception becomes a manual step, and each manual step becomes a support ticket or a revenue leak.

Our approach

1. Model pricing as data

We start with a two-week discovery where product, finance and engineering agree on a pricing model: plans, features, meters, tiers, proration and trial rules. We store that model in the database as versioned configuration. Changing a price or adding a plan becomes an admin action with an audit trail, not a deployment.

2. Treat usage as an event stream

Product services publish usage events (API calls, seats, storage, messages) to a stream with an idempotency key. The metering service deduplicates, aggregates per tenant and billing period, and keeps the raw events so every invoice line can be traced back to its source. Late or corrected events are handled explicitly instead of silently changing past invoices.

3. Isolate tenants at the data layer

Every table carries a tenant ID, and PostgreSQL row-level security policies enforce it. The API gateway resolves the tenant from the authenticated session and sets it on each database connection. A bug in one query cannot return another customer’s data. This is the answer enterprise security reviews look for.

4. Let the payment provider do payments

We keep the source of truth for plans, usage and invoices in the platform, and use Stripe for what it does best: storing payment methods, charging cards, bank debits and retrying failed payments. Webhooks are verified, processed idempotently and reconciled nightly.

5. Give finance and customers visibility

The customer portal shows current usage, upcoming charges and invoice history, which removes most “why was I charged this?” tickets. The finance console reports MRR, expansion, churn and failed payments from the same data, so the numbers match the invoices.

How we deliver it

We ship in stages behind feature flags, starting with a shadow mode that calculates invoices alongside the existing process and flags differences. Only when the two agree for a full billing cycle do we switch customers over, plan by plan. Infrastructure is defined in Terraform and runs on AWS with automated deployments; see our cloud services.

Is this relevant to you?

If your pricing is limited by what your billing code can handle, or enterprise deals stall on data-isolation questions, this architecture is a good fit. Explore our custom software development service or talk to us about your pricing model.

Building something similar?

We'll walk through your requirements and share how we'd approach architecture, timeline and team for your project.

More Blueprints

Typical Technology Stack

TypeScriptNode.jsNestJSReactPostgreSQLRedisKafkaStripeAWS ECSTerraformOpenTelemetry
Start Your Digital Evolution

Let’s Build Something Extraordinary Together

Tell us about your software initiative, timeline, or technical challenge. Our principal solutions architect will respond within 4 business hours.

Project Consultation Request

Please enter your full name.
Please enter a valid work email address.
Please select a service domain.
Please select an estimated budget range.
Please describe your project (minimum 15 characters).

We reply by email and never share your details. See our Privacy Policy.

This site is protected by reCAPTCHA and the GooglePrivacy Policy andTerms of Service apply.

Headquarters & Direct Channels

Ahmedabad HeadquartersVandemataram City, Gota, Ahmedabad, Gujarat, India - 382481
Enterprise Inquirieshello@evoxsoft.com
Direct Consultation Line+91 98981 85028
EvoxSoftAhmedabad Headquarters
Get Directions