Billing API
Get Subscription
GET /api/billing/subscriptionjson
{
"tier": "pro",
"status": "active",
"renewalDate": "2024-03-01T00:00:00Z",
"cancelAtPeriodEnd": false
}Create Checkout Session
POST /api/billing/checkoutBody:
json
{
"tier": "pro"
}Returns a Stripe checkout URL:
json
{
"url": "https://checkout.stripe.com/..."
}Customer Portal
POST /api/billing/portalReturns a Stripe customer portal URL for managing subscription and payment methods.
Get Usage
GET /api/billing/usagejson
{
"compute": { "used": 1200, "limit": 5000 },
"backtests": { "used": 15, "limit": 100 },
"deployments": { "used": 2, "limit": 10 }
}Get Invoices
GET /api/billing/invoicesReturns a list of Stripe invoices with download URLs.