Skip to main content
POST
/
v1
/
billing.open_customer_portal
Typescript (SDK)
import { Autumn } from 'autumn-js'

const autumn = new Autumn()

const result = await autumn.billing.openCustomerPortal({
  customerId: "cus_123",
  returnUrl: "https://useautumn.com",
});
{
  "customer_id": "cus_123",
  "url": "https://billing.stripe.com/session/..."
}

Body Parameters

Response

{
  "customer_id": "cus_123",
  "url": "https://billing.stripe.com/session/..."
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string
default:2.1
required

Body

application/json
customer_id
string
required

The ID of the customer to open the billing portal for.

configuration_id
string

Stripe billing portal configuration ID. Create configurations in your Stripe dashboard.

return_url
string

URL to redirect to when back button is clicked in the billing portal

Response

200 - application/json

OK

customer_id
string
required

The ID of the billing portal session

url
string
required

URL to the billing portal