Billing API
Manage subscriptions, invoices, and payment methods.
Create Checkout Session
/api/checkout/sessions
Create 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/:sessionId
Fetch 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/:sessionId
Mark 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/sessions
Returns 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/subscription
Get active subscription details. Requires admin role.
Response (200 OK)
Create Subscription
/api/organizations/:orgId/subscription
Subscribe to a plan. Requires admin role and payment method.
Request Body
Response (201 Created)
Update Subscription
/api/organizations/:orgId/subscription
Change subscription plan or interval. Requires admin role.
Request Body
Response (200 OK)
Cancel Subscription
/api/organizations/:orgId/subscription
Cancel at end of billing period. Requires admin role.
Query Parameters
Response (200 OK)
List Invoices
/api/organizations/:orgId/invoices
Get billing history. Requires admin role.
Query Parameters
Response (200 OK)
Get Invoice
/api/organizations/:orgId/invoices/:invoiceId
Get specific invoice details. Requires admin role.
Response (200 OK)
List Payment Methods
/api/organizations/:orgId/payment-methods
Get saved payment methods. Requires admin role.
Response (200 OK)
Add Payment Method
/api/organizations/:orgId/payment-methods
Add new payment method. Requires admin role.
Request Body
Response (201 Created)
Delete Payment Method
/api/organizations/:orgId/payment-methods/:pmId
Remove payment method. Requires admin role.
Response (200 OK)
Get Usage Statistics
/api/organizations/:orgId/usage
Get current billing period usage. Requires admin role.
Response (200 OK)