Subscription Console
Use one page for upgrades, billing management, invoices, and usage top-ups.
This page is the operational billing console behind the pricing page and avatar menu. It creates Checkout sessions from the browser, then treats the backend and webhook flow as the only source of billing truth.
Environment
http://localhost:3000Stripe callback split
Frontend success URLhttp://localhost:3000/billing?checkout=success
Frontend cancel URLhttp://localhost:3000/billing?checkout=cancelled
Stripe webhookhttps://api.example.com/api/v1/stripe/webhook
Client never verifies StripeAll billing truth comes from backend reads and webhook processing.
Subscription management
First purchase uses Checkout. Existing subscriptions should change plan in-place.
Success URL: http://localhost:3000/billing?checkout=success
Cancel URL: http://localhost:3000/billing?checkout=cancelled
Optional referral metadata carried from browser: -
Cancel URL: http://localhost:3000/billing?checkout=cancelled
Optional referral metadata carried from browser: -
Create credits checkout
Matches POST /stripe/checkout/session for product_type=credits.
Current subscription
Loaded from GET /stripe/subscription.
Sign in to load billing data.
Invoices
Loaded from GET /stripe/invoices.
No invoices yet.