Billing API
Manage subscriptions, invoices, and payment methods.
Create Checkout Session
/api/checkout/sessionsCreate a checkout session for hosted payment flows, custom domains, or manual invoicing. This endpoint automatically resolves organizationId via custom domains when available.
Response (201 Created)
Retrieve Checkout Session
/api/checkout/sessions/:sessionIdFetch the latest status. When the request is authenticated and the user is a super admin you can inspect any session; otherwise the session must belong to the resolved organization.
Update Checkout Session
/api/checkout/sessions/:sessionIdMark a session as completed, failed, or requiring further action. Requests must include X-Authcore-Signature with the value from AUTHCORE_CHECKOUT_SECRET, unless the caller is a super admin.
List Payment Providers
/api/checkout/sessionsReturns the registered payment adapters so your frontend can render the correct options. Custom adapters can be registered at runtime via registerPaymentProvider.
Get Current Subscription
/api/organizations/:orgId/subscriptionGet active subscription details. Requires admin role.
Response (200 OK)
Create Subscription
/api/organizations/:orgId/subscriptionSubscribe to a plan. Requires admin role and payment method.
Request Body
Response (201 Created)
Update Subscription
/api/organizations/:orgId/subscriptionChange subscription plan or interval. Requires admin role.
Request Body
Response (200 OK)
Cancel Subscription
/api/organizations/:orgId/subscriptionCancel at end of billing period. Requires admin role.
Query Parameters
Response (200 OK)
List Invoices
/api/organizations/:orgId/invoicesGet billing history. Requires admin role.
Query Parameters
Response (200 OK)
Get Invoice
/api/organizations/:orgId/invoices/:invoiceIdGet specific invoice details. Requires admin role.
Response (200 OK)
List Payment Methods
/api/organizations/:orgId/payment-methodsGet saved payment methods. Requires admin role.
Response (200 OK)
Add Payment Method
/api/organizations/:orgId/payment-methodsAdd new payment method. Requires admin role.
Request Body
Response (201 Created)
Delete Payment Method
/api/organizations/:orgId/payment-methods/:pmIdRemove payment method. Requires admin role.
Response (200 OK)
Get Usage Statistics
/api/organizations/:orgId/usageGet current billing period usage. Requires admin role.
Response (200 OK)