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

# Crear cliente

> Crea un cliente. Formato de respuesta heredado `{ success, data, message }`.

**Permiso requerido:** `customers`



## OpenAPI

````yaml /api-reference/openapi.json post /customers
openapi: 3.0.3
info:
  title: FileXpress API Externa
  version: 1.0.0
  description: >-
    API para integrar sistemas de terceros con FileXpress: facturación, RRHH y
    contabilidad.
servers:
  - url: https://api.filexpress.app/api/external
    description: Producción
security:
  - ApiKey: []
tags:
  - name: General
  - name: Facturación · Ventas
  - name: Facturación · Compras
  - name: Facturación · Clientes
  - name: Facturación · Proveedores
  - name: Facturación · Productos
  - name: Catálogos
  - name: RRHH · Empleados
  - name: RRHH · Asistencia
  - name: RRHH · Permisos
  - name: RRHH · Planillas
  - name: Contabilidad
paths:
  /customers:
    post:
      tags:
        - Facturación · Clientes
      summary: Crear cliente
      description: >-
        Crea un cliente. Formato de respuesta heredado `{ success, data, message
        }`.


        **Permiso requerido:** `customers`
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerRequest'
            example:
              customer_name: Juan Pérez
              legal_name: Juan Antonio Pérez García
              register_number: 12345-6
              tax_number: 0614-000101-000-0
              document_type: '13'
              document_number: 00000000-0
              address: 'Col. San Benito, Av. La Revolución #123'
              country_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
              state_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
              city_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
              activity_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
              phone: 7777-1234
              email: juan@example.com
              business_type: natural
              branch_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
      responses:
        '200':
          description: Cliente creado
          content:
            application/json:
              example:
                success: true
                data:
                  id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
                  customer_name: Juan Pérez
                  legal_name: Juan Antonio Pérez García
                  register_number: 12345-6
                  tax_number: 0614-000101-000-0
                  document_type: '13'
                  document_number: 00000000-0
                  address: 'Col. San Benito, Av. La Revolución #123'
                  country_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
                  state_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
                  city_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
                  activity_id: 9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11
                  phone: 7777-1234
                  email: juan@example.com
                  business_type: natural
                message: Data retrieved successfully.
        '401':
          $ref: '#/components/responses/E401'
        '403':
          $ref: '#/components/responses/E403'
        '404':
          $ref: '#/components/responses/ELegacyValidation'
        '429':
          $ref: '#/components/responses/E429'
components:
  schemas:
    CustomerRequest:
      type: object
      properties:
        customer_name:
          type: string
        legal_name:
          type: string
        register_number:
          type: string
          description: NRC.
        tax_number:
          type: string
          description: NIT.
        document_type:
          type: string
          description: Código de tipo de documento (13 = DUI, 36 = NIT...).
        document_number:
          type: string
        address:
          type: string
        country_id:
          type: string
          format: uuid
        state_id:
          type: string
          format: uuid
        city_id:
          type: string
          format: uuid
        activity_id:
          type: string
          format: uuid
        phone:
          type: string
        email:
          type: string
        business_type:
          type: string
          description: Tipo de cliente.
          enum:
            - non-business
            - natural
            - legal
        branch_id:
          type: string
          format: uuid
      required:
        - customer_name
        - address
        - country_id
        - state_id
        - city_id
        - phone
        - email
        - business_type
        - branch_id
  responses:
    E401:
      description: API Key ausente o inválida
      content:
        application/json:
          example:
            status: false
            message: Invalid API Key.
    E403:
      description: Integración sin el permiso requerido o desactivada
      content:
        application/json:
          example:
            status: false
            message: This integration does not have the 'hr.employees' permission.
            required_scope: hr.employees
    ELegacyValidation:
      description: 'Error de validación (formato heredado: responde 404)'
      content:
        application/json:
          example:
            success: false
            message: Validation Error.
            data:
              email:
                - The email field is required.
    E429:
      description: Límite de peticiones excedido
      content:
        application/json:
          example:
            status: false
            message: Rate limit exceeded. Please try again later.
            rate_limit: 100
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key de la integración (Integraciones → Nueva Integración).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.