> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Quote the fee and total of a TED with no financial effect

> Estimates the fee and the total of this request. TED Lerian prices the estimate from the fee package that the `fee.package_id` runtime setting names; without that setting, the estimate is zero. A send is charged the fee that the Midaz fee packages of the institution apply to its hold, and the transfer shows it in `feeAmount`. The quote has no effect (it does not hold balance or limit). Send the same fields as the transfer creation and `X-Account-Id` with the source account.

The response tells you the path (`type` = `TED` or `INTERNAL`) and, if the window is closed, when it opens again (`nextWindowOpensAt`). The quote reflects the policy at the time of the query. Does not require `X-Idempotency`.



## OpenAPI

````yaml /es/openapi/v3-current/ted-lerian.yaml post /v1/transfers/fee-quotes
openapi: 3.1.0
info:
  description: >-
    API of **TED Lerian**, the interface over Lerian SPB. Your institution uses
    it to send TEDs, make internal transfers, track incoming TEDs, and operate
    returns, queues, and policy on its Midaz ledger. The [API
    overview](/es/reference/interfaces/ted-lerian/ted-lerian-api-overview) gives
    the concepts, the roles, and the conventions.
  title: TED Lerian API
  version: v1.0.0
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
tags:
  - description: >-
      Outgoing TEDs and internal transfers: fee quote, creation, query,
      timeline, and cancellation. Every integration starts here.
    name: Transfers
  - description: >-
      Incoming TEDs from other institutions: query, timeline, and operator
      actions (full return and manual review resolution).
    name: Incoming Transfers
  - description: >-
      STR participant list, to resolve COMPE code ↔ ISPB and validate the
      destination bank before you create a transfer.
    name: Participants
  - description: >-
      Back office: operations queue, inconsistency findings between the ledger
      and the STR, reviews of rail facts, held returns, and manual unblock with
      evidence.
    name: Reconciliation
  - description: >-
      Operations dashboard: daily aggregates, regulatory deadlines (30/60/60
      min), and the closing balance that the STR reported.
    name: Operations
  - description: >-
      Institution configuration (editor): operating window and cut-off, usage
      limits, holiday calendar, and ISPB → organization bindings.
    name: Policy
paths:
  /v1/transfers/fee-quotes:
    post:
      tags:
        - Transfers
      summary: Quote the fee and total of a TED with no financial effect
      description: >-
        Estimates the fee and the total of this request. TED Lerian prices the
        estimate from the fee package that the `fee.package_id` runtime setting
        names; without that setting, the estimate is zero. A send is charged the
        fee that the Midaz fee packages of the institution apply to its hold,
        and the transfer shows it in `feeAmount`. The quote has no effect (it
        does not hold balance or limit). Send the same fields as the transfer
        creation and `X-Account-Id` with the source account.


        The response tells you the path (`type` = `TED` or `INTERNAL`) and, if
        the window is closed, when it opens again (`nextWindowOpensAt`). The
        quote reflects the policy at the time of the query. Does not require
        `X-Idempotency`.
      operationId: quoteTransferFee
      parameters:
        - description: >-
            Identifier (UUID) of the customer account in your own institution
            that starts the operation: the debited account in a send request or
            a quote. It goes in the header, never in the body. The account must
            belong to the organization that the token resolves. A missing or
            malformed value returns 400 `TED-0008`; an account from another
            organization returns 403 `TED-0009`.
          in: header
          name: X-Account-Id
          required: true
          schema:
            format: uuid
            type: string
        - $ref: '#/components/parameters/XRequestId'
      requestBody:
        content:
          application/json:
            examples:
              ted:
                summary: Quote for a TED
                value:
                  amount: '1500.00'
                  purposeCode: '00010'
                  recipient:
                    agency: '1234'
                    bankAccount: '0001234567'
                    bankAccountType: CACC
                    bankCode: '001'
                    document: '12345678909'
                    name: Maria da Silva
            schema:
              $ref: '#/components/schemas/FeeQuoteRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                amount: '1500.00'
                feeAmount: '3.25'
                feePackageId: 7b8c9d0e-1f2a-4b3c-8d4e-5f6a7b8c9d0e
                quotedAt: '2026-10-22T13:05:12Z'
                totalAmount: '1503.25'
                type: TED
                windowOpen: true
              schema:
                $ref: '#/components/schemas/FeeQuote'
          description: >-
            Fee estimate: the `feeAmount` and `totalAmount` estimated for this
            request now. No financial effect.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Malformed JSON (`TED-0001`) or `X-Account-Id` missing/malformed
            (`TED-0008`).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: 'Not authenticated: token missing, invalid, or expired (`TED-0070`).'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            No permission: the token's role does not authorize this action, or
            the product license is not valid for the organization (`TED-0071`);
            or the account in `X-Account-Id` does not belong to the organization
            (`TED-0009`).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Invalid fields or amount (`TED-0002`), purpose code unknown, or not
            in force on the date of the request, in the BACEN FinlddCli Domain
            Dictionary (`TED-0003`), purpose code `99999` (the quote takes no
            description, `TED-0004`), recipient bank missing or duplicated
            (`TED-0005`), invalid recipient document, including the check digits
            of the CPF or CNPJ (`TED-0007`, as on the send), or bank unknown to
            the STR (`TED-0006`).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Unexpected failure (`TED-9000`). If it continues, contact support
            and give the `X-Request-Id` of the response.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Fee estimate unavailable (`TED-0040`), account registry unavailable
            (`TED-1020`), or institution configuration missing (`TED-0080`).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
