Multi-Tenant
Billing System

Complete subscription billing API for SaaS companies. Handle payments, manage organizations, and generate invoices — all with built-in multi-tenancy.

16+
API Endpoints
Stripe
Integrated
JWT
Auth
PDF
Invoices

Core Features

Everything you need for SaaS billing

Multi-Tenancy

Create multiple organizations with complete data isolation. Each company sees only their own data.

Stripe Integration

Accept payments via Stripe Checkout. Handle subscriptions, webhooks, and recurring billing.

Invoice Generation

Generate PDF invoices automatically. Download or send directly to customers.

Team Roles

Admin and Member roles. Control who can manage billing and settings.

JWT Auth

Secure token-based authentication. Login, refresh, and stateless API access.

Email Notifications

Send confirmation emails on subscription creation and payment success.

API Endpoints

RESTful endpoints for full billing control

Method Endpoint Description Auth
GET / Home page No
GET /success/ Payment success page No
GET /cancel/ Payment cancel page No
POST /api/organization/register/ Create organization No
POST /api/user/register/ Register user No
POST /api/token/ Get JWT token No
POST /api/token/refresh/ Refresh JWT token No
POST /api/stripe/webhook/ Stripe webhook handler No
GET /api/plans/ List subscription plans JWT
POST /api/subscribe/ Create Stripe checkout session JWT
POST /api/subscription/cancel/ Cancel subscription JWT
POST /api/subscription/update/ Upgrade/downgrade plan JWT
GET /api/my-users/ List organization users JWT
GET /api/invoice/{id}/ Download invoice PDF JWT
GET /api/admin-dashboard/ Admin dashboard JWT
PATCH /api/user/update/ Update user profile JWT
DELETE /api/user/delete/ Soft delete user JWT
POST /api/email/subscription-created/ Send subscription confirmation email JWT
POST /api/email/payment-success/ Send payment success email JWT

Testing the API

Use Postman or curl to test all endpoints

Quick Test

# Test organization registration curl -X POST http://localhost:8000/api/organization/register/ \ -H "Content-Type: application/json" \ -d '{"name": "My Company"}'
Try Now →

Full Test Guide

Complete test documentation with request/response examples, failure scenarios, and Postman collection.

View test_cases.md

Postman Setup

1

New Request

Create POST request

2

Enter URL

http://localhost:8000/api/...

3

Add JSON Body

{"name": "Company"}

4

Send

Check response