> ## 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.

# Atualizar um cliente

> Atualiza só os campos enviados. `null` limpa um campo opcional.

Escopo: `customers:write`.



## OpenAPI

````yaml /openapi.json patch /v1/customers/{customer_id}
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/{customer_id}:
    patch:
      tags:
        - Clientes
      summary: Atualizar um cliente
      description: |-
        Atualiza só os campos enviados. `null` limpa um campo opcional.

        Escopo: `customers:write`.
      operationId: atualizarCliente
      parameters:
        - name: customer_id
          in: path
          required: true
          description: Id do cliente.
          schema:
            type: string
            pattern: ^cus_[A-Za-z0-9_-]{16}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name:
                  type: string
                  description: Nome.
                  maxLength: 120
                email:
                  type:
                    - string
                    - 'null'
                  description: E-mail.
                  format: email
                document:
                  type:
                    - string
                    - 'null'
                  description: CPF ou CNPJ, só dígitos.
                  pattern: ^(\d{11}|\d{14})$
                phone:
                  type:
                    - string
                    - 'null'
                  description: Telefone, só dígitos.
                  pattern: ^\+?\d{8,15}$
                external_reference:
                  type:
                    - string
                    - 'null'
                  description: O seu identificador.
                  maxLength: 100
                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:
                  phone: '11977776666'
      responses:
        '200':
          description: Cliente atualizado.
          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.
        '404':
          description: Não encontrado para este negócio.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: not_found
                  message: Não encontrado.
        '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.
      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.