Close a held return with ledger evidence (operator)
Operator action that closes a held return with the ledger transaction that evidences it (ledgerTransactionId), recording the operator and the time. TED Lerian does not move money: the credit to the sender, when due, is made in the ledger beforehand, and only recorded here.
Which transaction to send:
- No TED Lerian transfer carries the
NumCtrlSTR(transferIdnull): the transaction that credited the sender. If the TED was a TED Lerian transfer that endedREJECTEDorCANCELLED, the sender was never debited: never credit the sender, and send the transaction that released the sender’s hold. transferStatusREJECTEDorCANCELLED: the STR settled a TED that TED Lerian recorded as failed, and the return reverses that settlement. The sender was never debited, so there is nothing to credit, and the sender must never be credited. The evidence is the transaction that released the sender’s hold. The response shows thattransferStatus.
A closed return is never refunded by TED Lerian, even if the original TED settles later. Repeating the closure with the same transaction returns the existing record. With another transaction, the response is 409 TED-0060: the recorded transaction stays the closure, and the sender may have been credited twice, so reverse only the credit made for this attempt. If TED Lerian already took the return when the TED settled (it refunded the sender or parked the return for review), the response is also 409 TED-0060: when the transfer shows this return refunded, reverse any ledger credit made for it. If the TED Lerian transfer can still settle, the response is 409 TED-0067: TED Lerian refunds the sender when it settles, so reverse the credit as well. Requires X-Idempotency; always check X-Idempotency-Replayed.
Autorizações
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.
Cabeçalhos
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. Within the window, the original response is replayed byte for byte.
x >= 1Idempotency 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.
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 caminho
Identifier of the held return.
Corpo
Evidence of the closure of a held return: the ledger transaction that credited the sender or, when the TED Lerian transfer ended REJECTED/CANCELLED, the one that released the sender's hold.
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).
Resposta
Held return closed. If X-Idempotency-Replayed: true, this is the replay of a previous closure.
Held return: a return (STR0010R2) received from the STR for a TED that no SETTLED transfer of this institution carries by NumCtrlSTR, waiting for the operator. transferId/transferStatus say whether a TED Lerian transfer carries it; closedBy, closedAt, and ledgerTransactionId exist only after the closure.
Returned amount.
Identifier of the held return.
NumCtrlSTR of the returned TED (NumCtrlSTROr).
Official return reason (CodDevTransf).
Instant of the return at the STR.
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).
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.
Instant (UTC) of the closure.
Operator who closed the return.
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).

