Supplier payments
An ERP pays supplier invoices to accounts at other banks. Each payment goes as one TED with an official purpose code and a reference that ties the transfer to the invoice.
- The ERP approves the batch of invoices to pay.
- For each payment, it calls
POST /v1/transfers/fee-quotesto show the fee, the total and whether the STR window is open. - It sends each TED with
POST /v1/transfers, the invoice number inclientReferenceand its ownX-Idempotencykey. - TED Lerian holds the amount plus the fee in Midaz.
- TED Lerian sends the TED to Lerian SPB, which sends it to the STR.
- Lerian SPB reports that the STR settled the TED.
- TED Lerian publishes
transfer.settled. - The ERP closes the invoice it finds through
clientReference.
X-Idempotency key creates no second transfer. If the STR rejects the TED, TED Lerian releases the hold and transfer.rejected carries the reason.
Withdrawal to the customer’s account at another bank
A customer moves the balance from your platform to their own account at another bank. The app shows the cost, keeps the balance from being spent twice, and tells the customer when the money left.
- The customer asks for the withdrawal and enters the bank details.
- The app calls
POST /v1/transfers/fee-quotesand shows the fee. - The customer confirms.
- The app sends the TED with
POST /v1/transfers. - TED Lerian holds the amount plus the fee in Midaz, so the balance cannot be spent twice.
- TED Lerian sends the TED to Lerian SPB, which sends it to the STR.
- Lerian SPB reports that the STR settled the TED.
- TED Lerian publishes
transfer.settled. - The app tells the customer the withdrawal is complete.
windowOpen as false and the app shows nextWindowOpensAt before the customer confirms. If the TED is rejected, the hold is released and the balance returns to the customer.
Transfer between customers of the same institution
When the recipient’s bank is your own institution, the same request becomes an internal transfer. It settles in one Midaz transaction, also outside the STR hours. Usage limits and, when configured, the fee still apply.
- The customer pays another customer of the same institution.
- The app sends
POST /v1/transferswith the institution’s own ISPB as the recipient’s bank. - TED Lerian finds the recipient account in the Midaz CRM.
- Midaz debits and credits in the same transaction.
- The response comes back at once with
type=INTERNALandstatus=SETTLED.
201 with status=REJECTED and TED-0031. If TED Lerian does not find the recipient, it refuses the request with 422 TED-1021 and creates nothing.
Receive a TED and credit the customer within 60 minutes
A customer receives a TED from another bank. The rule gives 60 minutes from interbank settlement to credit or return it. TED Lerian does this with no human step in the normal case.
- Lerian SPB reports a TED that the STR settled. The 60 minute deadline starts.
- TED Lerian records the incoming TED and publishes
incoming_transfer.received. - TED Lerian looks up the account and its holder in the Midaz CRM by branch, account and document.
- TED Lerian checks that the holder and the account type match.
- Midaz credits the customer.
- TED Lerian publishes
incoming_transfer.credited. - The institution’s system tells the customer about the TED.
incoming_return.*). If it cannot decide, the TED goes to manual review and shows up in the operator’s queue.
Return an incoming TED on suspected fraud
A TED was credited, but the sending institution asks for it back or the fraud team finds a problem. The operator orders a full return with the official reason and a justification that stays in the audit trail.
- The operator flags the suspicion.
- The operator reads the timeline with
GET /v1/incoming-transfers/{incomingTransferId}/timeline. - The operator orders the return with
POST /v1/incoming-transfers/{incomingTransferId}/return, the official reason and a justification. - Midaz reverses the customer’s credit.
- TED Lerian sends the return to Lerian SPB, which sends it to the STR.
- Lerian SPB reports that the STR settled the return.
- TED Lerian publishes
incoming_return.returned.
incoming_return.failed arrives and the TED goes back to manual review.
Back-office work on a transfer with no answer
You sent a TED and no answer came in time. TED Lerian keeps the hold and asks Lerian SPB for the real outcome. When the automatic answer is not conclusive, an operator decides with evidence.
- The transfer moves to
AWAITING_RECONCILIATIONand keeps the hold. - TED Lerian asks Lerian SPB for the outcome.
- The answer is not conclusive.
- The operator sees the item in the queue with
GET /v1/reconciliation/queue, with its age and deadline. - The operator unblocks it with
POST /v1/transfers/{transferId}/unblock, the outcome and the STR evidence. - Midaz settles or releases the hold, as the outcome says.
- TED Lerian publishes
transfer.settledortransfer.rejected.

