Create a customer portal session
Opens a Stripe customer portal session, where your customer manages its payment methods and billing details, and returns its link. Name the customer by customerId or externalCustomerId. If the customer has no Stripe customer yet, one is created. Needs Stripe connected (422 STRIPE_NOT_CONNECTED); an error from Stripe answers 400 with Stripe's message. Links are short-lived: send your customer straight there rather than storing the link.
Body·
The customer to open the portal for: give customerId or externalCustomerId. customerId wins when both are given.
The customer to open the portal for: give
customerIdorexternalCustomerId.customerIdwins when both are given.The customer to open the portal for: give
customerIdorexternalCustomerId.customerIdwins when both are given.- Type: stringcustomer
Id min length:1max length:255requiredSpondo Billing ID of the customer.
- Type: string | nullFormat: date-timeexpires
At When the link should stop working. Defaults to five minutes after it was created.
- Type: stringexternal
Customer Id min length:1max length:255Your ID for the customer (matched ignoring case).
- Type: stringreturn
Url min length:1max length:2000Format: uriWhere the portal's back link takes your customer. Defaults to your Spondo Billing dashboard.
Responses
- application/json
- application/json
- application/json
- application/json
curl https://billing.getspondo.com/api/v1/customer-portals \
--request POST \
--header "Authorization: Bearer $SPONDO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"externalCustomerId": "acme-legal",
"returnUrl": "https://app.documind.ai/settings/billing"
}'
{
"id": "bps_1QzX8yLkdIwHu7ix3Pq0aBcD",
"customerId": "cus_Q2x9vB7mK4pT1sLw",
"url": "https://billing.stripe.com/p/session/live_YWNjdF8xUXpYOHlMa2RJd0h1N2l4",
"status": "active",
"returnUrl": "https://app.documind.ai/settings/billing",
"expiresAt": "2026-11-09T14:37:05.000Z",
"createdAt": "2026-11-09T14:32:05.000Z"
}