Create a Stripe Billing Portal session.
POST
/api/billing/subscription/portal
const url = 'https://api.tradr.cloud/api/billing/subscription/portal';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/portalAuthed; shares the per-user 10 / 60 s spend budget (plan-tiers D15). Looks up the persisted billing-customer linkage FIRST — none ⇒ 404 NO_BILLING_CUSTOMER; Stripe unconfigured ⇒ 402 BILLING_NOT_AVAILABLE. Returns { url }, the Stripe-hosted Billing Portal (cancel / payment method / invoices per the account’s operator-set default portal configuration — REQ-4.1/4.2).
Responses
Section titled “Responses”{ url } — the Stripe-hosted Billing Portal URL.
BILLING_NOT_AVAILABLE (Stripe unconfigured).
NO_BILLING_CUSTOMER (no billing customer exists for this account).
Shared checkout rate limit reached (10 / 60 s).