Now booking discovery calls for Q4 project starts.Book a free consultation

EntireXperts
Illustrative exampleB2B SaaS

Rebuilding a B2B SaaS product's billing and permissions layer

A multi-tenant billing and role-permissions overhaul for a growing SaaS product that had outgrown its original single-tenant design.

The challenge

The product was originally built for one account per customer. As larger customers signed up wanting multiple teams and seat-based billing, the existing data model couldn't represent that without risky workarounds.

The approach

A multi-tenant data model with organization-level roles and seat-based billing, migrated in stages behind feature flags so existing customers were never disrupted mid-migration.

How we’d run this project

1

Audited the existing single-tenant schema and mapped every place it assumed one account per customer

2

Designed the multi-tenant model and a migration path that could run gradually, account by account

3

Built seat-based billing on top of the new model once the tenant structure was stable

4

Migrated existing customers in batches, monitoring for billing discrepancies at each stage

Features delivered

  • Organization and team hierarchy with role-based permissions
  • Seat-based billing with prorated upgrades and downgrades
  • Zero-downtime migration path from the legacy single-tenant schema
  • Admin dashboard for usage and billing visibility

Technology stack

Next.jsTypeScriptPostgreSQLStripeRedis

Outcome

The product could sell to multi-team customers without the custom one-off contracts the sales team previously had to negotiate around the platform's limitations.

Have a similar project in mind?