Skip to content

HTTP API / Billing

Billing API ​

8 operations. Paths are relative to the API host (http://localhost:5080 in local development). Every operation accepts an OIDC bearer token (Authorization: Bearer …) or a workspace API key (X-Api-Key: keel_live_…); errors are RFC 9457 Problem Details with a code (error codes). Permissions: matrix.

MethodPathSummary
POST/api/public/v1/billing/stripe-webhookStripe webhook (signed, idempotent per event id, out-of-order safe; F20 AC2). Not for browsers.
GET/api/v1/tenant/billingThe billing page: plan, add-ons, usage meters and the plan catalog (Owners).
PUT/api/v1/tenant/billing/add-ons/{addOn}Add or remove an add-on (prorated; a trial buys it at checkout) (Owners).
GET/api/v1/tenant/billing/paymentsPayment method, billing contact and invoices from the payment provider (Owners).
POST/api/v1/tenant/billing/planChoose or change the plan: a checkout URL for a trial, a prorated change for a paid plan; 422 Billing.DowngradeBlocked lists what to remove first; 422 Billing.DowngradeConfirmationRequired lists what the change keeps frozen until it is confirmed (Owners).
POST/api/v1/tenant/billing/portalA customer portal session URL: payment method, billing details, invoices (Owners).
POST/api/v1/tenant/billing/subscription:cancelCancel: a paid plan ends at the end of its period; a trial ends now (read-only, nothing deleted) (Owners).
GET/api/v1/tenant/entitlementsPlan, status, trial and read-only state, features in effect and usage at 80%+ (any member; drives banners and navigation).

ReceiveStripeWebhook ​

http
POST /api/public/v1/billing/stripe-webhook

Stripe webhook (signed, idempotent per event id, out-of-order safe; F20 AC2). Not for browsers.

Request body (application/json): any

StatusDescriptionBody
200OKWebhookReceipt
400Bad RequestProblemDetails
401UnauthorizedProblemDetails

Response 200: WebhookReceipt

FieldTypeNotes
outcomestring

GetBillingOverview ​

http
GET /api/v1/tenant/billing

The billing page: plan, add-ons, usage meters and the plan catalog (Owners).

StatusDescriptionBody
200OKBillingOverviewDto

Response 200: BillingOverviewDto

FieldTypeNotes
addOnsAddOnDto[]
cancelAtPeriodEndboolean
catalogVersionstring
currentPeriodEnddate-time?
hasPaymentAccountboolean
paymentsEnabledboolean
planstring
planNamestring
plansPlanOptionDto[]
priceLabelstring
readOnlyboolean
retainDataUntildate-time?
sourcestring
statusstring
trialDaysLeftint32?
trialEndsAtdate-time?
usageUsageMeterDto[]
usageResetsAtdate-time

SetBillingAddOn ​

http
PUT /api/v1/tenant/billing/add-ons/{addOn}

Add or remove an add-on (prorated; a trial buys it at checkout) (Owners).

ParameterInTypeRequiredNotes
addOnpathstringyes

Request body (application/json): SetAddOnRequest

FieldTypeNotes
enabledboolean
StatusDescriptionBody
200OKPlanChangeDto

Response 200: PlanChangeDto

FieldTypeNotes
changedboolean
checkoutUrluri?

GetBillingPayments ​

http
GET /api/v1/tenant/billing/payments

Payment method, billing contact and invoices from the payment provider (Owners).

StatusDescriptionBody
200OKBillingPaymentsDto

Response 200: BillingPaymentsDto

FieldTypeNotes
billingEmailstring?
invoicesInvoiceSummary[]
paymentMethodstring?
taxIdstring?

ChangePlan ​

http
POST /api/v1/tenant/billing/plan

Choose or change the plan: a checkout URL for a trial, a prorated change for a paid plan; 422 Billing.DowngradeBlocked lists what to remove first; 422 Billing.DowngradeConfirmationRequired lists what the change keeps frozen until it is confirmed (Owners).

Request body (application/json): ChangePlanRequest

FieldTypeNotes
confirmboolean?Go ahead although the change keeps features frozen or shortens audit retention (422 Billing.DowngradeConfirmationRequired lists them).
planstring
StatusDescriptionBody
200OKPlanChangeDto
422Unprocessable EntityProblemDetails

Response 200: PlanChangeDto

FieldTypeNotes
changedboolean
checkoutUrluri?

OpenBillingPortal ​

http
POST /api/v1/tenant/billing/portal

A customer portal session URL: payment method, billing details, invoices (Owners).

StatusDescriptionBody
200OKRedirectResponse

Response 200: RedirectResponse

FieldTypeNotes
urluri

CancelSubscription ​

http
POST /api/v1/tenant/billing/subscription:cancel

Cancel: a paid plan ends at the end of its period; a trial ends now (read-only, nothing deleted) (Owners).

StatusDescriptionBody
204No Content—

GetEntitlements ​

http
GET /api/v1/tenant/entitlements

Plan, status, trial and read-only state, features in effect and usage at 80%+ (any member; drives banners and navigation).

StatusDescriptionBody
200OKEntitlementsDto

Response 200: EntitlementsDto

FieldTypeNotes
featuresstring[]
planstring
planNamestring
readOnlyboolean
seatsUsageMeterDto
sourceConnectionsUsageMeterDto
statusstring
trialDaysLeftint32?
trialEndsAtdate-time?
warningsUsageMeterDto[]
workspacesUsageMeterDto

Anchor Keel is a working product name: one platform, a shared core and licensed modules (Keel Semantic, Keel Migrate). Documentation built from the repository — facts are derived from code, ADRs and the decisions log.