Create a PIX refund
Creates a PIX refund (devolução) against an executed transaction. Bacen makes the refund the RECIPIENT’s operation, so the caller must be the party that RECEIVED the original payment: the requesting accountId’s document has to equal the original payee’s document. The original payer cannot refund a payment it sent — that is the MED/fraud path, not this one.
Identify the original with BOTH transactionId (the local UUID) and endToEndId, and it must still be EXECUTED. Partial refunds are allowed and they ACCUMULATE: the amount is checked against the original amount minus everything already refunded, under a row lock on the original, so two concurrent refunds cannot together exceed it. An on-us original is refunded as a synchronous ledger reversal from the refunder to the original payer; a payment received from another institution is submitted to JDPI first, and the refund’s own end-to-end id comes back from JD. code is the return reason and is accepted only as BE08, FR01, MD06 or SL02.
⚠️ Send clientRequestId on an on-us refund. Without it a retry posts a SECOND reversal: each attempt mints a fresh refund end-to-end id, so nothing dedups them, and the money moves twice. With it, a retry replays the existing refund as a success. The cross-institution branch is already retry-safe on its own.
Refusals: 422 PIX-0036 when no EXECUTED transaction matches that (endToEndId, transactionId) pair; 400 PIX-0089 when the original is an outgoing payment (only the receiving institution can return what it received); 400 PIX-0087 when the caller is refunding its own outgoing payment; 400 PIX-0088 when the caller is not the original payee; 409 PIX-0032 when this amount plus the prior refunds would exceed the original; 422 PIX-0030 on a non-positive amount; 422 PIX-0108 when the requesting account is not bound to a ledger account; 400 PIX-0061 when accountId or endToEndId is empty, transactionId is not a UUID, or code is outside the four accepted values.
Authorizations
JWT bearer token issued by the identity provider.
Body
The requesting account (the original payee).
"acc-123"
Refund amount in centavos (must be greater than zero).
5000
PIX return reason (BE08/FR01/MD06/SL02).
"MD06"
The original transaction's end-to-end id.
"E1234567890"
The original transaction id (UUID).
"d1f9c0a2-..."
Optional client idempotency token. A retry carrying the same value replays the existing refund instead of creating a duplicate (intra-PSP double-refund protection); omit to opt out.
"req-2025-01-01-abc123"
Free-text refund description.
"Wrong amount"
Response
Created
The refunding account id.
"ext-acc-123"
Refund amount in centavos.
5000
The PIX return reason.
"MD06"
The original transaction's end-to-end id.
"E1234567890"
The refund's own end-to-end id.
"D1234567890"
The created refund id.
"a2f9c0d1-..."
eTransactionStatus name.
"EXECUTED"
Refund description.
"Wrong amount"

