Subscriptions
Create Billing Portal Session
Create a Stripe billing portal session for managing subscription and payment methods.
POST
Overview
Creates a Stripe Customer Portal session where users can:- Update payment methods
- View billing history
- Change subscription plans
- Download invoices
- Cancel subscription
For third-party integrations: Use
POST /subscriptions/portal/api with API Key authentication instead.Authentication
Your JWT access token. Format:
Bearer YOUR_ACCESS_TOKENRequest Body
URL to redirect to when user exits the portal. Defaults to application dashboard.
Response Fields
URL to redirect the user to. This is a Stripe-hosted billing portal.
Portal Capabilities
The Stripe Customer Portal allows users to:| Feature | Description |
|---|---|
| Payment Methods | Add, update, or remove credit cards |
| Invoices | View and download past invoices |
| Plan Changes | Upgrade or downgrade subscription |
| Cancellation | Cancel subscription |
| Billing History | View all past transactions |
Error Responses
400
Bad Request - No billing account found. User must make a purchase first.
401
Unauthorized - Invalid or missing token.
The billing portal is only available for users who have previously made a purchase or have an active subscription. New users should use the checkout endpoint instead.
POST /subscriptions/portal/api
Creates a Stripe Customer Portal session using API Key authentication. Ideal for third-party integrations.Authentication
Requires API Key authentication. Include your API key in theAuthorization header:
Request Body
Same as/subscriptions/portal above.
Response
Same as/subscriptions/portal above.
Best Practices
- Link in settings: Add a “Manage Billing” button in your app’s settings page
- After checkout: Redirect users to the portal after subscription purchase
- Support: Provide portal access as a self-service option for billing issues