Skip to main content
POST
Smart upgrade — chooses Checkout Session or direct API based on payment method
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

POST /billing/upgrade/ Validates unpaid invoices first (402 if present), then for paid plans checks whether the tenant already has a card on file: if not, creates a Stripe Checkout Session and returns 402 payment_required with data.checkoutUrl; if a payment method exists (or the target is FREE), performs the plan change directly via createOrReplaceSubscription with always_invoice proration. Authorization:
  • Required role: owner only

Code Examples

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Path Parameters

lookupKey
string
required
Example:

"plus_monthly"

Response

Upgrade completed directly (payment method already on file)

status
string
Example:

"success"

message
string
data
object