Return a parked received Pix to its payer
Returns to its payer, over SPI, a received Pix still PENDING with nothing in the ledger, until 23 hours after it arrived, or until 7 days less an hour once the ledger refused its credit because the balance did not accept credits or the ledger did not know its account or accounting route (the same Pix POST /v1/parked-credits//credit credits), and only while the ledger cannot take its credit. The return first does exactly what the credit does: it asks the ledger for a credit of this Pix since it arrived and posts the credit under the Pix’s own end-to-end id. A balance that accepts credits, or a credit that already landed, credits the Pix instead: it answers 409 PIX-0158 with the transaction EXECUTED and nothing sent to JD (return it then with POST /v1/refunds). Only a refusal because the receiving balance does not accept credits, or because the ledger does not know the account or accounting route the credit names, sends the return.
The return posts NOTHING in the ledger: the money never entered the account. It goes out for the full amount with reason BE08 (JD §8.5.1: started by the receiving participant for an operational failure in its own systems) and is recorded as a refund of that Pix. It answers 202 with the return PENDING until SPI settles it: then the return turns EXECUTED (transaction.refunded) and the received Pix ERROR with pendingReason RETURNED. When SPI refuses it, the return turns ERROR and the Pix waits again with pendingReason RETURN_REFUSED, ready for either action. When JD’s answer is unknown the return stays PENDING and the background worker asks JD about it; it is never reverted on a timeout. Sending this again on that Pix sends the SAME return under its own key, without asking the ledger again, which JD answers from its cache if it took the first (JDPI §6), for as long as JD has not named it and it is less than 24 hours old. A re-send JD does not take changes nothing and answers JD’s error: it says nothing about the first send. A redelivery from JD of a returned Pix is acknowledged with no credit and no second return.
Refusals change nothing: 404 PIX-0152 when no received Pix has this id; 409 PIX-0153 when it is credited, returned or failed, its first credit, a credit of it or an earlier return of it started less than two minutes ago and may still be running, or its return is already named by JD or more than 24 hours old; 409 PIX-0159 past that window, the ledger’s replay window; 409 PIX-0160 when a credit of it may still post, because one went unanswered by the ledger, at any time before, or a credit of it or a return’s credit attempt holds it, live or with its holder gone: such a Pix is never returned by this action, so credit it instead with POST /v1/parked-credits//credit, which posts it at most once; 422 PIX-0154 for a Pix received through the other core, or one recorded without its initiation type, and for a received return of a Pix this participant sent (isRefund true), which Pix does not return: credit it instead with POST /v1/parked-credits//credit; 409 PIX-0155 when the ledger holds a posting for it that is not a settled credit; 409 PIX-0105 when the ledger declares no inbound accounting route; the ledger’s own answer when it refuses the credit for any other reason; and JD’s own refusal when it provably did not take the return (the Pix waits again as RETURN_REFUSED). The credit this return tries is sent once: one the ledger never answers marks the Pix and answers 409 PIX-0160, sending nothing. A listing of the ledger that fails answers 5xx, sends nothing and keeps the Pix reserved for this action, and then only POST /v1/parked-credits//credit takes it over, once two minutes have passed.
Authorizations
JWT bearer token issued by the identity provider.
Path Parameters
The received Pix's transaction id (local UUID), as GET /v1/transactions lists it.
"019fb9b6-7593-7667-abe9-3b087192747b"
Response
Accepted
The Midaz alias of the account the refund debits: the one the original credited, or the indirect's @pi_{ispb} on an indirect refund.
"@recebedor"
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, filled when JD supplies it; may be empty while PENDING, which is not a failure.
"D1234567890"
The created refund id.
"a2f9c0d1-..."
eTransactionStatus name. A refund sent over SPI answers PENDING until SPI settles it.
"EXECUTED"
Refund description.
"Wrong amount"

