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

# Create Customer

> Create a new customer. Either email or phoneNumber is required.



## OpenAPI

````yaml POST /customers
openapi: 3.1.0
info:
  title: bitbybit Open API
  description: >-
    The bitbybit Open API provides programmatic access to your bitbybit data
    including customers, orders, and products.
  version: 1.0.0
  contact:
    name: bitbybit Support
    url: https://bitbybit.studio
servers:
  - url: https://api.bitbybit.studio/customer/api/open/v1
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /customers:
    post:
      tags:
        - Customers
      summary: Create a customer
      description: Create a new customer. Either email or phoneNumber is required.
      operationId: createCustomer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                phoneNumber:
                  type: string
                firstName:
                  type: string
                lastName:
                  type: string
                imageUrl:
                  type: string
                tags:
                  type: array
                  items:
                    type: string
                addresses:
                  type: array
                  items:
                    $ref: '#/components/schemas/AddressInput'
      responses:
        '201':
          description: Customer created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Customer'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    AddressInput:
      type: object
      required:
        - address1
      properties:
        firstName:
          type: string
        lastName:
          type: string
        phone:
          type: string
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        province:
          type: string
        country:
          type: string
        zip:
          type: string
        mainAddress:
          type: boolean
          default: false
    Customer:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
          nullable: true
        phoneNumber:
          type: string
          nullable: true
        firstName:
          type: string
          nullable: true
        lastName:
          type: string
          nullable: true
        imageUrl:
          type: string
          nullable: true
        tags:
          type: array
          items:
            type: string
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Address:
      type: object
      properties:
        id:
          type: string
        firstName:
          type: string
          nullable: true
        lastName:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        address1:
          type: string
          nullable: true
        address2:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        province:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        zip:
          type: string
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: VALIDATION_ERROR
              message: Invalid request body
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_API_KEY
              message: Invalid or expired API key
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Create one in Settings > Developer.

````