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

MethodPathDescription
GET/billing/planGet current plan and limits
POST/billing/upgradeUpgrade to professional or enterprise
GET/billing/invoicesList invoices
GET/billing/invoices/:idGet invoice
GET/billing/invoices/:id/pdfGet rendered invoice document
POST/admin/billing/activateActivate subscription for any org
GET/admin/billing/invoicesList all invoices
POST/admin/billing/invoices/:id/mark-paidMark invoice as paid

Example

curl http://localhost:4000/billing/plan \
  -H "Authorization: Bearer tr_abc123"