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 devolução: 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 devolução: once a devolução 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 devolução. A new devolução 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-..."

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, another indirect, or sent for a Pix received on a direct account is 422 PIX-0135, and it 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"

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 devolucao.

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 devolucao sent over SPI answers PENDING until SPI settles it.

Example:

"EXECUTED"

description
string

Refund description.

Example:

"Wrong amount"