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

# Criar Cliente

> Registra um cliente associado ao negócio autenticado. Pelo menos um campo de identificação (`email`, `phone_number` ou `document_number`) é recomendado.



## OpenAPI

````yaml POST /v1/customers
openapi: 3.1.0
info:
  title: Valora Payment Gateway
  description: >-
    Gateway de pagamentos brasileiro com suporte a PIX e cripto (USDT/USDC/EURC
    na rede Solana).


    ## Autenticação

    Todas as rotas exigem o header `x-api-key` com sua chave de API.


    ## Convenção de valores

    - **Request**: valores em **centavos** (inteiro). Ex: `5000` = R$50,00

    - **Response**: valores em **BRL** (float). Ex: `50.0` = R$50,00


    ## Formato de erro

    Todos os erros retornam `{ "error": { "code": "ERROR_CODE", "message": "..."
    } }`
  version: 1.0.0
  contact:
    name: Suporte Valora
    url: https://valorapayments.com.br
servers:
  - url: https://api.valorapayments.com.br
    description: Produção
  - url: https://sandbox.api.valorapayments.com.br
    description: Sandbox
security:
  - ApiKey: []
paths:
  /v1/customers:
    post:
      tags:
        - Clientes
      summary: Criar cliente
      description: >-
        Registra um cliente associado ao negócio autenticado. Pelo menos um
        campo de identificação (`email`, `phone_number` ou `document_number`) é
        recomendado.
      operationId: createCustomer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreateRequest'
            example:
              email: cliente@exemplo.com.br
              phone_number: '11999990000'
              document_number: '12345678901'
      responses:
        '201':
          description: Cliente criado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerObject'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CustomerCreateRequest:
      type: object
      description: Pelo menos um campo de identificação é recomendado
      properties:
        email:
          type: string
          format: email
          example: cliente@exemplo.com.br
        phone_number:
          type: string
          description: Telefone com DDD, sem formatação
          example: '11999990000'
        document_number:
          type: string
          description: CPF ou CNPJ sem formatação
          example: '12345678901'
        ip:
          type: string
          format: ipv4
          description: IP do cliente para antifraude
        metadata:
          type: string
          description: JSON serializado com dados extras
    CustomerObject:
      type: object
      properties:
        customer_id:
          type: string
          example: cust_a1b2c3d4
        business_id:
          type: string
        email:
          type: string
          nullable: true
        phone_number:
          type: string
          nullable: true
        document_number:
          type: string
          nullable: true
        ip:
          type: string
          nullable: true
        metadata:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Código de erro em SNAKE_UPPER_CASE
              example: NOT_FOUND
            message:
              type: string
              description: Descrição legível do erro
              example: Pagamento não encontrado.
  responses:
    InternalError:
      description: Erro interno do servidor
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INTERNAL_ERROR
              message: Ocorreu um erro interno. Por favor, tente novamente.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Chave de API gerada no painel Valora. Envie em todas as requisições.

````