> ## Documentation Index
> Fetch the complete documentation index at: https://developer.pagou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Retries and Reconciliation

> Recover safely from webhook redelivery, worker failures, or uncertain payment and payout state.

Use this page when your webhook pipeline is reliable most of the time but still needs a safe recovery path.

## Recovery rules

* Deduplicate by webhook event ID.
* Make downstream side effects idempotent.
* Reconcile with `GET` when the result of processing is unclear.
* Replay your processing step from the stored payload and fresh API state instead of repeating side effects blindly.

## Example reconciliation request

```bash theme={null}
curl --request GET \
  --url https://api.pagou.ai/v2/transactions/018f1f2e-7b42-7c9a-8d3e-1a2b3c4d5e6f \
  --header "Authorization: Bearer YOUR_TOKEN"
```

## Example response

```json theme={null}
{
  "success": true,
  "requestId": "0190a2b4-18a7-7de0-9a43-69b7cf261201",
  "data": {
    "id": "018f1f2e-7b42-7c9a-8d3e-1a2b3c4d5e6f",
    "status": "paid",
    "updated_at": "2026-03-16T14:03:10.000Z"
  }
}
```

## Common error

```json theme={null}
{
  "type": "https://api.pagou.ai/problems/not-found",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "The requested transaction does not exist."
}
```

Fix: verify the resource mapping you stored from the original create response or webhook payload before retrying recovery.

## Practical workflow

1. Persist the raw webhook payload.
2. Acknowledge quickly.
3. Process asynchronously.
4. If processing fails after acknowledgement, retrieve the latest resource state.
5. Recompute the next safe business transition from that fresh state.
