> ## Documentation Index
> Fetch the complete documentation index at: https://dodopayments-mintlify-external-integration-datafast-autosen.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Customer Portal Session

> Create a session of the Customer Portal for a specific customer.



## OpenAPI

````yaml post /customers/{customer_id}/customer-portal/session
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.61.5
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /customers/{customer_id}/customer-portal/session:
    post:
      tags:
        - Customers
      operationId: create_customer_portal_session
      parameters:
        - name: send_email
          in: query
          description: If true, will send link to user.
          required: false
          schema:
            type: boolean
          style: form
        - name: customer_id
          in: path
          description: Customer Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully send email to customer (if they exist)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCustomerPortalSessionResponse'
        '422':
          description: Invalid Request Object or Parameters
        '500':
          description: Something went wrong :(
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import DodoPayments from 'dodopayments';


            const client = new DodoPayments({
              bearerToken: 'My Bearer Token',
            });


            const customerPortalSession = await
            client.customers.customerPortal.create('customer_id');


            console.log(customerPortalSession.link);
        - lang: Python
          source: |-
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token="My Bearer Token",
            )
            customer_portal_session = client.customers.customer_portal.create(
                customer_id="customer_id",
            )
            print(customer_portal_session.link)
        - lang: Go
          source: |
            package main

            import (
              "context"
              "fmt"

              "github.com/dodopayments/dodopayments-go"
              "github.com/dodopayments/dodopayments-go/option"
            )

            func main() {
              client := dodopayments.NewClient(
                option.WithBearerToken("My Bearer Token"),
              )
              customerPortalSession, err := client.Customers.CustomerPortal.New(
                context.TODO(),
                "customer_id",
                dodopayments.CustomerCustomerPortalNewParams{

                },
              )
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", customerPortalSession.Link)
            }
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import com.dodopayments.api.models.customers.CustomerPortalSession;

            import
            com.dodopayments.api.models.customers.customerportal.CustomerPortalCreateParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    CustomerPortalSession customerPortalSession = client.customers().customerPortal().create("customer_id");
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import com.dodopayments.api.models.customers.CustomerPortalSession

            import
            com.dodopayments.api.models.customers.customerportal.CustomerPortalCreateParams


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val customerPortalSession: CustomerPortalSession = client.customers().customerPortal().create("customer_id")
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )


            customer_portal_session =
            dodo_payments.customers.customer_portal.create("customer_id")


            puts(customer_portal_session)
components:
  schemas:
    CreateCustomerPortalSessionResponse:
      type: object
      required:
        - link
      properties:
        link:
          type: string
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````