Overview
The Billing API provides subscription and invoice management for the Truss platform. End-user endpoints allow viewing the current plan, upgrading to professional or enterprise tiers, and retrieving invoices (including rendered PDF documents). Admin-level endpoints provide the ability to activate subscriptions for any organization, list all invoices, and mark invoices as paid.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /billing/plan | Get current plan and limits |
| POST | /billing/upgrade | Upgrade to professional or enterprise |
| GET | /billing/invoices | List invoices |
| GET | /billing/invoices/:id | Get invoice |
| GET | /billing/invoices/:id/pdf | Get rendered invoice document |
| POST | /admin/billing/activate | Activate subscription for any org |
| GET | /admin/billing/invoices | List all invoices |
| POST | /admin/billing/invoices/:id/mark-paid | Mark invoice as paid |
Example
curl http://localhost:4000/billing/plan \
-H "Authorization: Bearer tr_abc123"