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

# Create Customer Portal Session

> Create a Stripe Customer Portal session for the user to manage their subscription, payment methods, and billing details.



## OpenAPI

````yaml cloud-api/openapi.json post /api/v1/payments/stripe/customer-portal
openapi: 3.1.0
info:
  title: Dev Kit for AI API
  description: 'API for Dev Kit for AI: Developer Toolkit for AI-Powered Web Applications'
  version: 1.6.1
servers:
  - url: https://api.devkit4ai.com
    description: Dev Kit for AI Production Server
  - url: https://api.vibecoding.ad
    description: Vibe Coding Production Server
security: []
paths:
  /api/v1/payments/stripe/customer-portal:
    post:
      tags:
        - Stripe Subscriptions
      summary: Create Customer Portal Session
      description: >-
        Create a Stripe Customer Portal session for the user to manage their
        subscription, payment methods, and billing details.
      operationId: create_customer_portal_api_v1_payments_stripe_customer_portal_post
      parameters:
        - name: test_mode
          in: query
          required: false
          schema:
            type: boolean
            description: Use test mode
            default: true
            title: Test Mode
          description: Use test mode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerPortalRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerPortalResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CustomerPortalRequest:
      properties:
        return_url:
          type: string
          minLength: 1
          title: Return Url
      type: object
      required:
        - return_url
      title: CustomerPortalRequest
      description: Request to create a customer portal session.
    CustomerPortalResponse:
      properties:
        portal_url:
          type: string
          title: Portal Url
      type: object
      required:
        - portal_url
      title: CustomerPortalResponse
      description: Customer portal session response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````