Cancel a MED refund request
Cancels a not-yet-analyzed refund request as the requesting PSP (JDPI devolucao/cancelar, contract 2.11). An unknown id returns a coded 404. Persists the JDPI response entity and returns it. Optional ispb names the direct participant the request acts for: named, the record has to be one that participant is a party to, or the answer is 404 PIX-0147 before anything is read from JDPI or changed; an ISPB this deployment does not act as is 422 PIX-0128 before any record is read; a token confined to one participant has to name it. Optional indirectId names the registered indirect participant the request acts for: named, the refund request has to be over a payment this deployment recorded for that indirect — the rule GET /v1/med/refunds?indirectId= lists by — or the answer is 404 PIX-0147 before anything is read from JDPI or changed; a token confined to one indirect has to name it; a malformed indirectId is 400 PIX-0061.
Authorizations
JWT bearer token issued by the identity provider.
Headers
Idempotency key for this write: any stable business string you choose, sent as the X-Idempotency request header - the same header, by the same name, that the Midaz ledger takes, so one integration sends one thing by one name. Send the SAME value again to retry safely: the plugin projects it deterministically into the GUID form JDPI requires (contract 6), so a repeat lands in the same JDPI dedup slot inside JD's 24h window and the operation is applied once. The raw value is never forwarded verbatim, so correlate JDPI-side logs with the projection rather than with what you sent. The header is REQUIRED: omitting it is refused 400 PIX-0061 before any JDPI call. BREAKING CHANGE: this value used to be the body field idempotencyKey, which no longer exists.
"med-cancel-2024-0001"
Path Parameters
The refund-request GUID.
"d4e5f6a7-b8c9-0123-def4-56789012345a"
Query Parameters
The ISPB of the direct participant this request acts for. OPTIONAL: omit it and the request is answered exactly as before. Named, the record has to be one that participant is a party to - either side of a dispute, the creator of a value recovery, the participant a refund credit was booked for - or the answer is 404 PIX-0147 and nothing is read from JDPI or changed. A record this deployment does not hold is 404 PIX-0147 too when an ispb is named. An ISPB this deployment does not act as is 422 PIX-0128, before any record is read. It is ROUTING DATA you supply, never a credential, and a token confined to one participant has to name it here. Sending it empty (ispb=) reads the same as omitting it.
^[0-9]{8}$"12345678"
The registered indirect participant (UUID) this request acts for. OPTIONAL: omit it and the request is answered exactly as before. Named, the refund request has to be over a payment this deployment recorded for that indirect - the rule GET /v1/med/refunds?indirectId= lists by - or the answer is 404 PIX-0147 and nothing is read from JDPI or changed; a record this deployment does not hold is 404 PIX-0147 too when an indirectId is named. It is ROUTING DATA you supply, never a credential, and a token confined to one indirect has to name it here. Not a valid UUID is 400 PIX-0061. Sending it empty (indirectId=) reads the same as omitting it.
"3f2504e0-4f89-41d3-9a0c-0305e82c3301"
Response
OK
True when the analysis deadline has been reached or passed (computed at read time); false when no deadline is set.
false
ISPB of the contested PSP.
"87654321"
JDPI creation timestamp (RFC 3339 UTC).
"2024-01-01T12:00:00.000Z"
EndToEndId of the contested payment or refund.
"E1234567820240101000000000000001"
Refund reason code (0=operational failure, 1=fraud, 3=Pix Automatico).
1
Human-readable refund reason label.
"Fraude"
Requested refund amount, in centavos.
25000
Refund-request GUID (the natural key).
"d4e5f6a7-b8c9-0123-def4-56789012345a"
ISPB of the requesting PSP.
"12345678"
stSolDevolucao lifecycle code (0=open, 1=cancelled, 2=analyzed).
0
Human-readable stSolDevolucao label.
"Aberta"
JDPI last-modification timestamp (RFC 3339 UTC) — the poll watermark.
"2024-01-01T12:05:00.000Z"
Contested-side analysis deadline (RFC 3339 UTC; contract §5, 6h for fraud / 48h otherwise); null for filer-side and terminal requests.
"2024-01-01T18:00:00.000Z"
Analysis detail.
"Insufficient balance."
Refund analysis result (0=Aceita Totalmente, 1=Aceita Parcialmente, 2=Rejeitada); null until analysed.
0
Human-readable refund analysis-result label.
"Aceita Totalmente"
Free-text detail.
"Operational failure."
Linked infraction GUID, when fraud.
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Value-recovery GUID, when from a recovery.
"b2c3d4e5-f6a7-8901-bcde-f23456789012"
pacs.004/pacs.008 refund reference, recorded at analysis.
"D1234567820240101000000000000099"
Amount actually refunded, in centavos; null when absent.
25000
When the request was REGISTERED in the JDPI base (raw JDPI instant), distinct from createdAt (the DICT creation instant). Returned by the §8.2.26 JDPI-base read only.
"2021-08-06T10:33:08.241Z"
Rejection reason (0,1,3,4); present only when the analysis rejected the request.
0
Human-readable rejection-reason label.
"Falta de saldo"

