Create customer billing portal
API Refs
- Staging: Create customer billing portal
Request body
Name | Type | Description | Required |
---|---|---|---|
stripeCustomerId | string | Stripe customer ID (must start with "cus_") | yes |
returnUrl | string | URL to redirect after portal session | yes |
Response
Success Response (200 OK)
Name | Type | Description |
---|---|---|
url | string | Portal session URL |
Example Request
{
"stripeCustomerId": "cus_ExampleCustomerID123",
"returnUrl": "https://example.com/account"
}
Example Response
{
"url": "https://billing.stripe.com/p/session/test_YWNjdF8xTTJKb0tMa3h2NHF1SldOLF9QaU5sWkE3eGJVeTJ5TnJVeU5KQmJPRXNPSlBUbjRh0100RTyITSRQ"
}
Description
This endpoint creates a Stripe billing portal session for an existing customer to manage their subscription, payment methods, and billing details. The portal allows customers to:
- Update payment methods (enabled for all allowed payment types)
- Download invoices
- Cancel or modify subscriptions
- Update billing information
This provides a complete self-service experience without requiring you to build these features yourself. The customer will be redirected to the returnUrl after they finish managing their subscription in the portal.
Error Responses
- 400 Bad Request: Invalid customer or return URL
- 401 Unauthorized: Invalid or missing authorization token
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Customer not found
Updated 5 days ago