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

> Create a new customer in your Dodo Payments account.



## OpenAPI

````yaml post /customers
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:
    post:
      tags:
        - Customers
      operationId: create_customer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponse'
        '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 customer = await client.customers.create({ email: 'email',
            name: 'name' });


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

            client = DodoPayments(
                bearer_token="My Bearer Token",
            )
            customer = client.customers.create(
                email="email",
                name="name",
            )
            print(customer.business_id)
        - 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"),
              )
              customer, err := client.Customers.New(context.TODO(), dodopayments.CustomerNewParams{
                Email: dodopayments.F("email"),
                Name: dodopayments.F("name"),
              })
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", customer.BusinessID)
            }
        - 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.Customer;
            import com.dodopayments.api.models.customers.CustomerCreateParams;

            public final class Main {
                private Main() {}

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

                    CustomerCreateParams params = CustomerCreateParams.builder()
                        .email("email")
                        .name("name")
                        .build();
                    Customer customer = client.customers().create(params);
                }
            }
        - 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.Customer
            import com.dodopayments.api.models.customers.CustomerCreateParams

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

                val params: CustomerCreateParams = CustomerCreateParams.builder()
                    .email("email")
                    .name("name")
                    .build()
                val customer: Customer = client.customers().create(params)
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


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


            customer = dodo_payments.customers.create(email: "email", name:
            "name")


            puts(customer)
components:
  schemas:
    CreateCustomerRequest:
      type: object
      required:
        - name
        - email
      properties:
        email:
          type: string
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Additional metadata for the customer
        name:
          type: string
        phone_number:
          type:
            - string
            - 'null'
    CustomerResponse:
      type: object
      required:
        - customer_id
        - business_id
        - name
        - email
        - created_at
      properties:
        business_id:
          type: string
        created_at:
          type: string
          format: date-time
        customer_id:
          type: string
        email:
          type: string
        metadata:
          $ref: '#/components/schemas/Metadata'
          description: Additional metadata for the customer
        name:
          type: string
        phone_number:
          type:
            - string
            - 'null'
    Metadata:
      type: object
      additionalProperties:
        type: string
      propertyNames:
        type: string
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````