Sending a TED
1
Validate
TED Lerian checks the amount format, the purpose code against the BACEN FinlddCli domain, and the recipient’s bank in the STR participant list. It also checks the check digits of the recipient’s CPF or CNPJ. A failure here creates no transfer.
2
Apply the policy
It checks the effective window (the official STR schedule, the institution’s cut-off and the holidays) and the usage limits, with the fee estimate.
3
Hold
TED Lerian holds the amount on the source account, and Midaz adds to the hold the fee that your fee packages apply. Status
RESERVED.4
Send to the STR
Lerian SPB accepts the command and returns the
nuop. Status SUBMITTED. This is the status the create response usually shows.5
Settle
The STR decides asynchronously: it settles, rejects or keeps the entry pending. The outcome arrives as an event and on a read.
Statuses of a sent transfer
Accepted is not settled. A
201 confirms that the TED was accepted and, as a rule, sent. The money left only when the status is SETTLED. A refusal by the ledger or by Lerian SPB can already come in the create response (rejection.source LEDGER or RAIL). A refusal by the STR or by an operator shows only on a later read.Internal transfers
When the recipient’s bank is the institution’s own ISPB, TED Lerian finds the recipient account in the Midaz CRM. It settles everything in one Midaz transaction. The STR window does not apply, but usage limits and your fee packages do. The response has
type=INTERNAL and recipient.accountId filled in. If the recipient does not exist, belongs to another organization or has a closed account, TED Lerian refuses the request with TED-1021 and creates no transfer.
Receiving a TED
1
Record
Lerian SPB reports that the STR settled a TED for the institution. The 60 minute deadline starts at
interbankSettledAt.2
Route
TED Lerian finds the ISPB binding of the receiving institution. Before receiving TEDs, bind every ISPB through which your institution receives them with
PUT /v1/policy/ispb-bindings. A TED for a customer that arrives through an ISPB with no binding is not credited. In a single-tenant installation, TED Lerian returns it to the sending institution with the official reason 2, and it records no incoming TED and publishes no event. In Lerian Cloud, TED Lerian does not credit it.3
Find and check
TED Lerian looks up the recipient’s branch, account and document in the Midaz CRM. The holder and the account type have to match. If a lookup fails or gives no clear answer, the TED goes to manual review.
4
Decide
It credits the customer, records the TED with no customer credit, returns the TED with the official reason, or sends it to manual review.
An account is the institution’s own when the document of its holder in the Midaz CRM is the CNPJ of the organization that the ISPB is bound to. A TED to that account ends in
RECORDED, and incoming_transfer.recorded tells your system.
TED Lerian returns a TED for a customer account whose closingDate in the Midaz CRM is today or earlier, in Brasília time. The official reason is 1 (closed account).
When Lerian SPB delivers a TED twice, TED Lerian credits it only once.
When another institution returns your TED
TED Lerian finds the original transfer, records the return in the transfer’s
returned block and credits the sender back. The transfer stays SETTLED, and transfer.returned tells your system. By default, TED Lerian does not refund the sending fee. returned.feeRefunded says whether it did.
If no settled transfer carries the control number of the returned TED yet, TED Lerian holds the return. It applies the return when that transfer settles. An operator lists the held returns with GET /v1/reconciliation/held-returns.
Cancellation
Incoming TEDs are never cancellable.
Reconciliation and unblocking
A transfer with no answer in time enters the reconciliation queue with its age and last known status. By default, TED Lerian asks Lerian SPB for the outcome 15 minutes after it accepts the transfer, and tries up to 8 times. Settled turns the hold into a debit, and rejected releases the hold. Any other answer, not found included, keeps the hold until the next attempt. When the attempts run out, the transfer becomes
EXHAUSTED and an operator unblocks it with the evidence. Nothing is reversed without evidence.
A periodic check also looks for inconsistencies between Midaz and the transfer statuses, such as a return with no recredit or an orphan hold. It lists them for the operator.
