Shared SaaS Billing Platform

Handle subscriptions, payments, and usage tracking for all your products

Features

💳

Stripe Integration

Full Stripe support for subscriptions, invoices, and webhooks

📊

Usage Tracking

Track usage per customer and enforce limits automatically

🔌

Multi-Product

One billing service for all your SaaS products

Quick Start

1. Create a Customer

curl -X POST http://localhost:8500/customers \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "company_name": "Acme Corp"}'

2. List Plans

curl http://localhost:8500/plans?product=push_api

3. Create Subscription

curl -X POST http://localhost:8500/subscriptions \
  -H "Content-Type: application/json" \
  -d '{"customer_id": 1, "plan_id": 2, "payment_method": "pm_card_visa"}'

4. Track Usage

curl -X POST http://localhost:8500/usage \
  -H "Content-Type: application/json" \
  -d '{"customer_id": 1, "service_name": "push_api", "metric_name": "notifications_sent", "quantity": 100}'

API Endpoints

Method Endpoint Purpose
POST/customersCreate customer
GET/customers/{id}Get customer
GET/productsList products
GET/plansList pricing plans
POST/subscriptionsCreate subscription
DELETE/subscriptions/{id}Cancel subscription
POST/usageRecord usage
GET/usage/{customer_id}Get usage stats
POST/webhooks/stripeStripe webhooks
GET/healthHealth check