Skip to main content

Overview

Webhooks let you receive automatic HTTP notifications when important events happen on your account, such as confirmed payments, processed refunds, or completed withdrawals.

Available Events

Payload Structure

All webhooks follow the same base structure:

Sub-accounts

When the event belongs to a sub-account, the subAccount field carries its reference:
If the sub-account has no webhook endpoint of its own, its events are delivered to the main account’s endpoints. That is why subAccount is essential: it is the field that tells you which wallet the event belongs to.Always use it to credit the event to the right wallet — never assume that every event received on the main account’s endpoint belongs to the main account.

Headers Sent

Every webhook request includes the following headers:

Validating the Signature

Every webhook is signed with HMAC-SHA256 using your endpoint’s secret (shown only once at creation). Follow these steps to validate it:
  1. Compute the HMAC-SHA256 of the raw request body using your secret as the key
  2. Prefix the hex result with sha256=
  3. Compare it with the X-Pague-Signature header using a constant-time comparison
Node.js (crypto)
Always use a constant-time comparison (timingSafeEqual) to prevent timing attacks. Never compare signatures with ===.

Payload Examples

payment_completed

Sent when a PIX payment is confirmed.
The split in the webhook is what was actually distributed, not what you asked for when creating the charge. The two diverge when the account’s fee changes between the charge and the payment: the net amount shrinks and the legs are reduced in the order they were sent, instead of the settlement failing.To reconcile against the wallet statement, always use the value that comes in the webhook — never the one you sent in the request. The field only appears when there was a split; a charge without one does not get the key.

payment_expired

Sent when a PIX payment expires without confirmation.

refund_completed

Sent when a refund is processed.
netAmount convention for refunds: it represents what the event’s recipient (the end customer) actually receives — that is, the full refund amount. The refund fee is debited separately from the merchant’s balance. The total cost of the refund to the merchant is amount + feeAmount.

withdrawal_completed

Sent when a withdrawal is successfully processed.

withdrawal_failed

Sent when a withdrawal is rejected or fails.

withdrawal_reversed

Sent when a withdrawal is reversed by the PSP.

balance_block_created

Sent when a balance block is created (MED, judicial, or administrative).

balance_block_approved

Sent when a balance block is approved and the amount is returned to the original payer.

balance_block_rejected

Sent when a balance block is rejected and the amount returns to the merchant’s available balance.

Best Practices

Return a 200 OK status as fast as possible. Process the webhook asynchronously if needed.
Use the eventId to avoid processing the same event twice. Webhooks may be redelivered on failure.
Configure your endpoint with HTTPS only to keep the data secure.

Retries

If your endpoint does not respond with a 2xx status, we will retry the delivery:
  • 5 attempts with exponential backoff
  • Initial interval: 2 seconds
  • Maximum interval: ~30 seconds between attempts
After 5 unsuccessful attempts, the webhook is marked as failed.