Start checkout
Billing
Start checkout
Create a Stripe Checkout session for a subscription or a credit pack.
POST
Start checkout
Server-side checkout creation. Returns a Stripe-hosted URL; the caller
redirects the user there. Never expose the Stripe secret key to the
browser, this endpoint exists precisely to keep it server-side.
Body
Stripe price id. Must be one of the prices configured on the server
(see
GET /v1/stripe/catalog).
Hostile price ids are rejected with 400 invalid_args.Where to send the user after a successful payment. Default:
${origin}/PaymentSuccess?session_id={CHECKOUT_SESSION_ID}.Where to send the user if they bail out. Default:
${origin}/PaymentCancel.Response
kind is either "subscription" or "credit_pack", useful when
the UI wants to show different post-checkout messaging.
Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | unauthenticated | Missing Authorization or X-Lavendly-User-Id. |
| 400 | invalid_args | Unknown price_id (not in the server’s catalog). |
| 502 | billing_upstream | Stripe returned a non-2xx. |
| 503 | billing_not_configured | STRIPE_SECRET_KEY not set on this deploy. |