> ## 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



## OpenAPI

````yaml openapi-1.2.0 POST /customers/{customer_id}/billing_portal
openapi: 3.1.0
info:
  title: Autumn API
  version: 1.2.0
servers:
  - url: https://api.useautumn.com/v1
    description: Production server
security:
  - secretKey: []
paths:
  /customers/{customer_id}/billing_portal:
    post:
      tags:
        - customers
      summary: Get Billing Portal URL
      parameters:
        - in: path
          name: customer_id
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                return_url:
                  description: >-
                    URL to redirect to when back button is clicked in the
                    billing portal.
                  type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  customer_id:
                    description: The ID of the customer
                    type: string
                  url:
                    description: URL to the billing portal
                    type: string
                required:
                  - customer_id
                  - url
                additionalProperties: false
      x-codeSamples:
        - lang: TypeScript
          source: >-
            import { Autumn } from 'autumn-js';


            const autumn = new Autumn();


            const { data, error } = await
            autumn.customers.billingPortal('customer_id');
        - lang: Python
          source: |-
            import asyncio
            import os
            from autumn import Autumn

            client = Autumn(
                secret_key=os.environ.get("AUTUMN_SECRET_KEY"),  # This is the default and can be omitted
            )
            response = autumn.customers.billing_portal(
                customer_id="customer_id",
            )
            print(response.customer_id)
components:
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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