Skip to content

Create a Stripe Checkout Session for a credit pack.

POST
/api/billing/checkout
curl --request POST \
--url https://api.tradr.cloud/api/billing/checkout \
--header 'Content-Type: application/json' \
--data '{ "packId": "example" }'

Authed and per-user rate limited (10 / 60 s). Body { packId } selects a server-authoritative CREDIT_PACKS pack — the price and credit grant come solely from config, never client input (REQ-2.2). Returns { url }, the Stripe-hosted checkout page to redirect to. NO wallet write happens here — crediting is the webhook’s job (REQ-2.6). When Stripe is unconfigured the endpoint returns a stable 402 BILLING_NOT_AVAILABLE (REQ-2.5/10.2).

Media typeapplication/json
object
packId
required
string
>= 1 characters
Examplegenerated
{
"packId": "example"
}

{ url } — the Stripe-hosted checkout URL.

Validation error or UNKNOWN_PACK.

BILLING_NOT_AVAILABLE (Stripe unconfigured).

Checkout rate limit reached (10 / 60 s).