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

# Consultar um checkout

> Devolve a compra com o status atual. A confirmação do pagamento continua chegando pelo webhook.

Escopo: `checkouts:read`.



## OpenAPI

````yaml /openapi.json get /v1/checkouts/{session_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/checkouts/{session_id}:
    get:
      tags:
        - Checkouts
      summary: Consultar um checkout
      description: >-
        Devolve a compra com o status atual. A confirmação do pagamento continua
        chegando pelo webhook.


        Escopo: `checkouts:read`.
      operationId: consultarCheckout
      parameters:
        - name: session_id
          in: path
          required: true
          description: Id da compra.
          schema:
            type: string
            pattern: ^cs_[A-Za-z0-9_-]{16}$
      responses:
        '200':
          description: A compra.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSession'
        '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.
        '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:
    CheckoutSession:
      type: object
      properties:
        id:
          type: string
          description: Id da compra.
          pattern: ^cs_[A-Za-z0-9_-]{16}$
          examples:
            - cs_Xk2v9QeR7tLmN3bA
        object:
          type: string
          description: Sempre `checkout_session`.
          enum:
            - checkout_session
        status:
          type: string
          description: >-
            `open`: aguardando; `processing`: em análise; `paid`: pago;
            `failed`: tentativa falhou; `expired`: venceu.
          enum:
            - open
            - processing
            - paid
            - failed
            - expired
        livemode:
          type: boolean
          description: Ambiente da compra.
        checkout_url:
          type: string
          description: Link para mandar ao cliente.
          format: uri
          examples:
            - https://pay.valorapayments.com.br/s/cs_Xk2v9QeR7tLmN3bA
        product_cart:
          type: array
          items:
            type: object
            properties:
              product_id:
                type: string
                description: Produto.
              name:
                type: string
                description: Nome no momento da compra.
              quantity:
                type: integer
                description: Quantidade.
              unit_amount:
                type: integer
                description: Preço unitário em centavos.
        amount:
          type: object
          properties:
            subtotal:
              type: integer
              description: Subtotal em centavos.
            total:
              type: integer
              description: Total em centavos.
            currency:
              type: string
              description: Moeda.
              enum:
                - BRL
        allowed_payment_method_types:
          type: array
          items:
            type: string
            enum:
              - pix
              - card
              - boleto
          description: Formas aceitas.
        customer_id:
          type:
            - string
            - 'null'
          description: Cliente associado.
        payment_id:
          type:
            - string
            - 'null'
          description: Pagamento gerado quando o cliente escolhe a forma de pagamento.
        method:
          type:
            - string
            - 'null'
          description: Forma escolhida pelo cliente.
          enum:
            - pix
            - card
            - boleto
        success_url:
          type:
            - string
            - 'null'
          description: Retorno depois de pagar.
        cancel_url:
          type:
            - string
            - 'null'
          description: Retorno ao desistir.
        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'
        expires_at:
          type: string
          description: Prazo da compra.
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          description: Quando foi paga.
          format: date-time
        created_at:
          type: string
          description: Criaçã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.