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

# Open Customer Portal

> Create a Stripe customer portal session URL for a customer.



## OpenAPI

````yaml POST /v1/customers/{customerId}/customer_portal
openapi: 3.1.0
info:
  title: PriceOS Public API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/customers/{customerId}/customer_portal:
    post:
      summary: Open customer portal
      description: Create a Stripe customer portal session URL for a customer.
      parameters:
        - schema:
            type: string
            description: Internal customer ID.
          required: true
          description: Internal customer ID.
          name: customerId
          in: path
        - schema:
            type: string
            description: API key from your PriceOS dashboard.
          required: true
          description: API key from your PriceOS dashboard.
          name: x-api-key
          in: header
      responses:
        '200':
          description: Customer portal session
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
                    description: Stripe customer portal URL.
                required:
                  - url
              example:
                url: https://billing.stripe.com/p/session/test_123
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
      x-codeSamples:
        - lang: typescript
          label: Node.js
          source: >-
            import { PriceOS } from "priceos";

            import type { MyFeatures } from "./priceos.types";


            const priceos = new
            PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);


            const session = await
            priceos.customers.createPortal("customer_123");
        - lang: bash
          label: cURL
          source: >-
            curl -X POST
            "https://api.priceos.com/v1/customers/customer_123/customer_portal"
            \
              -H "x-api-key: PRICEOS_API_KEY"

````