Billing
Customer Portal
The customer portal lets users manage their billing details (update payment method, view invoices, cancel subscription) through the payment provider's hosted UI.
The customer portal lets users manage their billing details (update payment method, view invoices, cancel subscription) through the payment provider's hosted UI.
How It Works
- User clicks "Manage Billing" in the app.
- Frontend calls the
createCustomerPortalaction. - The billing adapter generates a portal session URL from the provider.
- The app redirects the user to the provider's portal.
- After changes, the user is redirected back to the app.
Access Control
The customer portal requires:
- Permission:
billing.manage(owner role by default) - Capability:
billing.portal(granted by Pro plans) - Step-up verification: Level 1 (
billing.openPortal) — a recently created session (within 30 minutes) is sufficient
If the user's plan does not include billing.portal, the portal button is
not shown.
Provider Behavior
| Provider | Portal Type |
|---|---|
| Stripe | Stripe Customer Portal (hosted) |
| Polar | Polar customer dashboard |
| Lemon Squeezy | Lemon Squeezy customer portal |
Return URL
After the user finishes in the portal, they are redirected to the app's
return URL. The return URL is configured via the SITE_URL environment
variable.
Next Reads
- Billing Overview — billing system overview.
- Free, Pro, and Lifetime Plans — plan structure.