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

# Consultar entrega

> Consulta uma entrega e suas tentativas

Retorna a entrega, o payload enviado, a última resposta recebida e o histórico de tentativas. Use esta rota para diagnosticar uma falha antes de solicitar o reenvio.

## Autenticação

Todas as rotas exigem `X-API-Key` com uma chave que começa com `zeriq_`.

```bash cURL theme={null}
curl "https://api.zeriqpay.com.br/v1/webhooks/deliveries/cmid_delivery" \
  -H "X-API-Key: zeriq_sua_chave"

```

## Escopos necessários

* Listagem e consulta: `webhooks.read`
* Reenvio individual ou em lote: `webhooks.retry`

## Boas práticas

* Responda rapidamente ao webhook original e processe o evento de forma idempotente.
* Consulte os detalhes da entrega antes de reenviar quando a causa da falha não estiver clara.
* Use `Idempotency-Key` em reenvios manuais e persista o resultado retornado.
* Reenvie somente depois de corrigir a causa da falha no seu endpoint.

## Referência

* **Método:** `GET`
* **Rota:** `/v1/webhooks/deliveries/{deliveryId}`
* **Autenticação:** `X-API-Key`

## Exemplo de resposta

```json theme={null}
{
  "success": true,
  "data": {
    "delivery": {
      "id": "cmid_delivery",
      "endpointId": "cmid_webhook",
      "userId": "cmid_user",
      "transactionId": "cmid_transaction",
      "event": "payment.failed",
      "status": "FAILED",
      "payload": {
        "id": "evt_123",
        "event": "payment.failed",
        "createdAt": "2026-10-28T12:00:00.000Z",
        "data": {}
      },
      "response": {
        "status": 500,
        "body": "upstream error",
        "error": "HTTP 500"
      },
      "attempts": 3,
      "lastAttemptAt": "2026-10-28T12:02:00.000Z",
      "lastResponseStatus": 500,
      "lastResponseBody": "upstream error",
      "lastError": "HTTP 500",
      "deliveredAt": null,
      "replayedFromDeliveryId": null,
      "replayReason": null,
      "createdAt": "2026-10-28T12:00:00.000Z",
      "updatedAt": "2026-10-28T12:02:00.000Z",
      "endpoint": {
        "id": "cmid_webhook",
        "name": "Pagamentos",
        "url": "https://app.exemplo.com/webhooks/zeriqpay",
        "active": true
      }
    },
    "payload": {
      "id": "evt_123",
      "event": "payment.failed",
      "createdAt": "2026-10-28T12:00:00.000Z",
      "data": {}
    },
    "response": {
      "status": 500,
      "body": "upstream error",
      "error": "HTTP 500"
    },
    "attempts": [
      {
        "id": "cmid_attempt",
        "attemptNumber": 1,
        "responseStatus": 500,
        "responseBody": "upstream error",
        "error": "HTTP 500",
        "startedAt": "2026-10-28T12:00:01.000Z",
        "finishedAt": "2026-10-28T12:00:02.000Z"
      }
    ]
  }
}
```

## Respostas

A operação de listagem retorna `items` e `pagination`. A consulta detalhada também retorna `payload`, `response` e `attempts`. As rotas de reenvio respondem com HTTP `202` porque a entrega é colocada em fila para processamento assíncrono.

A referência OpenAPI abaixo contém parâmetros, exemplos de request e response e códigos de erro.


## OpenAPI

````yaml GET /v1/webhooks/deliveries/{deliveryId}
openapi: 3.1.0
info:
  title: ZeriqPay API
  description: >-
    Referência da API v1 da ZeriqPay. As rotas de gerenciamento de webhooks não
    fazem parte desta documentação.
  version: 1.0.0
  contact:
    name: ZeriqPay
    url: https://api.zeriqpay.com.br
servers:
  - url: https://api.zeriqpay.com.br
    description: Produção
security:
  - apiKeyAuth: []
