createCustomerPortal

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·

required
application/json

The customer to open the portal for: give customerId or externalCustomerId. customerId wins when both are given.

Responses

  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/customer-portals
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"
}