Refund Guide (PIX Refund)
Refund Guide (PIX Refund)
This guide explains how to request a refund for a received PIX payment.
Overview
The PIX refund allows you to reverse a received payment in full or in part. The original transaction is always identified by its E2E (End-to-End ID) — there is no refund by charge identifier. If you only have the identifier, look up the QR code or the payment first to get the E2E (see Where to Find the E2E).
When to Use
- Duplicate payment - Customer paid twice
- Order cancellation - Order cancelled after payment
- Incorrect amount - Customer paid a different amount than expected
- Operational error - Payment received incorrectly
Deadlines
The PIX refund deadline is set by BACEN and enforced by the settlement bank: 90 days from the original payment, for both ordinary refunds and fraud cases.
Past that deadline the settlement bank refuses the refund — the API forwards
the refusal as partner_rejected (422), with the stated reason in the
partner block. There is no dedicated “deadline expired” error code. In that
scenario, use another reversal method.
Request Refund by E2E (End-to-End ID)
The E2E is the unique transaction identifier in the Brazilian PIX system. Format: E{ISPB}{DATE}{SEQUENTIAL}.
Request
Body Parameters
The account that received the original PIX comes from the path ({accountId})
and the currency is always BRL — neither is read from the body.
reason Values
The list is closed: any value outside this table is rejected with HTTP 400. Slugs are forwarded verbatim to the partner bank (MT Bank), with no translation.
Success Response
Refund runs through the same pipeline (and shape) as PIX out. The HTTP
status reflects the outcome: 200 (COMPLETED), 422 (FAILED),
202 (TIMEOUT/PENDING).
There is no
refundId/amount/currencyfield — usepaymentIdand track the final outcome via the statement or webhook.
Partial refunds
The amount field is required and defines how much goes back to the payer:
send the original PIX amount to refund it in full, or a smaller value to
refund part of it. Above the original, the API returns
400 refund_amount_exceeded and does not start the refund.
The same PIX can be refunded in more than one installment, up to the original amount. Two rules matter here:
- Each refund needs its own
Idempotency-Keyandidentifier. Reusing either makes the API treat the call as a retry of the previous refund and return that result — the second installment never goes out. - The banking partner owns the refundable balance. CorpX does not add up
partial refunds: a refund that exceeds what is still refundable is rejected
by the partner and comes back as
refund_amount_exceeded.
To find out how much of a PIX has already been refunded, check the account statement: refund entries reference the original transaction’s E2E.
Refund Webhook
When the refund is processed, you receive a webhook:
A refused refund emits pix.refund.failed with status: "FAILED" and the
errorCode/errorReason/error fields inside data. A refund in TIMEOUT
emits no webhook — check the statement.
Full Example: Refund Script
Where to Find the E2E
The E2E can be found in:
- Payment received webhook response
- Charge lookup after payment
- Account statement (Statement)
- Payer’s receipt
Example: Extract E2E from Webhook
The field to store is data.endToEnd.
Example: Extract E2E from Charge (QR Code)
The QR lookup response is a flat object (no data envelope); the field to
store is endToEndId.
Common Errors
The full list is in Errors.
Best Practices
- Save the E2E of all received transactions
- Use Idempotency Key to avoid duplicate refunds — and a different key (and
identifier) for each partial refund of the same PIX - Check the statement for how much of a PIX has already been refunded before requesting another partial refund
- Document the reason for auditing purposes
- Configure webhooks to track the status
- Keep a history of refunds for reconciliation
Next Steps
- Authentication Guide - Obtain access tokens
- QR Code Guide - Create charges
- Webhooks - Receive notifications