Webhook setup
To receive Pix webhooks, your system must:- Expose a public HTTPS endpoint.
- Respond with status
200 OK
within 5 seconds. - Validate and process the event payload.
- Optionally verify the webhook signature (recommended)
If your endpoint doesn’t respond with
200
, we’ll retry the webhook automatically using exponential backoff with a TTL of 24 hours.Webhook types
Here are the main webhooks you might receive:pix.transaction.status
Sent whenever a Pix transaction’s status changes, typically from pending to confirmed or failed.
Field | Description |
---|---|
type | Event type (pix.transaction.status ) |
transactionId | Your transaction identifier. |
status | pending , confirmed , failed , or reversed |
amount | Transaction amount. |
updatedAt | Time of final status confirmation. |
Use this webhook to update your UI or internal ledgers. Never assume a transaction is complete based solely on the API response.
pix.cashin.received
Triggered when your user receives a Pix from another institution (cash-in).
- The Pix plugin receives a webhook from the PSTI.
- It verifies the recipient account.
- It credits the amount to the account.
- Then it notifies your system with this event.
pix.message.received (MED)
In some cases, the PSTI may send direct messages to the Authorizer. These include updates not tied to a transaction.
- Forwarding alerts to your team.
- Logging system-level events.
- Triggering operational workflows.
pix.reversal.processed
Triggered when a Pix reversal is successfully completed, either by your system or due to a webhook received from the PSTI.
- Update internal balances.
- Notify your user.
- Track full reversal history.
Retry behavior
If your endpoint is down or returns an error, we’ll retry the webhook using exponential backoff, with delays increasing up to a 24-hour TTL.Attempt | Delay before retry |
---|---|
1st | Immediate |
2nd | 10 seconds |
3rd | 1 minute |
4th | 5 minutes |
… | up to 24 hours |
Verifying authenticity
All webhook requests include the header X-Signature:- Use your webhook secret token.
- Generate the SHA256 HMAC of the raw payload body.
- Compare with the value in
X-Signature
.
If you’re using a framework that parses JSON before you read the raw body, be sure to extract the raw body for signature verification.
Recommended response
To avoid unnecessary retries, always respond with:Common pitfalls
Mistake | How to avoid it |
---|---|
Assuming API response means transaction success. | Always wait for the pix.transaction.status webhook. |
Forgetting to verify the signature. | Use X-Signature and your webhook secret. |
Rejecting webhooks due to slow DB or timeout. | Process async if needed, but return 200 quickly. |
Ignoring duplicate payloads. | Webhooks may be retried. Use transactionId as the idempotency key. |