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

# Criar um cliente

> Creates a new client for the authenticated user's company. The companyId is automatically set from the authenticated user context.



## OpenAPI

````yaml POST /client
openapi: 3.0.0
info:
  title: payera-api
  description: Documentação de endpoints e entidades da payera
  version: '1.0'
  contact: {}
servers:
  - url: https://api.rivoopay.com
security:
  - ApiKeyAuth: []
paths:
  /client:
    post:
      tags:
        - Clients
      summary: Create a new client
      description: >-
        Creates a new client for the authenticated user's company. The companyId
        is automatically set from the authenticated user context.
      operationId: ClientController_createClient
      requestBody:
        required: true
        description: Client data to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClientWithoutCompanyIdDTO'
      responses:
        '201':
          description: Client created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientDTO'
        '400':
          description: Bad Request - Invalid client data
        '401':
          description: Unauthorized - Invalid or missing authentication token
components:
  schemas:
    CreateClientWithoutCompanyIdDTO:
      type: object
      properties:
        name:
          type: string
          example: Cliente Bola
          description: Client full name
          maxLength: 255
        status:
          type: string
          example: ACTIVE
          description: Client status
          enum:
            - ACTIVE
            - INACTIVE
          default: ACTIVE
        taxId:
          type: string
          example: '05305405364'
          description: >-
            Client tax ID (CPF/CNPJ). Will be automatically formatted to remove
            non-numeric characters
          pattern: ^[0-9]{11,14}$
        email:
          type: string
          example: bola@email.com
          description: Client email address
          format: email
        phone:
          type: string
          example: '41999999999'
          description: Client phone number (Brazilian format)
          pattern: ^[0-9]{10,11}$
        address:
          type: string
          example: Rua Engenheiros Rebouças
          description: Client street address
          nullable: true
        district:
          type: string
          example: Rebouças
          description: District/neighborhood
          nullable: true
        number:
          type: string
          example: '2000'
          description: Street number
          nullable: true
        postalCode:
          type: string
          example: '80215100'
          description: Client postal code (CEP)
          pattern: ^[0-9]{8}$
          nullable: true
        line1:
          type: string
          example: Green apartment
          description: Address complement (line 1)
          nullable: true
      required:
        - name
        - status
        - taxId
        - email
        - phone
    ClientDTO:
      type: object
      properties:
        id:
          type: string
          example: clnt_clx1234567890abcdef
          description: 'Client unique identifier (format: clnt_{cuid2})'
        taxId:
          type: string
          example: 053.054.053-64
          description: Client tax ID (CPF/CNPJ) - formatted
          pattern: ^[0-9]{11,14}$
        name:
          type: string
          example: Cliente Bola
          description: Client full name
          maxLength: 255
        email:
          type: string
          example: bola@email.com
          description: Client email address
          format: email
        phone:
          type: string
          example: '41999999999'
          description: Client phone number (Brazilian format)
          pattern: ^[0-9]{10,11}$
        status:
          type: string
          example: ACTIVE
          description: Client status
          enum:
            - ACTIVE
            - INACTIVE
          default: ACTIVE
        companyId:
          type: string
          example: comp_clx9876543210fedcba
          description: 'Company ID that owns this client (format: comp_{cuid2})'
        postalCode:
          type: object
          example: '80215100'
          description: Client postal code (CEP)
          pattern: ^[0-9]{8}$
          nullable: true
        address:
          type: object
          example: Rua Engenheiros Rebouças
          description: Client street address
          nullable: true
        district:
          type: object
          example: Rebouças
          description: District/neighborhood
          nullable: true
        number:
          type: object
          example: '2000'
          description: Street number
          nullable: true
        line1:
          type: object
          example: Green apartment
          description: Address complement (line 1)
          nullable: true
        createdAt:
          format: date-time
          type: string
          example: '2025-02-03T10:00:00Z'
          description: Client creation timestamp
        updatedAt:
          format: date-time
          type: string
          example: '2025-02-03T10:00:00Z'
          description: Client last update timestamp
      required:
        - id
        - taxId
        - name
        - email
        - phone
        - status
        - companyId
        - createdAt
        - updatedAt
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````