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

> ## Agent Instructions
> Valora Payments API (Brazil: Pix, card, boleto). Base URL https://api.valorapayments.com.br, Authorization: Bearer sk_vl_... used only on the server. Request amounts are reais as strings ("149.90"); response amounts are integer cents (14990). Use POST /v1/checkouts for card and boleto; POST /v1/payments only creates Pix and should send an Idempotency-Key. Confirm payments only through the payment.succeeded webhook after verifying X-Valora-Signature (hex HMAC-SHA256 of "<t>.<raw body>"), dedupe by event.id and check livemode. Never invent endpoints or fields: check /llms.txt and /openapi.json.

# Criar um cliente

> Salva um cliente para reutilizar em cobranças e checkouts.

Escopo: `customers:write`.



## OpenAPI

````yaml /openapi.json post /v1/customers
openapi: 3.1.0
info:
  title: Valora Payments API
  version: 1.0.0
  description: >-
    API REST da Valora Payments. Valores na entrada em reais (texto, ex.:
    "149.90"); nas respostas, em centavos inteiros.
servers:
  - url: https://api.valorapayments.com.br
    description: Teste e produção (o ambiente vem da chave)
security:
  - bearerAuth: []
tags:
  - name: Pagamentos
  - name: Checkouts
  - name: Clientes
  - name: Produtos
  - name: Saldo
  - name: Webhooks
paths:
  /v1/customers:
    post:
      tags:
        - Clientes
      summary: Criar um cliente
      description: |-
        Salva um cliente para reutilizar em cobranças e checkouts.

        Escopo: `customers:write`.
      operationId: criarCliente
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: Nome (até 120).
                  maxLength: 120
                email:
                  type: string
                  description: E-mail. Único por negócio.
                  format: email
                document:
                  type: string
                  description: CPF (11) ou CNPJ (14 dígitos), só números.
                  pattern: ^(\d{11}|\d{14})$
                phone:
                  type: string
                  description: Telefone, só dígitos (8 a 15), `+` opcional.
                  pattern: ^\+?\d{8,15}$
                external_reference:
                  type: string
                  description: O seu identificador (id do pedido, SKU). Até 100 caracteres.
                  maxLength: 100
                  examples:
                    - pedido-1001
                metadata:
                  type: object
                  additionalProperties:
                    type: string
                    maxLength: 500
                  maxProperties: 20
                  description: >-
                    Até 20 pares chave/valor em texto (chave até 40, valor até
                    500 caracteres). Volta igual nas respostas e nos webhooks.
                  examples:
                    - order_id: '1001'
            examples:
              exemplo:
                summary: Exemplo
                value:
                  name: Ana Souza
                  email: ana@example.com
                  document: '12345678909'
                  phone: '11988887777'
                  external_reference: usuario-42
      responses:
        '201':
          description: Cliente criado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '401':
          description: Chave ausente, inválida ou revogada.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: invalid_api_key
                  message: Chave de API inválida ou revogada.
        '403':
          description: >-
            A chave não tem o escopo da rota, ou a empresa ainda não opera em
            produção.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: missing_scope
                  message: A chave não tem o escopo necessário.
        '409':
          description: Já existe cliente com este e-mail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: email_in_use
                  message: Já existe um cliente com este e-mail.
        '422':
          description: Dados inválidos. Veja `details`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: invalid_request
                  message: Corpo inválido.
                  details:
                    amount:
                      - Valor inválido.
        '429':
          description: Limite de requisições. Veja o header `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: rate_limited
                  message: Muitas requisições. Tente novamente em instantes.
        '503':
          description: Indisponibilidade temporária.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: service_unavailable
                  message: Serviço temporariamente indisponível.
      security:
        - bearerAuth: []
components:
  schemas:
    Customer:
      type: object
      properties:
        id:
          type: string
          description: Id do cliente.
          pattern: ^cus_[A-Za-z0-9_-]{16}$
          examples:
            - cus_Xk2v9QeR7tLmN3bA
        object:
          type: string
          description: Sempre `customer`.
          enum:
            - customer
        name:
          type: string
          description: Nome.
        email:
          type:
            - string
            - 'null'
          description: E-mail.
        document:
          type:
            - string
            - 'null'
          description: CPF ou CNPJ, só dígitos.
        phone:
          type:
            - string
            - 'null'
          description: Telefone, só dígitos.
        external_reference:
          type:
            - string
            - 'null'
          description: O seu identificador.
        metadata:
          type: object
          additionalProperties:
            type: string
            maxLength: 500
          maxProperties: 20
          description: >-
            Até 20 pares chave/valor em texto (chave até 40, valor até 500
            caracteres). Volta igual nas respostas e nos webhooks.
          examples:
            - order_id: '1001'
        created_at:
          type: string
          description: Criação.
          format: date-time
        updated_at:
          type: string
          description: Última alteração.
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              description: Código estável do erro. Veja a página Erros.
              examples:
                - invalid_request
            message:
              type: string
              description: Explicação em português. Não compare o texto.
              examples:
                - Corpo inválido.
            details:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
              description: 'Só em erros de validação: problemas por campo.'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Chave de API `sk_vl_...` criada no painel em Desenvolvedores → Chaves de
        API.

````

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