components:
  parameters:
    XRequestId:
      description: >-
        Correlation identifier of this request (UUID). Optional: when you omit
        it, or when the value is not a well-formed UUID, the platform creates a
        UUID and returns it in the X-Request-Id header of the response. The
        resolved identifier goes to the logs, spans, and audit events of this
        request. Keep it to open a support ticket.
      in: header
      name: X-Request-Id
      schema:
        format: uuid
        type: string
  schemas:
    FeeQuoteRequest:
      additionalProperties: false
      description: >-
        Quote request: the same financial fields as a send request (recipient,
        amount, and purpose code), with no effect.
      properties:
        amount:
          description: >-
            Amount in BRL as a decimal string, not a JSON number: digits only,
            with a dot as the decimal separator, up to 16 significant integer
            digits and at most 2 significant decimal places, with no sign or
            exponent. Leading and trailing spaces are ignored (e.g., "1500.00";
            "1500.000" is equal to 1500.00).
          examples:
            - '1500.00'
          type: string
        purposeCode:
          description: >-
            Purpose code of the TED: a 5-digit code. A code that is unknown, or
            not in force on the date of the request, in the BACEN FinlddCli
            Domain Dictionary is refused with TED-0003.
          examples:
            - '00001'
          pattern: ^[0-9]{5}$
          type: string
        recipient:
          $ref: '#/components/schemas/RecipientBody'
          description: Recipient, exactly as it would be sent in the transfer request.
      required:
        - recipient
        - amount
        - purposeCode
      type: object
    FeeQuote:
      additionalProperties: false
      description: >-
        Quote result: the fee estimate and the total of the request at this
        instant, and whether the operating window is open. The quote does not
        hold balance or limit.
      properties:
        amount:
          description: Amount sent, in BRL.
          examples:
            - '1500.00'
          pattern: ^(0\.(0[1-9]|[1-9][0-9])|[1-9][0-9]{0,11}\.[0-9]{2})$
          type: string
        feeAmount:
          description: Fee estimate, in BRL (0.00 when the estimate prices no fee).
          examples:
            - '3.25'
          pattern: ^(0|[1-9][0-9]{0,11})\.[0-9]{2}$
          type: string
        feePackageId:
          description: Identifier of the fee package applied in the ledger
          type: string
        nextWindowOpensAt:
          description: >-
            Next opening of the effective window (UTC), given when the window is
            closed at this moment.
          format: date-time
          type: string
        quotedAt:
          description: Time (UTC) of the quote.
          format: date-time
          type: string
        totalAmount:
          description: Amount + fee estimate.
          examples:
            - '1503.25'
          pattern: ^(0|[1-9][0-9]{0,11})\.[0-9]{2}$
          type: string
        type:
          description: >-
            Path the send would take: TED (another institution, through the STR)
            or INTERNAL (your own institution, in the ledger).
          enum:
            - TED
            - INTERNAL
          type: string
        windowOpen:
          description: >-
            Whether the effective window is open at this moment. Missing when
            the window could not be read — it never means closed.
          type: boolean
      required:
        - type
        - amount
        - feeAmount
        - totalAmount
        - quotedAt
      type: object
    Detail:
      additionalProperties: true
      description: >-
        Standard error body (RFC 9457, `application/problem+json`) for every
        `/v1` operation. Use `code` (TED-NNNN) to handle the error in code,
        `detail` for the readable message, and `errors` for the invalid fields
        of a 422. The `X-Request-Id` of the response identifies the occurrence
        for support.
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    RecipientBody:
      additionalProperties: false
      description: >-
        Recipient of the transfer. Identify the bank by `bankId` (ISPB, 8
        digits) OR by `bankCode` (COMPE, 3 digits), never both. Use `GET
        /v1/participants` to resolve one from the other. The other fields
        identify the account and the holder exactly as they appear at the
        destination bank.
      properties:
        agency:
          description: >-
            Branch of the destination account, without the check digit (up to 4
            characters).
          examples:
            - '1234'
          maxLength: 4
          type: string
        bankAccount:
          description: >-
            Destination account number, in the format that the destination bank
            accepts (up to 20 characters).
          examples:
            - '0001234567'
          maxLength: 20
          type: string
        bankAccountType:
          description: >-
            Type of the destination account: CACC (checking), SVGS (savings),
            SLRY (salary), or TRAN (payment).
          enum:
            - CACC
            - SVGS
            - SLRY
            - TRAN
          type: string
        bankCode:
          description: >-
            COMPE code of the destination institution (3 digits). Send bankId OR
            bankCode, never both.
          pattern: ^[0-9]{3}$
          type: string
        bankId:
          description: >-
            ISPB of the destination institution (8 digits). Send bankId OR
            bankCode, never both.
          pattern: ^[0-9]{8}$
          type: string
        document:
          description: >-
            CPF (11 digits) or CNPJ (14 digits), digits only, with valid check
            digits. An alphanumeric CNPJ is not accepted. A value of another
            length or with letters is refused with TED-0002. A well-formed CPF
            or CNPJ with invalid check digits is refused with TED-0007, on the
            send and on the quote.
          pattern: ^([0-9]{11}|[0-9]{14})$
          type: string
        name:
          description: >-
            Full name or legal name of the holder of the destination account (up
            to 200 characters).
          examples:
            - Maria da Silva
          maxLength: 200
          type: string
      required:
        - agency
        - bankAccount
        - bankAccountType
        - name
        - document
      type: object
    ErrorDetail:
      additionalProperties: false
      description: >-
        An invalid field inside a validation error: where it is (`location`),
        what is wrong (`message`), and the value received.
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      description: >-
        Error reported by an upstream system (ledger or rail), when the service
        chooses to expose it. Absent in most errors.
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  headers:
    XRequestId:
      description: >-
        Echo of the request X-Request-Id: the value that the client sent, or the
        UUID that the platform generated when the client sent none. Present in
        every response, success or error.
      schema:
        format: uuid
        type: string
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: >-
        JWT token that the Lerian Access Manager issues for your institution.
        Send it in `Authorization: Bearer <token>` on every call (except the
        public health probes). The tenant never comes from the body, the query,
        or the path. Each operation requires a role with the matching permission
        (see the API overview). Without it, 403 `TED-0071`. Missing, invalid, or
        expired token: 401 `TED-0070`.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.