tags:
  - name: Conta
    description: Dados, taxas e limites da conta
  - name: Pagamentos PIX
    description: Cobranças PIX
  - name: Transações
    description: Consulta de transações
  - name: Transferências
    description: Saídas PIX, cripto e internas
  - name: Reembolsos
    description: Reembolsos de cobranças
  - name: Disputas MED
    description: Consulta e envio de evidências MED
  - name: Webhooks
    description: Cadastro e configuração dos endpoints de webhook
paths:
  /v1/webhooks/deliveries/{deliveryId}:
    get:
      tags:
        - Webhooks
      summary: Consultar entrega
      description: >-
        Retorna detalhes, payload, resposta e tentativas. **Escopo necessário:**
        `webhooks.read`.
      operationId: getWebhookDelivery
      parameters:
        - name: deliveryId
          in: path
          required: true
          description: ID da entrega.
          schema:
            type: string
      responses:
        '200':
          description: Detalhes da entrega.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDeliveryDetailResponse'
              example:
                success: true
                data:
                  delivery:
                    id: cmid_delivery
                    endpointId: cmid_webhook
                    userId: cmid_user
                    transactionId: cmid_transaction
                    event: payment.failed
                    status: FAILED
                    payload:
                      id: evt_123
                      event: payment.failed
                      createdAt: '2026-10-28T12:00:00.000Z'
                      data: {}
                    response:
                      status: 500
                      body: upstream error
                      error: HTTP 500
                    attempts: 3
                    lastAttemptAt: '2026-10-28T12:02:00.000Z'
                    lastResponseStatus: 500
                    lastResponseBody: upstream error
                    lastError: HTTP 500
                    deliveredAt: null
                    replayedFromDeliveryId: null
                    replayReason: null
                    createdAt: '2026-10-28T12:00:00.000Z'
                    updatedAt: '2026-10-28T12:02:00.000Z'
                    endpoint:
                      id: cmid_webhook
                      name: Pagamentos
                      url: https://app.exemplo.com/webhooks/zeriqpay
                      active: true
                  payload:
                    id: evt_123
                    event: payment.failed
                    createdAt: '2026-10-28T12:00:00.000Z'
                    data: {}
                  response:
                    status: 500
                    body: upstream error
                    error: HTTP 500
                  attempts:
                    - id: cmid_attempt
                      attemptNumber: 1
                      responseStatus: 500
                      responseBody: upstream error
                      error: HTTP 500
                      startedAt: '2026-10-28T12:00:01.000Z'
                      finishedAt: '2026-10-28T12:00:02.000Z'
        '401':
          description: API Key ausente ou inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
        '403':
          description: Escopo insuficiente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
        '404':
          description: Entrega ou endpoint não encontrado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
        '429':
          description: Limite da rota excedido
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    WebhookDeliveryDetailResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            delivery:
              $ref: '#/components/schemas/WebhookDelivery'
            payload:
              type: object
            response:
              type: object
            attempts:
              type: array
              items:
                type: object
    GenericResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          additionalProperties: true
      required:
        - success
    WebhookDelivery:
      type: object
      properties:
        id:
          type: string
        endpointId:
          type: string
        userId:
          type: string
        transactionId:
          type: string
          nullable: true
        event:
          type: string
        status:
          type: string
          enum:
            - PENDING
            - DELIVERED
            - FAILED
        payload:
          type: object
        response:
          type: object
          properties:
            status:
              type: integer
              nullable: true
            body:
              type: string
              nullable: true
            error:
              type: string
              nullable: true
        attempts:
          type: integer
        lastAttemptAt:
          type: string
          format: date-time
          nullable: true
        lastResponseStatus:
          type: integer
          nullable: true
        lastResponseBody:
          type: string
          nullable: true
        lastError:
          type: string
          nullable: true
        deliveredAt:
          type: string
          format: date-time
          nullable: true
        replayedFromDeliveryId:
          type: string
          nullable: true
        replayReason:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        endpoint:
          type: object
          nullable: true
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key ZeriqPay iniciada por `zeriq_`.

````

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