Create a Stripe Customer Portal session URL for self-service billing.
Lazily creates a Stripe Customer if the user has none, which means the portal may show an empty state for users without prior billing activity. Frontends should gate visibility of the entry point based on subscription status — this endpoint always returns a working URL for any active account.
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.
Successful Response
Response to POST /billing/portal. Frontend redirects to url.
Stripe-hosted Customer Portal URL. Redirect the user here to manage subscriptions, payment methods, and invoices. Stripe redirects back to the configured portal_return_url when the user is done.