The BACEN manuals for STR prevail over this page. Your institution validates the flow and implements it on the Lerian APIs. See how to read the diagrams.
Participants
- Your institution. Your system. It cancels the TEDs it sent and returns the TEDs it received.
- TED Lerian. The TED interface between Midaz and Lerian SPB. It checks each request, moves the money in Midaz and publishes the events. Streaming Hub delivers the events to your system.
- Midaz. The ledger. It keeps the customer accounts and their balances.
- Lerian SPB. Lerian’s STR messaging. It sends and receives the STR messages and reports their settlement.
- STR (BACEN). The BACEN reserve transfer system. It cancels pending entries and settles each return.
Before you start
- To cancel a TED that the STR holds as pending, this cancellation must be on for your institution. It is off by default.
- To return a TED, you have the official return reason: a
CodDevTransfcode of the SFN domain dictionary.
Diagram
Cancel a TED pending at the STR
Return an incoming TED
Rules
- TED Lerian cancels a transfer in
CREATEDorRESERVEDwith200and releases any hold. While TED Lerian places the hold or sends the transfer, the answer is409withTED-0061. - For a transfer in
PENDING_STR, TED Lerian asks the STR to cancel the entry. The answer is202, and the hold stays until the STR answers. The result arrives astransfer.cancelled,transfer.settledortransfer.rejected. - A transfer already
CANCELLEDanswers200again. - TED Lerian refuses to cancel a transfer in
SUBMITTED,SETTLEDorREJECTED. - This call returns only an incoming TED in
CREDITED, and always in full.
How you know it finished
- Cancel. The event
transfer.cancelled, orGET /v1/transfers/{transferId}withstatusset toCANCELLED. - Return. The event
incoming_return.returned, orGET /v1/incoming-transfers/{incomingTransferId}withstatusset toRETURNED.
What can go wrong
The TED Lerian error list describes each code.

