Operating window
The effective window of a day combines three sources.
GET /v1/policy/window returns which one decided (source).
- The official STR schedule, published by Lerian SPB. Schedule changes the STR announces during the day apply without a restart.
- The institution’s cut-off, optional, always equal to or earlier than the official close. TED Lerian refuses a later time with
TED-0081. - The national holiday calendar, kept per year.
Usage limits
- Per source account: a maximum per transfer, a total per day and a total per month, by calendar day and month in Brasília time (
America/Sao_Paulo). The ceilings follow the order transfer ≤ day ≤ month. A missing ceiling means no ceiling. - They count the total debited: the amount plus the fee.
- An institution must configure its limits before the first TED. Without them, TED Lerian refuses each send with
503 TED-0080. - Above a limit, TED Lerian refuses the TED before the hold with
422 TED-0030. The answer names the limit. - A rejected or cancelled transfer frees them up again.
- With
enabled=false, the limits count nothing and refuse nothing. - Only the administrator changes them. Each change records who made it and when.
Fees
- Charging a fee is optional and off by default. While it is off, every fee is zero: on the quote, on sending and on receiving.
- When it is on for an institution, Midaz calculates the fee from the configured fee package (
feePackageId). - The quote shows the fee and the total with no financial effect. The quoted fee is the fee that a send of the same request would hold.
- If the calculation is unavailable when you send, TED Lerian refuses the TED with
503 TED-0040. The institution can choose to send with a zero fee in that case instead. - On an incoming TED, the fee shows in
feeAmountand the credited amount increditedAmount. If the calculation fails, the customer receives the full amount with a zero fee. - When another institution returns a TED, TED Lerian does not refund the sending fee by default. The institution can turn the refund on, and
returned.feeRefundedshows what happened.
Idempotency and duplicate requests
- Every write needs the
X-Idempotencyheader: 1 to 128 printable ASCII characters. Without it, the answer is400 TED-0011. - The same key with the same body returns the original response with
X-Idempotency-Replayed: true. TED Lerian creates no new transfer. X-TTLsets for how many seconds TED Lerian replays the response (default 300). Only the TTL of the first request counts.- A request with the same key and another body gets
422 TED-0012. OnPOST /v1/transfers, the key stays bound to the transfer it created: a later request with the same key never creates a second transfer. - A request with the same key still in progress gets
409 TED-0013withRetry-After. - Whatever the key,
POST /v1/transfersrefuses a materially identical request in the same anti-duplication window (5 minutes by default) with409 TED-0014.
Regulatory deadlines
GET /v1/operations/sla shows p50, p95 and p99 for each deadline, the breaches of the day and the items at risk.
Personal data
- API responses: the name and the CPF or CNPJ of the sender and of the recipient come in full, for roles allowed to read them.
- Logs: TED Lerian masks documents and names.
- Events for sent TEDs (
transfer.*) carry no counterparty data. - Events for incoming TEDs (
incoming_transfer.*) carry the recipient, the institution’s own customer, in full. The sender, a customer of another institution, is masked. - The free-text description of an incoming TED is published as the sending institution wrote it.
Isolation between institutions
Each record belongs to one institution. The institution always comes from the authenticated token, never from a field in the request. An identifier from another institution answers as not found (
404), without revealing that it exists.
Audit
Each transfer has a timeline that is never edited. It records each status change with the date and time, the origin (
API, RAIL, STR, LEDGER, WORKER, OPERATOR, SYSTEM), the official reason and, for operator actions, who acted. TED Lerian deletes no business record.
