Create a Stripe Checkout Session for a subscription or credit pack.
The kind, credit amount, and Stripe mode are all derived
server-side from the stripe_product_mappings row — the client
only sends the Price id. Frontend redirects the user to the
returned url; Stripe handles the payment UI and fires
checkout.session.completed (and the subscription lifecycle
events) when the user finishes.
Documentation Index
Fetch the complete documentation index at: https://docs.roughy.ai/llms.txt
Use this file to discover all available pages before exploring further.
Either your Supabase session JWT (UI flows) or an API key minted via POST /api-keys (programmatic flows). Pass it as Authorization: Bearer <token>. The server inspects the token format and routes to JWT or API-key verification automatically.
Body of POST /billing/checkout.
Stripe Price id (price_xxx) the user is purchasing. Must exist in stripe_product_mappings and be active. Subscription vs credit-pack is derived from the mapping, not from the client.
1 - 120Successful Response
Response to POST /billing/checkout. Frontend redirects to url.
Stripe-hosted Checkout Session URL. Redirect the user here; Stripe handles the payment UI, redirects back to the configured success/cancel URLs, and fires the corresponding webhook events.