- Near real-time updates
- Decoupled integrations
- Reliable reconciliation and operational traceability
Prerequisites
Before configuring webhooks, ensure you have:
- The Pix Indirect Plugin configured and running (see Indirect Pix via BTG)
- An HTTPS endpoint ready to receive webhook requests
- Basic understanding of Pix event lifecycle and transaction flows
Why webhooks matter in Pix
Pix is an asynchronous, multi-party system. Even when an API request succeeds, the final state of a transaction is only confirmed later, after settlement and counterparty acknowledgment. Webhooks allow your system to:
- Track authoritative transaction status
- React to refunds, reversals, and MED events
- Maintain ledger and operational consistency
- Reduce polling and operational overhead
Event types
You receive events grouped by flow and entity, aligned with BACEN (Banco Central do Brasil) domains.
| Flow | Entity | Description |
|---|---|---|
| DICT | CLAIM | Pix key portability and ownership claim events |
| DICT | INFRACTION_REPORT | MED (Mecanismo Especial de Devolução) infraction reports and dispute lifecycle |
| DICT | REFUND | MED refund request events |
| TRANSFER | CASHIN | Incoming Pix payment status updates |
| TRANSFER | CASHOUT | Outgoing Pix payment status updates |
| REFUND | CASHIN | Incoming Pix refund status updates |
| REFUND | CASHOUT | Outgoing Pix refund status updates |
DICT (Diretório de Identificadores de Contas Transacionais) is the BACEN directory that manages Pix keys and related operations like claims, infractions, and refunds.
Webhook configuration
You enable webhooks by configuring destination URLs and selecting which event types your system should receive.
Environment variables
You can configure webhook endpoints at entity, flow, or global level.| Flow | Entity | Entity URL | Module URL |
|---|---|---|---|
| DICT | CLAIM | WEBHOOK_DICT_CLAIM_URL | WEBHOOK_DICT_URL |
| DICT | INFRACTION_REPORT | WEBHOOK_DICT_INFRACTION_REPORT_URL | WEBHOOK_DICT_URL |
| DICT | REFUND | WEBHOOK_DICT_REFUND_URL | WEBHOOK_DICT_URL |
| TRANSFER | CASHIN | WEBHOOK_TRANSFER_CASHIN_URL | WEBHOOK_TRANSFER_URL |
| TRANSFER | CASHOUT | WEBHOOK_TRANSFER_CASHOUT_URL | WEBHOOK_TRANSFER_URL |
| REFUND | CASHIN | WEBHOOK_REFUND_CASHIN_URL | WEBHOOK_REFUND_URL |
| REFUND | CASHOUT | WEBHOOK_REFUND_CASHOUT_URL | WEBHOOK_REFUND_URL |
URL resolution priority
When multiple URLs are configured, the system resolves them in the following order:-
Entity-level URL
Example:
WEBHOOK_DICT_CLAIM_URL -
Flow-level URL
Example:
WEBHOOK_DICT_URL -
Default URL
WEBHOOK_DEFAULT_URL
Request format
Headers
Every webhook request includes standardized headers for traceability and security.| Header | Description |
|---|---|
Content-Type | application/json |
X-Request-ID | Unique request identifier |
X-Entity-Type | Event entity (e.g. INFRACTION_REPORT) |
X-Flow-Type | Source domain (e.g. DICT) |
Idempotency-Key | Unique event identifier for deduplication |
Body structure
| Field | Description |
|---|---|
entityType | Event entity |
flowType | Pix domain |
payload | Event-specific data |
Responses and retry behavior
Expected response
Your endpoint must return an HTTP 2xx status to confirm successful delivery.| Response | Result |
|---|---|
| 2xx | Delivered successfully |
| Non-2xx | Retried automatically |
Retry strategy
Failed deliveries are retried automatically using exponential backoff:| Attempt | Delay |
|---|---|
| 1 | 1 second |
| 2 | 2 seconds |
| 3 | 4 seconds |
- Max retries: 3
- Timeout per request: 30 seconds
Custom retry settings
Retries and timeouts can be customized per event:Circuit breaker protection
To prevent cascading failures, webhook delivery is protected by a circuit breaker. When the Pix Plugin detects repeated delivery failures (typically consecutive5xx responses or timeouts), it temporarily pauses webhook calls to the affected endpoint.
After a configurable cooldown period, the system performs controlled retry attempts to check if the endpoint has recovered.
Once successful responses are detected, normal delivery is automatically resumed.
This mechanism ensures:
- Protection against overloaded or unstable endpoints
- Graceful recovery without manual intervention
- Higher overall system stability in production environments
Circuit breaker behavior works alongside retries and exponential backoff, adding an extra safety layer for webhook delivery.
Best practices
| Practice | Why it matters |
|---|---|
| Ignore unknown fields | Remain forward-compatible as new fields are added |
| Idempotent processing | Use Idempotency-Key to avoid processing duplicates |
| Fast acknowledgment | Return 202 Accepted and process asynchronously |
| Async processing | Avoid blocking the webhook thread |
| Handle compression | Payloads >1KB are gzip-compressed. Check the Content-Encoding header and decompress accordingly |
Event examples
Below are representative examples of webhook payloads you receive from the Pix Indirect Plugin.
DICT claim
Ownership or portability lifecycle events. Use these to track Pix key disputes across institutions.DICT infraction report (MED)
Dispute and fraud signaling events aligned with BACEN MED rules.DICT refund (MED)
Refund requests and decisions related to MED cases.Transfer cash-in and cash-out
Incoming and outgoing Pix transfer events. Cash-in (incoming transfer):Refund cash-in and cash-out
Refund settlement events for Pix transactions. Refund cash-in (receiving a refund):Key takeaway
Webhooks are not optional in Pix Indirect operations. They are the authoritative channel for transaction state, refunds, and dispute handling. A correct webhook implementation ensures:
- Accurate reconciliation
- Regulatory compliance
- Operational resilience
- Predictable customer experience
Next steps
Now that you understand how webhooks work in Indirect Pix, explore these related topics:
- Indirect Pix via BTG - Initial setup and configuration
- Pix main domains: transfers - Deep dive into transfer operations
- Pix main domains: DICT - Understanding DICT operations and key management
- Pix main domains: MED - MED dispute and refund handling

