> ## 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.

# Apply the antifraud partner's final decision to a transfer in analysis

> Applies the antifraud partner's **final decision** to a transfer that the partner left in analysis (`status=FRAUD_ANALYSIS`). The caller is the client's integration, with the `editor` role.

The body is `{"analysisId", "decision", "reasons"}`: `decision` is `ALLOW` or `DENY`, and `analysisId` is the id the partner received with its `REVIEW`. A malformed `reasons` is dropped and the decision still applies; valid reasons are recorded on the check, replacing the ones the evaluation recorded (the score stays the evaluation's), and appear in the events and the read API; the body is at most 16 KiB.

| Decision | Result |
|---|---|
| `DENY` | Accepted at any time while the transfer is in analysis: `REJECTED` with `TED-0050`, the hold is cancelled and the limit returned. |
| `ALLOW` on a TED, before the analysis deadline and inside the operating window | Sent to the STR; the response carries the new status. |
| `ALLOW` on a TED with the window closed | Refused like a `DENY`, with `TED-0020` or `TED-0021`. If the window cannot be determined: 503 `TED-0022`, nothing written. |
| `ALLOW` on an internal transfer | Records that side; once every evaluated side is allowed, the transfer is `SETTLED`. |

409 `TED-0060` is final, do not repeat: the transfer already left the analysis, the `analysisId` matches no open check, the check is already resolved, the transfer is already on its way to the STR, or an `ALLOW` arrived after the analysis deadline.

503 is temporary, repeat with the **same** `X-Idempotency`: `TED-0053` when the decision arrived before the analysis was recorded, or when the same key is still processing (never 409); `TED-9002` when the audit trail cannot record the decision. Every 503 carries `Retry-After`.

`X-Idempotency` is required and must be `<analysisId>:<decision>`; `X-Idempotency-Replayed: true` indicates a replay.



## OpenAPI

````yaml /es/openapi/v3-current/ted-lerian.yaml post /v1/transfers/{transferId}/fraud-analysis/resolve
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/{transferId}/fraud-analysis/resolve:
    post:
      tags:
        - Transfers
      summary: Apply the antifraud partner's final decision to a transfer in analysis
      description: >-
        Applies the antifraud partner's **final decision** to a transfer that
        the partner left in analysis (`status=FRAUD_ANALYSIS`). The caller is
        the client's integration, with the `editor` role.


        The body is `{"analysisId", "decision", "reasons"}`: `decision` is
        `ALLOW` or `DENY`, and `analysisId` is the id the partner received with
        its `REVIEW`. A malformed `reasons` is dropped and the decision still
        applies; valid reasons are recorded on the check, replacing the ones the
        evaluation recorded (the score stays the evaluation's), and appear in
        the events and the read API; the body is at most 16 KiB.


        | Decision | Result |

        |---|---|

        | `DENY` | Accepted at any time while the transfer is in analysis:
        `REJECTED` with `TED-0050`, the hold is cancelled and the limit
        returned. |

        | `ALLOW` on a TED, before the analysis deadline and inside the
        operating window | Sent to the STR; the response carries the new status.
        |

        | `ALLOW` on a TED with the window closed | Refused like a `DENY`, with
        `TED-0020` or `TED-0021`. If the window cannot be determined: 503
        `TED-0022`, nothing written. |

        | `ALLOW` on an internal transfer | Records that side; once every
        evaluated side is allowed, the transfer is `SETTLED`. |


        409 `TED-0060` is final, do not repeat: the transfer already left the
        analysis, the `analysisId` matches no open check, the check is already
        resolved, the transfer is already on its way to the STR, or an `ALLOW`
        arrived after the analysis deadline.


        503 is temporary, repeat with the **same** `X-Idempotency`: `TED-0053`
        when the decision arrived before the analysis was recorded, or when the
        same key is still processing (never 409); `TED-9002` when the audit
        trail cannot record the decision. Every 503 carries `Retry-After`.


        `X-Idempotency` is required and must be `<analysisId>:<decision>`;
        `X-Idempotency-Replayed: true` indicates a replay.
      operationId: resolveTransferFraudAnalysis
      parameters:
        - description: >-
            Replay window of the idempotency key, in seconds. Default 300 (5
            minutes) when missing or invalid; values outside 30 s to 7 days are
            adjusted to these limits. Only the value of the FIRST request for a
            key counts. A change to X-TTL on retries has no effect. Within the
            window, the original response is replayed byte for byte.
          in: header
          name: X-TTL
          schema:
            minimum: 1
            type: integer
        - description: Transfer identifier
          in: path
          name: transferId
          required: true
          schema:
            description: Transfer identifier
            format: uuid
            type: string
        - description: >-
            Required: `<analysisId>:<decision>`, for example `an-7f3c91:ALLOW`.
            Repeat a 5xx with the SAME key and the SAME body, byte for byte.
            Same key + same body returns the original response with
            `X-Idempotency-Replayed: true`. Same key + different body responds
            422 `TED-0012`. Same key still in processing responds 503 `TED-0053`
            with `Retry-After`, never 409. Missing or in the wrong format: 400
            `TED-0011`.
          in: header
          name: X-Idempotency
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/XRequestId'
      requestBody:
        content:
          application/json:
            examples:
              allow:
                summary: 'Final decision: release the transfer'
                value:
                  analysisId: an-7f3c91
                  decision: ALLOW
              deny:
                summary: 'Final decision: refuse the transfer'
                value:
                  analysisId: an-7f3c91
                  decision: DENY
                  reasons:
                    - code: R-102
                      description: Recipient on a watch list
            schema:
              properties:
                analysisId:
                  description: >-
                    The analysis id the partner received with its REVIEW: 1 to
                    64 printable ASCII characters, no space.
                  maxLength: 64
                  minLength: 1
                  type: string
                decision:
                  description: The final decision.
                  enum:
                    - ALLOW
                    - DENY
                  type: string
                reasons:
                  description: >-
                    Optional. A malformed entry is dropped and the decision
                    still applies; the reasons sent replace the evaluation's on
                    the check, an empty or omitted list included.
                  items:
                    type: object
                  type: array
              required:
                - analysisId
                - decision
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                amount: '1500.00'
                clientReference: PED-2026-000123
                createdAt: '2026-10-22T13:05:12Z'
                description: Supplier payment
                feeAmount: '3.25'
                metadata:
                  channel: mobile
                  orderId: PED-2026-000123
                purposeCode: '00010'
                recipient:
                  agency: '1234'
                  bankAccount: '0001234567'
                  bankAccountType: CACC
                  bankCode: '001'
                  bankId: '87654321'
                  document: '12345678909'
                  name: Maria da Silva
                reservedAt: '2026-10-22T13:05:13Z'
                sender:
                  accountId: 0a2f4c6e-8b1d-4e3f-9a5b-7c9d1e3f5a7b
                  agency: '0001'
                  bankAccount: '0001111222'
                  bankAccountType: CACC
                  bankId: '12345678'
                  document: '98765432100'
                  name: João Pereira
                status: SUBMITTED
                totalAmount: '1503.25'
                transferId: 6f1c2b3a-4d5e-4f60-8a9b-0c1d2e3f4a5b
                type: TED
                updatedAt: '2026-10-22T13:06:02Z'
              schema:
                $ref: '#/components/schemas/TransferResponse'
          description: >-
            Decision applied; `status` is the transfer's new state. If
            `X-Idempotency-Replayed: true`, this is the replay of an earlier
            decision.
          headers:
            X-Idempotency-Replayed:
              description: >-
                `true` when this response is the replay of a previous request
                with the same `X-Idempotency` (no new effect occurred). Absent
                when the request produced a new effect. Always check this
                header: the HTTP status and the body shape are the same in both
                cases. Within `X-TTL`, the replayed body is the original
                response, byte for byte; on `POST /v1/transfers`, a replay after
                `X-TTL` returns the transfer in its current state.
              schema:
                type: boolean
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Malformed JSON (`TED-0001`) or `X-Idempotency` missing/in the wrong
            format (`TED-0011`).
          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
            (`TED-0071`).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: The transfer does not exist in this institution (`TED-0010`).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Final, do not repeat: the analysis is not open for this decision
            (`TED-0060`).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Invalid body: `decision` must be `ALLOW` or `DENY`, `analysisId` 1
            to 64 printable characters, at most 16 KiB (`TED-0002`); or
            `X-Idempotency` reused with a different body (`TED-0012`): after a
            5xx on the same key this means the earlier outcome was not recorded,
            so do not repeat.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Unexpected failure (`TED-9000`). Retry with the SAME
            `X-Idempotency`. 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: >-
            Temporary, repeat with the same `X-Idempotency` after `Retry-After`:
            analysis still being recorded or the same key still processing
            (`TED-0053`), operating window undetermined on an `ALLOW`
            (`TED-0022`), audit trail unavailable (`TED-9002`), 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:
    TransferResponse:
      additionalProperties: false
      description: >-
        Representation of an outgoing (TED) or internal transfer. The create,
        query, and list operations return it, and so do the cancel and unblock
        actions. Track the lifecycle through the `status` field and the instants
        `reservedAt`/`submittedAt`/`settledAt`. When `status=REJECTED`,
        `rejection` tells you who refused it and why.
      properties:
        amount:
          description: Amount in BRL as a decimal string with two decimal places.
          examples:
            - '1500.00'
          pattern: ^(0\.(0[1-9]|[1-9][0-9])|[1-9][0-9]{0,11}\.[0-9]{2})$
          type: string
        clientReference:
          description: Requester reference sent with the transfer request.
          maxLength: 64
          type: string
        createdAt:
          description: Time (UTC) of creation.
          format: date-time
          type: string
        description:
          description: Description given in the send request.
          maxLength: 140
          type: string
        feeAmount:
          description: >-
            Fee, in BRL. After the hold, or after the settlement of an internal
            transfer, it is the fee that Midaz charged the sender. Before that,
            it is the estimate.
          examples:
            - '0.00'
          pattern: ^(0|[1-9][0-9]{0,11})\.[0-9]{2}$
          type: string
        fraudCheck:
          $ref: '#/components/schemas/FraudCheckBlock'
          description: >-
            Antifraud analysis of the transfer: the deadline and one check per
            antifraud flow enabled when it was created. null when it was created
            with every antifraud flow off. While status=FRAUD_ANALYSIS the
            analysis runs until the partner decides, you cancel or decideBy
            passes. A TED's amount is already held; an INTERNAL transfer's payer
            amount is held at the ledger right after entering the analysis, and
            a ledger refusal (insufficient balance) can still reject it.
        metadata:
          additionalProperties: {}
          description: >-
            Free-form key-value pairs from the requester, kept verbatim. Never
            sent to the STR. Sent to the client's antifraud partner when the
            client turns an antifraud flow on.
          maxProperties: 50
          type: object
        numCtrlStr:
          description: >-
            Identifier of the entry assigned by the STR (20 characters,
            XXXAAAAMMDDnnnnnnnnn), present after the STR settles the entry. It
            can be absent even with status=SETTLED, on a TED settled by
            reconciliation when the rail query does not give the number.
            Correlate by nuop in that case. A settlement fact that arrives later
            fills the field.
          pattern: ^[A-Za-z0-9]{20}$
          type: string
        nuop:
          description: >-
            SPB identifier of the operation, 23 digits. It can be absent even in
            status=SUBMITTED. In that case, correlate by railOperationId.
          pattern: ^[0-9]{23}$
          type: string
        purposeCode:
          description: Purpose code given in the send request (FinlddCli, 5 digits).
          examples:
            - '00001'
          pattern: ^[0-9]{5}$
          type: string
        railOperationId:
          description: Identifier of the operation in the rail (after acceptance).
          format: uuid
          type: string
        recipient:
          $ref: '#/components/schemas/PartyResponse'
          description: >-
            Recipient sent when the transfer was created. In an internal
            transfer it includes accountId.
        rejection:
          $ref: '#/components/schemas/RejectionResponse'
          description: Present only when status=REJECTED.
        reservedAt:
          description: >-
            Instant (UTC) when the amount and fee were put on hold in the source
            account. Start of the 30-min regulatory deadline for submission.
          format: date-time
          type: string
        returned:
          $ref: '#/components/schemas/TransferReturnSummary'
          description: >-
            Return received for this outgoing TED (credit back to the sender).
            Requires status=SETTLED and a LATER return from the recipient
            institution. For this reason it never appears in the creation
            response or in the list items, only in GET
            /v1/transfers/{transferId}.
        sender:
          $ref: '#/components/schemas/PartyResponse'
          description: Source account, always in your own institution (includes accountId).
        settledAt:
          description: Instant of settlement. Exists only from status=SETTLED.
          format: date-time
          type: string
        status:
          description: >-
            Current state (published as a free string: handle unknown values
            with tolerance). Current values: CREATED, RESERVED, SUBMITTED,
            PENDING_STR, SETTLED, REJECTED, CANCELLED, AWAITING_RECONCILIATION,
            EXHAUSTED, FRAUD_ANALYSIS. TED: CREATED → RESERVED (amount + fee on
            hold) → SUBMITTED (sent to the STR) → SETTLED | REJECTED;
            PENDING_STR when the STR keeps the entry pending;
            AWAITING_RECONCILIATION and EXHAUSTED when the outcome could not be
            confirmed automatically; CANCELLED on a cancellation before
            submission or of a confirmed pending entry; RESERVED →
            FRAUD_ANALYSIS when the antifraud partner asks for a review (the
            hold stays), then SUBMITTED, REJECTED or CANCELLED. INTERNAL:
            CREATED → SETTLED | REJECTED in the same call, or it stays CREATED
            when the ledger response was undetermined (the reconciliation worker
            resolves it); CREATED → FRAUD_ANALYSIS when the antifraud partner
            asks for a review (the payer's amount is held at the ledger), then
            SETTLED, REJECTED or CANCELLED. Terminal: SETTLED, REJECTED,
            CANCELLED.
          type: string
        submittedAt:
          description: >-
            Timestamp (UTC) when the rail accepted the TED for sending to the
            STR.
          format: date-time
          type: string
        totalAmount:
          description: >-
            Amount + fee: the total debited (on hold) from the source account,
            in BRL.
          examples:
            - '1500.00'
          pattern: ^(0|[1-9][0-9]{0,11})\.[0-9]{2}$
          type: string
        transferId:
          description: Transfer identifier. Use it in queries and actions.
          format: uuid
          type: string
        type:
          description: >-
            TED (another institution, through the STR) or INTERNAL (same
            institution, settled in the ledger).
          enum:
            - TED
            - INTERNAL
          type: string
        updatedAt:
          description: >-
            Time (UTC) of the last write to the record. This is not always a
            status change. ⚠️ An INTERNAL transfer can stay in CREATED because
            the ledger response was undetermined. In that case, the reprocessor
            uses updatedAt as the queue position on each new attempt, and it
            moves a transfer whose resend window expired one hour ahead:
            updatedAt CAN BE IN THE FUTURE (up to 1 h after the current time).
            Do not use it as a transition time.
          format: date-time
          type: string
      required:
        - transferId
        - type
        - status
        - amount
        - feeAmount
        - totalAmount
        - purposeCode
        - sender
        - recipient
        - createdAt
        - updatedAt
      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
    FraudCheckBlock:
      additionalProperties: false
      description: >-
        Antifraud analysis of a transfer or a received TED: the deadline
        (`decideBy`) and one check per antifraud flow enabled when it was
        created. Each check carries the partner's score and reasons as it sent
        them; their free text can carry third-party personal data.
      properties:
        checks:
          description: One entry per antifraud flow enabled when the transfer was created.
          items:
            $ref: '#/components/schemas/FraudCheckBlockItem'
          type: array
        decideBy:
          description: >-
            Deadline (UTC) of the antifraud analysis. After it, an unresolved
            analysis of a transfer is rejected, and an open review of a received
            TED expires.
          format: date-time
          type: string
      required:
        - decideBy
        - checks
      type:
        - object
        - 'null'
    PartyResponse:
      additionalProperties: false
      description: >-
        One of the parties to the transfer (sender or recipient). `accountId`
        exists only for the party that belongs to your institution. For the
        counterparty at another bank, the API returns the bank details that were
        sent.
      properties:
        accountId:
          description: >-
            Account in your own institution; present only for the party that
            belongs to it.
          format: uuid
          type: string
        agency:
          description: Branch.
          type: string
        bankAccount:
          description: Account number.
          type: string
        bankAccountType:
          description: >-
            Account type: CACC (checking), SVGS (savings), SLRY (salary), or
            TRAN (payment).
          enum:
            - CACC
            - SVGS
            - SLRY
            - TRAN
          type: string
        bankCode:
          description: COMPE code (3 digits), when known.
          pattern: ^[0-9]{3}$
          type: string
        bankId:
          description: >-
            ISPB of the institution (8 digits). Always present. Empty string
            when unknown.
          pattern: ^[0-9]{8}$
          type: string
        document:
          description: CPF (11 digits) or CNPJ (14 digits), digits only.
          examples:
            - '12345678909'
          pattern: ^([0-9]{11}|[0-9]{14})$
          type: string
        name:
          description: Name of the party, not truncated.
          type: string
      required:
        - bankId
      type: object
    RejectionResponse:
      additionalProperties: false
      description: >-
        Reason for a transfer in `status=REJECTED`. Validation and policy
        refusals NEVER appear here: they occur before the service creates any
        resource, and they return as 4xx/503 without a transfer body.
      properties:
        code:
          description: >-
            Rejection code, by source: LEDGER → TED-0031 (insufficient balance)
            or TED-1001; RAIL → TED-1010 (the STR connector could not reach the
            STR and stored nothing), TED-1011, TED-1013 (the rail closed the TED
            without an STR decision), or the rail's own refusal code; STR →
            SitLancSTR code or SFN error (example: STR0015 at the day close);
            OPERATOR → the code given in the unblock.
          examples:
            - TED-1011
          type: string
        reason:
          description: >-
            Rejection reason, as recorded on the transfer. Always present. Empty
            string when no text was recorded.
          type: string
        source:
          description: >-
            Source of the rejection, and when it can appear. LEDGER is decided
            SYNCHRONOUSLY: it can already be filled in the response of POST
            /v1/transfers. RAIL can also be there, or it can arrive later
            through reconciliation when the rail closed the TED without an STR
            decision (approval denied or expired; code TED-1013). ANTIFRAUD
            means the antifraud analysis refused the transfer or ran past
            decideBy: it can already be in the POST /v1/transfers response (a
            DENY or a closed posture at creation) or arrive later (resolve DENY,
            or the decideBy cut). STR and OPERATOR are always ASYNCHRONOUS: they
            never appear in the creation response. They are only visible in a
            later query.
          enum:
            - LEDGER
            - RAIL
            - STR
            - OPERATOR
            - ANTIFRAUD
          type: string
      required:
        - code
        - reason
        - source
      type: object
    TransferReturnSummary:
      additionalProperties: false
      description: >-
        Return received for a TED that this institution sent: the recipient
        institution returned the amount, and it was (or is being) credited back
        to the sender. Only appears in `GET /v1/transfers/{transferId}`, never
        in the creation response.
      properties:
        amount:
          description: >-
            Returned amount in BRL as a decimal string with two decimal places.
            The return is always in full, so it is always equal to the amount of
            the original transfer.
          examples:
            - '1500.00'
          pattern: ^(0\.(0[1-9]|[1-9][0-9])|[1-9][0-9]{0,11}\.[0-9]{2})$
          type: string
        feeRefunded:
          description: If the fee charged at sending was also reversed. Absent means false.
          type: boolean
        numCtrlStr:
          description: >-
            Identifier of the return entry assigned by the STR (20 characters).
            It can be absent.
          pattern: ^[A-Za-z0-9]{20}$
          type: string
        receivedAt:
          description: Instant when the return was recorded.
          format: date-time
          type: string
        refundedAt:
          description: >-
            Instant of the credit back to the sender. Exists only from
            status=REFUNDED.
          format: date-time
          type: string
        returnCode:
          description: Official return reason (CodDevTransf, SFN Domain Dictionary).
          examples:
            - '5'
          pattern: ^[0-9]{1,2}$
          type: string
        status:
          description: >-
            State of the return: RECEIVED (recorded), REFUNDED (re-credit
            settled in the ledger), or MANUAL_REVIEW (stopped for analysis).
          enum:
            - RECEIVED
            - REFUNDED
            - MANUAL_REVIEW
          type: string
      required:
        - returnCode
        - amount
        - status
        - receivedAt
      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
    FraudCheckBlockItem:
      additionalProperties: false
      description: >-
        One side's check: `flow` (OUT, INTRA_OUT, INTRA_IN, or IN for a received
        TED), the partner's `decision`, whether it came from the partner or the
        route posture (`origin`, `cause`), its `score` and `reasons`, and how a
        REVIEW closed (`resolution`, `resolvedAt`).
      properties:
        analysisId:
          description: Partner's analysis identifier, present on a REVIEW.
          type:
            - string
            - 'null'
        cause:
          description: >-
            Why the answer is a FALLBACK: TIMEOUT, UNAVAILABLE, BREAKER_OPEN,
            RATE_LIMITED, INVALID_RESPONSE, AUTH_ERROR, DEADLINE_PASSED or
            INVALID_CONFIG.
          type:
            - string
            - 'null'
        decision:
          description: >-
            The partner's verdict (ALLOW, REVIEW or DENY), or null when this
            side was not evaluated.
          type:
            - string
            - 'null'
        flow:
          description: Side of the transfer the check covers. IN is a received TED.
          enum:
            - OUT
            - INTRA_OUT
            - INTRA_IN
            - IN
          type: string
        origin:
          description: >-
            PROVIDER when the partner answered; FALLBACK when the route posture
            decided.
          type:
            - string
            - 'null'
        reasons:
          description: >-
            The partner's reasons, as it sent them; empty when it sent none.
            After a resolution, these are the resolution's, including an empty
            list. The descriptions are the partner's free text and can carry
            third-party personal data.
          items:
            $ref: '#/components/schemas/FraudCheckBlockReason'
          type: array
        resolution:
          description: How a REVIEW closed (ALLOW, DENY or EXPIRED), or null while open.
          type:
            - string
            - 'null'
        resolvedAt:
          description: Instant (UTC) the REVIEW closed, or null while open.
          format: date-time
          type:
            - string
            - 'null'
        score:
          description: >-
            The partner's opaque score, as it sent it; null when it sent none (a
            FALLBACK never has one).
          type:
            - string
            - 'null'
      required:
        - flow
        - decision
        - origin
        - cause
        - analysisId
        - score
        - reasons
        - resolution
        - resolvedAt
      type: object
    FraudCheckBlockReason:
      additionalProperties: false
      description: >-
        One reason the partner gave for its answer: its `code` and, when it sent
        one, its free-text `description`, as sent. The description can carry
        third-party personal data.
      properties:
        code:
          description: The partner's reason code.
          type: string
        description:
          description: The partner's free-text description of the reason, when it sent one.
          type: string
      required:
        - code
      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.