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

# Create customer

> Creates a new customer.



## OpenAPI

````yaml /openapi.yaml post /v1/customers
openapi: 3.0.3
info:
  title: Quentli REST API
  version: 1.0.0
  description: OpenAPI spec for Quentli REST endpoints.
servers:
  - url: https://api.quentli.com
    description: Production API
  - url: https://api.staging.quentli.com
    description: Staging API for production-like validation
  - url: https://api.demo.quentli.com
    description: Demo API hostname served by staging
security:
  - organizationApiKey: []
tags:
  - name: Auth
  - name: Billing
  - name: Catalog
  - name: Customers
  - name: Invoices
  - name: Payment Methods
  - name: Payment Sessions
  - name: Payments
  - name: Subscriptions
  - name: Tax Invoices
  - name: Webhooks
paths:
  /v1/customers:
    post:
      tags:
        - Customers
      summary: Create customer
      description: Creates a new customer.
      operationId: customers_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerArgs'
      responses:
        '200':
          description: Customer created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCustomerPayload'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
components:
  schemas:
    CreateCustomerArgs:
      type: object
      properties:
        input:
          $ref: '#/components/schemas/CreateCustomerInput'
      required:
        - input
      additionalProperties: false
      description: Request body for creating a customer.
    CreateCustomerPayload:
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/Customer'
      required:
        - customer
      description: Successful customer creation response.
    UserError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
      additionalProperties: false
      description: Standard user-facing error response envelope.
    CreateCustomerInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Name of the customer.
          example: Juan Perez
        username:
          type: string
          nullable: true
          minLength: 1
          description: >-
            Optional username used for login and identification. If omitted and
            auto-increment usernames are enabled, one is generated.
          example: juan_perez_01
        email:
          type: string
          nullable: true
          format: email
          description: Email address of the customer.
          example: juan@example.com
        phoneNumber:
          type: string
          nullable: true
          description: Primary WhatsApp phone number of the customer, preferably E.164.
          example: '+525512345678'
        secondaryPhoneNumber:
          type: string
          nullable: true
          description: Secondary phone number for reminders and announcements.
          example: '+525598765432'
        acceptedServiceAgreement:
          type: boolean
          description: Whether the customer has accepted the service agreement.
          example: true
        skipTaxInvoice:
          type: boolean
          description: Whether tax invoice generation should be skipped for this customer.
          example: false
        assigneeId:
          type: string
          nullable: true
          description: Member id assigned to manage this customer.
          example: cmab12cd3000x1a2b3c4d5e6f
        optedOutWhatsappAt:
          anyOf:
            - type: string
              format: date-time
              description: ISO date-time string
            - type: string
              format: date-time
              description: Date object
          description: Date and time when the customer opted out of WhatsApp reminders.
          example: '2025-01-15T10:30:00.000Z'
        metadata:
          type: array
          items:
            $ref: '#/components/schemas/CreateCustomerMetadataItemInput'
          description: Custom metadata entries attached to the customer.
          example:
            - key: studentId
              value: A-1029
        tags:
          type: array
          items:
            type: string
          description: Tag names to associate with this customer.
          example:
            - VIP
            - Colegiatura
      required:
        - name
      description: Customer creation payload.
    Customer:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the customer.
          example: cus_1234567890abcdefghij
        createdAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: Date and time when the customer was created.
          example: '2025-01-10T12:00:00.000Z'
        updatedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: Date and time when the customer was last updated.
          example: '2025-01-10T12:00:00.000Z'
        name:
          type: string
          description: Name of the customer.
          example: Juan Pérez
        username:
          type: string
          description: Username used for customer login and customer identification.
          example: juan_perez_01
        email:
          type: string
          nullable: true
          description: Email address of the customer.
          example: juan@example.com
        phoneNumber:
          type: string
          nullable: true
          description: >-
            Primary WhatsApp phone number of the customer, usually in E.164
            format.
          example: '+525512345678'
        organizationId:
          type: string
          description: Identifier of the organization this customer belongs to.
          example: org_1234567890abcdefghij
        secondaryPhoneNumber:
          type: string
          nullable: true
          description: Secondary phone number used for reminders and announcements.
          example: null
        archivedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: Date and time when the customer was archived.
          example: null
        archivedById:
          type: string
          nullable: true
          description: Identifier of the user who archived this customer.
          example: u_1234567890abcdefghij
        acceptedServiceAgreement:
          type: boolean
          description: Whether the customer has accepted the service agreement.
          example: true
        skipTaxInvoice:
          type: boolean
          description: Whether tax invoice generation is skipped for this customer.
          example: false
        emailVerified:
          type: boolean
          description: Whether the customer has verified their email address.
          example: false
        phoneNumberVerified:
          type: boolean
          description: Whether the customer has verified their phone number.
          example: true
        hasChangedPassword:
          type: boolean
          description: Whether the customer has set a non-default password.
          example: true
        signatureAcceptedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: >-
            Date and time when recurring charges terms were accepted via
            signature.
          example: '2025-01-10T12:00:00.000Z'
        optedOutWhatsappAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: Date and time when the customer opted out of WhatsApp reminders.
          example: null
        optedInWhatsappAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: Date and time when the customer opted in to WhatsApp reminders.
          example: '2025-01-05T10:00:00.000Z'
        startedWhatsappAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: >-
            Date and time when WhatsApp opt-in flow was started for this
            customer.
          example: '2025-01-05T09:55:00.000Z'
        replyWithAssistant:
          type: boolean
          nullable: true
          description: Whether to reply to this customer using the assistant.
          example: false
        metadata:
          type: array
          nullable: true
          items:
            type: object
            properties:
              key:
                type: string
              value:
                type: string
            required:
              - key
              - value
            additionalProperties: false
          description: >-
            Custom metadata entries attached to this customer as key-value
            pairs.
          example:
            - key: studentId
              value: A-1029
        meta:
          type: object
          nullable: true
          additionalProperties:
            type: string
          description: Flattened metadata map where each key maps to a string value.
          example:
            studentId: A-1029
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - username
        - organizationId
        - acceptedServiceAgreement
        - skipTaxInvoice
        - emailVerified
        - phoneNumberVerified
        - hasChangedPassword
      description: >-
        Customer record including identity, contact details, and messaging
        preferences.
    CreateCustomerMetadataItemInput:
      type: object
      properties:
        key:
          type: string
          minLength: 1
          description: Metadata key name.
          example: studentId
        value:
          type: string
          minLength: 1
          description: Metadata value.
          example: A-1029
      required:
        - key
        - value
      description: Custom metadata key-value pair attached to the customer.
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: 'Organization API key using `Authorization: Bearer sk_...`.'

````