Create a Stripe Checkout Session for the Pro subscription.
const url = 'https://api.tradr.cloud/api/billing/subscription/checkout';const options = {method: 'POST'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tradr.cloud/api/billing/subscription/checkoutAuthed; shares the per-user 10 / 60 s spend budget with the credit-pack checkout and the portal endpoint (plan-tiers D8). No request body — the Price sold is server-configured (STRIPE_PRO_PRICE_ID, REQ-2.2). Refuses 402 BILLING_NOT_AVAILABLE unless the Pro subscription is fully configured (REQ-2.7), and 409 SUBSCRIPTION_EXISTS when the user already has a qualifying subscription — including past_due and canceled-pending-period-end (REQ-2.4). Returns { url }, the Stripe-hosted checkout page. NO mirror write happens here — the mirror is the webhook’s job (REQ-3.2); the success URL returns to the billing tab in its ?subscription=confirming state (REQ-2.6).
Responses
Section titled “Responses”{ url } — the Stripe-hosted checkout URL.
BILLING_NOT_AVAILABLE (Stripe or the Pro price unconfigured).
SUBSCRIPTION_EXISTS (a qualifying subscription already exists).
Shared checkout rate limit reached (10 / 60 s).
CHECKOUT_FAILED (Stripe returned no checkout URL).