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

# Create customer

>  Create a new customer and optionnaly associate it with an existing partner.  
 
 **Examples:**  
 To associate the customer with the partner ID 42, set the `partnerId` property to be:  
 `"partnerId": 42`    
  
 If the customer comes from your website via a referral link shared by a partner and you want to associate it with the correct partner, use the HTTP header:  
 `Kiflo-Tracking-Code: AABBCCDDEEFF+=`  
The ** tracking code** can be retrieved in javascript from your website using the JS SDK. Please referer to the[JS SDK documentation](https://docs.kiflo.com/category/26-js-sdk).



## OpenAPI

````yaml /openapi.json post /v3/customers
openapi: 3.0.1
info:
  title: Kiflo Public API v3
  description: "The Kiflo API allows you to have control over your integration and create the best experiences.\r\n\r\n***\r\n\r\n## Format\r\n\r\nThe API follows the REST standard using JSON to format requests and responses.  \r\nDecimals are formatted using invariant culture, ie: using \".\" (dot) as a decimal sperator and no thousands separator.  \r\nDates are formatted using ISO standards, in UTC format, including the timezone. Ex:  2015-03-25T12:00:00Z\r\n\r\n***\r\n\r\n## Security\r\n\r\nThe API is secured using an API token.\r\n\r\n**How to generate an API Access Token**  \r\n 1. Open your [account settings page](https://app.kiflo.com/account/integration)\r\n 2. Go to the \"API Access Token\" section\r\n 3. Click \"Add\" button\r\n 4. Choose a name that will be used to identify the token and click \"Add\"\r\n 4. Copy the generate token\r\n   \r\n> **Note:** For security reason, the generated API Access Token won't be visible after you close the settings page. Be sure to copy the generated token otherwise you won't be able to get it later.\r\n  \r\n**How to authenticate on the API**  \r\n  \r\nTo authenticate on the API, send the generated token in the Authorization header using the Bearer scheme:  \r\n`Authorization: Bearer #YOUR_GENERATED_TOKEN_HERE#`\r\n"
  version: v3
servers: []
security: []
paths:
  /v3/customers:
    post:
      tags:
        - Customers
      summary: Create customer
      description: " Create a new customer and optionnaly associate it with an existing partner.  \r\n \r\n **Examples:**  \r\n To associate the customer with the partner ID 42, set the `partnerId` property to be:  \r\n `\"partnerId\": 42`    \r\n  \r\n If the customer comes from your website via a referral link shared by a partner and you want to associate it with the correct partner, use the HTTP header:  \r\n `Kiflo-Tracking-Code: AABBCCDDEEFF+=`  \r\nThe ** tracking code** can be retrieved in javascript from your website using the JS SDK. Please referer to the[JS SDK documentation](https://docs.kiflo.com/category/26-js-sdk)."
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/CustomerCreateRequestDto'
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreateRequestDto'
          text/json:
            schema:
              $ref: '#/components/schemas/CustomerCreateRequestDto'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CustomerCreateRequestDto'
      responses:
        '200':
          description: Customer created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerDto'
        '400':
          description: Invalid request
      security:
        - oauth2:
            - Customer.Create
            - Api
components:
  schemas:
    CustomerCreateRequestDto:
      type: object
      properties:
        properties:
          type: object
          additionalProperties:
            nullable: true
          nullable: true
        partnerId:
          type: integer
          format: int32
          nullable: true
        source:
          $ref: '#/components/schemas/CustomerSource'
        status:
          $ref: '#/components/schemas/CustomerStatus'
      additionalProperties: false
    CustomerDto:
      type: object
      properties:
        id:
          type: integer
          format: int32
        creationDate:
          type: string
          format: date-time
        properties:
          type: object
          additionalProperties:
            nullable: true
          nullable: true
        sourcePartnerId:
          type: integer
          format: int32
          nullable: true
        sourceLeadId:
          type: integer
          format: int32
          nullable: true
        status:
          $ref: '#/components/schemas/CustomerStatus'
        source:
          $ref: '#/components/schemas/CustomerSource'
        isDeleted:
          type: boolean
        deletionDate:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    CustomerSource:
      enum:
        - Unknown
        - OnlineReferral
        - Lead
        - Deal
      type: string
    CustomerStatus:
      enum:
        - Unknown
        - New
        - Paying
        - Canceled
      type: string

````