> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useautumn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Open Customer Portal

> Create a billing portal session for a customer to manage their subscription.

### Body Parameters

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

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

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

### Response

The ID of the billing portal session

URL to the billing portal

```json 200 theme={null}
{
  "customer_id": "cus_123",
  "url": "https://billing.stripe.com/session/..."
}
```


## OpenAPI

````yaml openapi POST /v1/billing.open_customer_portal
openapi: 3.1.0
info:
  title: Autumn API
  version: 2.6.0
servers:
  - url: https://api.useautumn.com
    description: Production server
security:
  - secretKey: []
paths:
  /v1/billing.open_customer_portal:
    post:
      tags:
        - billing
      description: >-
        Create a billing portal session for a customer to manage their
        subscription.
      operationId: openCustomerPortal
      parameters:
        - name: x-api-version
          in: header
          required: true
          schema:
            type: string
            default: 2.6.0
          x-speakeasy-globals-hidden: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  description: The ID of the customer to open the billing portal for.
                configuration_id:
                  type: string
                  description: >-
                    Stripe billing portal configuration ID. Create
                    configurations in your Stripe dashboard.
                return_url:
                  type: string
                  description: >-
                    URL to redirect to when back button is clicked in the
                    billing portal
              required:
                - customer_id
              title: OpenCustomerPortalParams
              examples:
                - customer_id: cus_123
                  return_url: https://useautumn.com
            example:
              customer_id: cus_123
              return_url: https://useautumn.com
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  customer_id:
                    type: string
                    description: The ID of the billing portal session
                  url:
                    type: string
                    description: URL to the billing portal
                required:
                  - customer_id
                  - url
                examples:
                  - customer_id: cus_123
                    url: https://billing.stripe.com/session/...
              example:
                customer_id: cus_123
                url: https://billing.stripe.com/session/...
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Autumn } from 'autumn-js'

            const autumn = new Autumn()

            const result = await autumn.billing.openCustomerPortal({
              customerId: "cus_123",
              returnUrl: "https://useautumn.com",
            });
        - lang: python
          label: Python (SDK)
          source: |-
            from autumn_sdk import Autumn

            autumn = Autumn(secret_key="am_sk_test...")

            res = autumn.billing.open_customer_portal(
                customer_id="cus_123",
                return_url="https://useautumn.com",
            )
components:
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.