Platform
Unified SSO & Billing Architecture
Technical roadmap for single sign-on and unified billing across WaZoBia Invoice, Books, and Events.
Last updated: 2026-07-09
This document describes the target architecture for WaZoBia OS unified identity and billing — the foundation for a true multi-product business platform (Zoho-style "one account, many apps").
Current state (July 2026)
| Area | Invoice | Books | Events | WaZoBia OS hub |
|---|---|---|---|---|
| User accounts | App-local | App-local | App-local | Login redirect only |
| Auth mechanism | Session / app JWT | Session | Session | Links to product apps |
| Billing | Per-app Paystack/Flutterwave | Per-app | Flutterwave subs | No central billing |
| Partner portals | Admin / Agent / ASP on Invoice site | — | — | Redirect to Invoice |
Pain points:
- Users register separately per product
- No shared customer graph or org/tenant model
- Enterprise deals require manual coordination across apps
- Partner commissions and product subscriptions are siloed
Target state
One WaZoBia identity per person and one organisation (tenant) per business, with:
- Single sign-on (SSO) — sign in once at
wazobiaos.comor any product app; access all entitled products - Unified billing — one subscription or bundle (e.g. "WaZoBia Business") with product entitlements
- Shared org model — branches, roles, and team invites work across products
- Central audit trail — login events, billing changes, and admin actions logged per tenant
Recommended architecture
Option A — Managed IdP (fastest MVP)
Use Clerk, Auth0, or Firebase Auth with:
- Organisations / multi-tenant support
- Social + email/password + magic links
- JWT issued to each product app with
org_idandproduct_entitlementsclaims
Pros: Speed to market, MFA, compliance helpers
Cons: Cost at scale, vendor lock-in, custom partner-portal flows still need work
Option B — Custom identity service (recommended long-term)
Build WaZoBia Identity as a dedicated service:
| Component | Technology (proposed) |
|---|---|
| API | Next.js or Node service on Vercel / Railway |
| Sessions | Redis (Upstash) — already used on Invoice |
| Tokens | Short-lived JWT access + rotating refresh tokens |
| Passwords | bcrypt / argon2; optional passkeys later |
| Cookie domain | .wazobia-invoice.ng / .wazobiaos.com shared where DNS allows |
Token claims example:
{
"sub": "user_abc",
"org_id": "org_xyz",
"email": "owner@business.ng",
"roles": ["owner"],
"products": ["invoice", "books"],
"plan": "business"
}
Each product app validates JWT (JWKS endpoint) and enforces entitlements locally.
Billing service
Central Billing API responsible for:
- Plan catalog (Starter, Business, Enterprise, à la carte products)
- Subscription lifecycle (create, upgrade, cancel, dunning)
- Webhooks from Paystack / Flutterwave (single webhook URL)
- Entitlement sync to Identity (
products[]on org)
Invoice already has payment infrastructure — Phase 1 billing can extend Invoice's Redis/DB as source of truth, with Books/Events reading entitlements via API.
Phased rollout
Phase 1 — Identity hub (8–10 weeks)
- WaZoBia Identity service: register, login, logout, password reset
- OS
/loginbecomes real SSO entry (not redirect-only) - Invoice app accepts Identity JWT (feature flag)
- Shared cookie domain on production DNS
- Migrate existing Invoice users via email match + forced password reset or magic link
Phase 2 — Org & team model (6–8 weeks)
- Organisation entity: name, branches, owner, billing contact
- Invites and roles (
owner,admin,member,accountant) - Books + Events accept same JWT
- Admin portal reads org from Identity API
Phase 3 — Unified billing (8–12 weeks)
- Plan catalog in Billing service
- Bundle SKUs (Invoice Pro + Books Start, etc.)
- Single checkout on OS or Invoice; entitlements propagate within 60s
- Agent/ASP commission rules unchanged initially (Invoice-side)
Phase 4 — Enterprise & compliance (ongoing)
- SAML/OIDC for enterprise IdP federation
- SLA-backed uptime on Identity + Billing
- SOC 2 / NDPR audit pack for enterprise sales
Security requirements
- HTTPS only;
HttpOnly,Secure,SameSite=Laxcookies - Refresh token rotation; revoke on password change
- Rate limiting on login and password reset (already pattern on Invoice APIs)
- No cross-tenant data leaks — every query scoped by
org_id - Partner portals (Admin/Agent/ASP) remain separate auth with stricter MFA for Admin
Open decisions
| Decision | Options | Recommendation |
|---|---|---|
| IdP build vs buy | Clerk vs custom | Custom for cost + partner portal control |
| Billing owner | Invoice team vs platform team | Platform team with Invoice payment adapters |
| Cookie domain | .wazobiaos.com only vs multi-domain | Start .wazobia-invoice.ng + redirect OS |
| Migration | Big bang vs gradual | Gradual with feature flags per app |
Related links
- Enterprise sales — custom agreements and early SSO access
- Security & trust — current payment and data posture
- Help hub — product manuals and FAQs
Questions? Contact hello@wazobiaos.com or your enterprise success manager.