This chapter covers the core features and capabilities of Billing Integration.
Follow this guide to get Billing Integration up and running in your environment.
# Start the billing server with demo data
python src/main.py --init-demo
# Start on a custom port
python src/main.py --port 8001Then try the API:
# List available plans
curl http://localhost:8001/api/plans
# Create a customer
curl -X POST http://localhost:8001/api/customers \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "name": "Acme Corp", "external_id": "tenant_123"}'
# Subscribe to a plan (use plan ID from /api/plans response)
curl -X POST http://localhost:8001/api/subscriptions \
-H "Content-Type: application/json" \
-d '{"customer_id": "cus_xxx", "plan_id": "plan_xxx", "trial_days": 14}'
# Record usage
curl -X POST http://localhost:8001/api/usage \
-H "Content-Type: application/json" \
-d '{"subscription_id": "sub_xxx", "quantity": 100, "idempotency_key": "req_001"}'
# Generate an invoice
curl -X POST http://localhost:8001/api/invoices/generate \
-H "Content-Type: application/json" \
-d '{"subscription_id": "sub_xxx"}'| Method | Path | Description |
|---|---|---|
| GET | /api/plans | List active subscription plans |
| POST | /api/customers | Create a billing customer |
| POST | /api/subscriptions | Subscribe customer to a plan |
| POST | /api/subscriptions/:id/cancel | Cancel a subscription |
| POST | /api/usage | Record metered usage |
| POST | /api/invoices/generate | Generate an invoice for a subscription |
| POST | /api/webhooks | Process incoming webhook events |
Get the full Billing Integration and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.