Skip to main content
POST
Create a PIX refund

Authorizations

Authorization
string
header
required

JWT bearer token issued by the identity provider.

Headers

X-Idempotency
string
required

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.

Example:

"refund-2026-09-29-0001"

Body

application/json
accountId
string
required

The requesting account (the original payee).

Example:

"acc-123"

amount
integer<int64>
required

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

Example:

5000

code
string
required

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

Example:

"MD06"

endToEndId
string
required

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

Example:

"E1234567890"

transactionId
string
required

The original transaction id (UUID).

Example:

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

description
string

Free-text refund description.

Example:

"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).

Example:

"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-9]{8}$
Example:

"12345678"

Response

Created

accountId
string
required

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

Example:

"@recebedor"

amount
integer<int64>
required

Refund amount in centavos.

Example:

5000

code
string
required

The PIX return reason.

Example:

"MD06"

endToEndId
string
required

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

Example:

"E1234567890"

endToEndRefundId
string
required

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

Example:

"D1234567890"

id
string
required

The created refund id.

Example:

"a2f9c0d1-..."

status
string
required

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

Example:

"EXECUTED"

description
string

Refund description.

Example:

"Wrong amount"