Skip to main content
POST
/
api
/
v1
/
billing
/
checkout
Create Checkout
curl --request POST \
  --url https://roughy-api-staging.fly.dev/api/v1/billing/checkout \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "price_id": "price_1TQTUjIasIn8pvgqStarter"
}
'
{
  "url": "https://checkout.stripe.com/c/pay/cs_test_a1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0U1v2W3x4Y5z6"
}

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.

Authorizations

Authorization
string
header
required

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

application/json

Body of POST /billing/checkout.

price_id
string
required

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.

Required string length: 1 - 120

Response

Successful Response

Response to POST /billing/checkout. Frontend redirects to url.

url
string
required

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.