Skip to main content
TED Lerian is the interface over Lerian SPB, Lerian’s own messaging connector to the STR. Your institution uses its API to send TEDs, make internal transfers, track incoming TEDs, and operate returns, queues and policy, all on top of the institution’s Midaz ledger. For a TED, money leaves the account only when the STR settles. Every operation with an effect is idempotent, so you can resend after a timeout.

Concepts


Integrate in four steps


1

Configure the institution

Do this once, with the editor role. Set the usage limits with PUT /v1/policy/limits; they are required before the first TED. For incoming TEDs, set the ISPB to organization bindings with PUT /v1/policy/ispb-bindings. Optionally, set a cut-off with PUT /v1/policy/window.
2

Send the TED

Send X-Account-Id (the debited account) and X-Idempotency (a new key for each payment). To show the fee before you confirm, call POST /v1/transfers/fee-quotes with the same fields.
The send returns 201 with the status the TED reached in this call, usually SUBMITTED.
3

Track it until settlement

Query GET /v1/transfers/{transferId} until status reaches SETTLED, REJECTED or CANCELLED, or subscribe to the transfer.* events. On REJECTED, rejection.source and rejection.code tell you who refused it and why.
4

Handle incoming TEDs

List them with GET /v1/incoming-transfers. The credit to the customer is automatic. Only status=MANUAL_REVIEW requires an operator decision (POST /v1/incoming-transfers/{incomingTransferId}/resolve-review), and POST /v1/incoming-transfers/{incomingTransferId}/return returns a TED that is already credited.

Statuses


A sent TED goes through these statuses. The final statuses are SETTLED, REJECTED and CANCELLED. An incoming TED goes from RECEIVED (decision in progress) to CREDITED (credited to the customer), RECORDED (the institution’s own account, final), RETURN_REQUESTED (TED Lerian cannot credit it) or MANUAL_REVIEW (waits for an operator; see reviewReason). It goes from RETURN_REQUESTED to RETURNED when it is returned. slaDeadlineAt is the 60-minute regulatory deadline from interbank settlement.

Authentication and permissions


Every call, except the public health probes, sends Authorization: Bearer <token> issued by Access Manager. The default roles are editor (every operation), operator (every operation except the policy and ISPB binding writes) and viewer (reads, except the reconciliation reads). Without the permission, or with a product license that is not valid for the organization: 403 TED-0071. Missing or invalid token: 401 TED-0070.

Conventions


  • Tenant. Never from the path, query or body.
  • Amounts. Decimal strings in BRL with two decimal places ("1500.00"), never JSON numbers.
  • Dates. RFC 3339 in UTC (2026-10-22T13:05:12Z); days as YYYY-MM-DD. The operating window uses the institution’s time zone (America/Sao_Paulo).
  • Idempotency. Every operation with an effect requires X-Idempotency (1 to 128 ASCII characters; use a UUID). The same key with the same body returns the original response with X-Idempotency-Replayed: true and no new effect. A different body returns 422 TED-0012. If the first request is still processing, you get 409 TED-0013 (retry after Retry-After). The replay lasts X-TTL seconds (default 300). On POST /v1/transfers, the key stays bound to the transfer it created.
  • Duplicate protection. POST /v1/transfers can refuse with 409 TED-0014 a materially identical request sent shortly after another one, even with a different key. Query the existing transfer.
  • Pagination. Lists return items, limit, next_cursor and prev_cursor. Ask for up to limit=100 (default 20) and follow next_cursor until it is null. The cursor is opaque.
  • Correlation. Send X-Request-Id (UUID) or receive a generated one. It comes back in every response and identifies the call for support.
  • Events. Each transition is published as a CloudEvent with ce-type studio.lerian.br-ted.<resource>.<event>: transfer.*, incoming_transfer.* and incoming_return.*. Delivery is at least once; deduplicate by ce-id.
  • Environments. The base URL is per installation (BYOC or Lerian Cloud), and Lerian provides it.

Errors


Every error is application/problem+json (RFC 9457) with a stable code. Handle errors by code. errors lists the invalid fields of a 422. A 503 means the request did not take effect: retry later with the same X-Idempotency. There are three exceptions:
  • TED-1000: the ledger did not confirm the result, and the operation can already be in the ledger. Read the status of the resource before you act again.
  • TED-0080 on a send: the transfer can already exist. Look for it with GET /v1/transfers before you send it again.
  • TED-1010 on a cancellation: the answer of the STR connector is unknown, and the cancellation request stays recorded. Retry with the same X-Idempotency and the same reason.
A rate-limited call returns 429 with Retry-After: handle it by status and wait that long before you retry. On a send, TED-0031, TED-1001, TED-1011 and TED-1013 never arrive as an error response. They arrive in rejection.code of a transfer in status REJECTED, in the 201 response or in a later query. The error list gives each code with its cause and fix.