Pular para o conteúdo principal
POST
Create a PIX refund

Autorizações

Authorization
string
header
obrigatório

JWT bearer token issued by the identity provider.

Cabeçalhos

X-Idempotency
string
obrigatório

Idempotency key for this refund: any stable string you choose, up to 255 bytes, sent as the X-Idempotency request header (the same header, by the same name, that payment orders, MED writes and the Midaz ledger take). REQUIRED: omitting it, sending only whitespace, or sending more than 255 bytes is refused 400 PIX-0061 before anything is read, held or sent. Send the SAME value again to retry the SAME refund: once a refund is recorded under the key, a resend is answered 409 PIX-0029 and moves no money, whether it went to SPI or settled on-us, so read its outcome with GET /v1/transactions. Keys are scoped to the payer: the organization, plus the indirect participant on an indirect refund. A new refund needs a new key. BREAKING CHANGE: this replaces the optional body field clientRequestId, which no longer exists.

Exemplo:

"refund-2026-09-29-0001"

Corpo

application/json
amount
integer<int64>
obrigatório

Refund amount in centavos (must be greater than zero).

Exemplo:

5000

code
string
obrigatório

PIX return reason (BE08/FR01/MD06/SL02).

Exemplo:

"MD06"

endToEndId
string
obrigatório

The original transaction's end-to-end id.

Exemplo:

"E1234567890"

transactionId
string
obrigatório

The original transaction id (UUID).

Exemplo:

"d1f9c0a2-7b3e-4c51-9a6d-2f8e0b4c1a37"

accountId
string

The Midaz ledger account id of the requesting account (the original payee), a customer of the direct participant. REQUIRED unless indirectId is named (absent or blank is 400 PIX-0061). On a refund carrying indirectId it is DEPRECATED: an indirect keeps its customers in its own core, so the refunder is the original payee as the Pix recorded it. accountId is still accepted there, unchanged, when the direct participant's own credential sends the refund, and refused 400 PIX-0061 when an Access Manager partner is behind the request.

Exemplo:

"019a1b2c-3d4e-7f60-8a9b-0c1d2e3f4a5b"

description
string

Free-text refund description.

Exemplo:

"Wrong amount"

indirectId
string<uuid>

The registered indirect participant (UUID) that received the original Pix on its PIX position, required exactly then and debited for the refund: absent is 422 PIX-0135. Named, the original has to be held by that indirect, or the refund is refused 404 PIX-0147 before anything is read, held or sent - another indirect's Pix, and a Pix received on a direct account, are not the named indirect's to return, and a token confined to one indirect has to name it here. It then passes the checks of a payment order's indirectId (422 PIX-0111 feature off, 404 PIX-0095 unknown, 422 PIX-0100 not ACTIVE).

Exemplo:

"3f2504e0-4f89-41d3-9a0c-0305e82c3301"

payerIspb
string

The ISPB of the direct participant paying this refund back - the one that received the original Pix. OPTIONAL: omit it and the original is refunded by whichever participant holds it, exactly as before. Named, the original has to be booked in that participant's books, or the refund is refused 404 PIX-0147 before anything is read, held or sent - the same original named under another participant is not refunded. An ISPB this deployment does not act as is 422 PIX-0128. It is ROUTING DATA you supply, never a credential, and a token confined to one participant has to name it here; on a Pix received by an indirect, name the direct participant it rides alongside indirectId. Send it as an absent key, not an empty string.

Pattern: ^[0-9A-Z]{8}$
Exemplo:

"12345678"

Resposta

Created

accountId
string
obrigatório

The Midaz alias of the account the refund debits: the one the original credited, or the indirect's @pi_{ispb} on an indirect refund.

Exemplo:

"@recebedor"

amount
integer<int64>
obrigatório

Refund amount in centavos.

Exemplo:

5000

code
string
obrigatório

The PIX return reason.

Exemplo:

"MD06"

endToEndId
string
obrigatório

The original transaction's end-to-end id.

Exemplo:

"E1234567890"

endToEndRefundId
string
obrigatório

The refund's own end-to-end id, filled when JD supplies it; may be empty while PENDING, which is not a failure.

Exemplo:

"D1234567890"

id
string
obrigatório

The created refund id.

Exemplo:

"a2f9c0d1-..."

status
string
obrigatório

eTransactionStatus name. A refund sent over SPI answers PENDING until SPI settles it.

Exemplo:

"EXECUTED"

description
string

Refund description.

Exemplo:

"Wrong amount"