Skip to main content
POST /api/v1/billing/checkout Requires billing.write permission. Creates a Stripe-hosted checkout session for the selected plan. Redirect the user to the returned URL to complete payment.

Request body

plan
string
required
The plan to purchase. One of pro or enterprise.
success_url
string
URL to redirect to after a successful checkout. Must be a valid URI.
cancel_url
string
URL to redirect to if the user cancels checkout. Must be a valid URI.

Response

url
string
required
Stripe-hosted checkout URL. Redirect the user to this URL to complete the purchase.

Errors

StatusWhen
400Request body is invalid or missing required fields
401Missing or invalid Bearer token
403Caller lacks billing.write permission
500Billing provider error (Stripe unreachable or misconfigured)

Example

curl -X POST http://localhost:8080/api/v1/billing/checkout \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "plan": "pro",
    "success_url": "https://app.example.com/billing?success=true",
    "cancel_url": "https://app.example.com/billing"
  }'
{
  "url": "https://checkout.stripe.com/pay/cs_test_abc123"
}

Build docs developers (and LLMs) love