Billing
Subscriptions, checkout, plan changes, invoices, and payments
Billing endpoints wrap our payment processor (Razorpay). All amount fields are strings in major units to avoid floating-point loss.
Resource overview
GET
/api/billing/subscription/meAPI key · SessionGET
/api/billing/subscriptionAPI key · SessionRole: Super AdminGET
/api/billing/subscription/{id}API key · SessionRole: Super AdminPATCH
/api/billing/subscription/{id}API key · SessionRole: Super AdminPOST
/api/billing/checkoutAPI key · SessionRole: Owner · AdminPOST
/api/billing/checkout/confirmAPI key · SessionRole: Owner · AdminPOST
/api/billing/plan-changeAPI key · SessionRole: Owner · AdminPOST
/api/billing/cancelAPI key · SessionRole: Owner · AdminPOST
/api/billing/resumeAPI key · SessionRole: Owner · AdminGET
/api/billing/invoices/{id}/pdfAPI key · SessionRole: Owner · AdminGET
/api/billing/payments/exportAPI key · SessionRole: Owner · AdminCurrent subscription
GET
/api/billing/subscription/meAPI key · SessionReturns the calling org's active subscription.
Checkout
POST
/api/billing/checkoutAPI key · SessionRole: Owner · AdminCreates a Razorpay order and returns the parameters the client SDK needs.
| Name | Type | Required | Description |
|---|---|---|---|
planId | string | Required | Plan to subscribe to. |
billingCycle | string | Required | `monthly` or `yearly`. |
couponCode | string | Optional | Apply a coupon at checkout. |
POST
/api/billing/checkout/confirmAPI key · SessionRole: Owner · AdminConfirms the payment after the client-side flow completes. Pass the
Razorpay-returned paymentId, orderId, signature.
Plan change
POST
/api/billing/plan-changeAPI key · SessionRole: Owner · AdminSwitch the active subscription to another plan. Proration is applied automatically.
Cancel & resume
POST
/api/billing/cancelAPI key · SessionRole: Owner · AdminPOST
/api/billing/resumeAPI key · SessionRole: Owner · AdminCancellation is deferred to period end by default; resume re-activates within the same period.
Invoices & payments
GET
/api/billing/invoices/{id}/pdfAPI key · SessionRole: Owner · AdminReturns a application/pdf stream. Cache headers are set for 1 hour.
GET
/api/billing/payments/exportAPI key · SessionRole: Owner · AdminCSV export of historical payments. Standard from / to query params.