Create an outbound Pix refund (MED)
Issues a refund against a previously completed CASHIN transfer with a structured pacs.004 reasonCode. A refund the rail refuses answers 422 PIX-0013 and its debit is reverted; if that revert does not complete, the refund stays PROCESSING. A provider send that fails without proving the pacs.004 was not sent (a timeout, a 5xx) compensates nothing and answers 201 with status PROCESSING, as a refund the provider accepts without a provider reference does: the debit stays recorded until the outcome arrives by end-to-end id (GET the refund or wait for its callback). A retry with the same X-Idempotency key replays the original 201 response, with X-Idempotency-Replayed: true, instead of creating a second refund, including when the request timed out while the provider was answering. After a 5xx or a 409 PIX-0406, the same key answers the refund that the first attempt created, in its current state, with 201 and without X-Idempotency-Replayed, as long as that refund is not FAILED: the refund can still be PROCESSING with its debit, so read it with GET to see its outcome. A resend that keeps answering 412 PIX-0031 with Retry-After: 1 is still in flight. The same key with a different transfer, amount, reasonCode or reason answers 412 PIX-0031. Once the refund is FAILED and no replay record is left, the key is free and a retry under it creates a new refund.
Encabezados
REQUIRED. Client-supplied replay key, at most 64 bytes. A request without it is refused with PIX-0030 @ 400 before the handler runs. An identical resend within 1 hour returns the original response, status included, with X-Idempotency-Replayed: true. Reusing the key with a divergent method, URL or body is PIX-0031 @ 412.
1 - 64Parámetros de ruta
Cuerpo
Respuesta
Created
Fee the ledger reported on the create that moved the refund's money. Absent when no fee answer was recorded for this refund (its ledger create never landed, an error was logged at the time, or the refund was created before fees were read back); {"applied": false} when the ledger reported that no fee was charged; the full object when it charged one. A refund carries no ledger.revert field and needs none here: a FAILED refund that carries feeCharge was reverted first -- every path that writes a refund FAILED after its ledger create landed reverts the debit before marking it (a revert that does not complete leaves the refund PROCESSING), and every other path fails before any create -- so the fee was returned with the amount; applied reports what the create did and the object records the create.

