Saltar al contenido principal
POST
Close a held return with ledger evidence (operator)

Autorizaciones

Authorization
string
header
requerido

JWT token that the Lerian Access Manager issues for your institution. Send it in Authorization: Bearer <token> on every call (except the public health probes). The tenant never comes from the body, the query, or the path. Each operation requires a role with the matching permission (see the API overview). Without it, 403 TED-0071. Missing, invalid, or expired token: 401 TED-0070.

Encabezados

X-TTL
integer

Replay window of the idempotency key, in seconds. Default 300 (5 minutes) when missing or invalid. Values outside 30 s to 7 days are adjusted to these limits. Only the value of the FIRST request for a key counts. A change to X-TTL on retries has no effect. The window sets how long the response is replayed.

Rango requerido: x >= 1
X-Idempotency
string
requerido

Idempotency key that the integrator creates (1 to 128 printable ASCII characters, no spaces; we recommend a UUID). Required on every operation with an effect. Send the SAME key again when you retry a call that failed because of a timeout or network error. Same key + same body returns the original response with X-Idempotency-Replayed: true and no new effect. Same key + different body responds 422 TED-0012. Same key still in processing responds 409 TED-0013 (retry after Retry-After). Missing or in the wrong format: 400 TED-0011.

X-Request-Id
string<uuid>

Correlation identifier of this request (UUID). Optional: when you omit it, or when the value is not a well-formed UUID, the platform creates a UUID and returns it in the X-Request-Id header of the response. The resolved identifier goes to the logs, spans, and audit events of this request. Keep it to open a support ticket.

Parámetros de ruta

heldReturnId
string<uuid>
requerido

Identifier of the held return.

Cuerpo

application/json
ledgerTransactionId
string<uuid>
requerido

Ledger transaction that evidences the closure: the one that credited the sender or, if the TED Lerian transfer that carries the return ended REJECTED or CANCELLED, the one that released the sender's hold (nothing to credit).

Respuesta

Held return closed. If X-Idempotency-Replayed: true, this is the replay of a previous closure.

amount
string
requerido

Returned amount.

id
string<uuid>
requerido

Identifier of the held return.

originalNumCtrlStr
string
requerido

NumCtrlSTR of the returned TED (NumCtrlSTROr).

returnCode
string
requerido

Official return reason (CodDevTransf).

returnedAt
string<date-time>
requerido

Instant of the return at the STR.

transferId
string<uuid> | null
requerido

TED Lerian transfer that carries the NumCtrlSTR of the returned TED. Null while no transfer carries it: TED Lerian did not send the TED, or its TED did not receive a NumCtrlSTR from a rail fact (in any status, SUBMITTED included).

transferStatus
string | null
requerido

Current status of that transfer; null without it. REJECTED or CANCELLED: the sender was never debited and there is nothing to credit. Never credit the sender; close the return with evidence.

closedAt
string<date-time>

Instant (UTC) of the closure.

closedBy
string

Operator who closed the return.

ledgerTransactionId
string<uuid>

Ledger transaction that evidences the closure: the one that credited the sender or, with transferStatus REJECTED or CANCELLED, the one that released the sender's hold (nothing to credit).