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

# Inconsistency findings between ledger and rail (open or resolved), with a count per check

> Lists the differences found between the ledger and what the STR reported for the same resource. Example: a return received without the matching re-credit. A finding stays `OPEN` while the difference continues, and changes to `CLEARED` when the service no longer observes it.

By default, the list shows the `OPEN` findings, from oldest to newest. Filter by `check`, `status`, and resource type. `openByCheck` gives the count of open findings per check for the whole tenant, for the dashboard. Findings are informational: you make the fix in the resources they point to.



## OpenAPI

````yaml /en/openapi/v3-current/ted-lerian.yaml get /v1/reconciliation/inconsistencies
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](/en/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/reconciliation/inconsistencies:
    get:
      tags:
        - Reconciliation
      summary: >-
        Inconsistency findings between ledger and rail (open or resolved), with
        a count per check
      description: >-
        Lists the differences found between the ledger and what the STR reported
        for the same resource. Example: a return received without the matching
        re-credit. A finding stays `OPEN` while the difference continues, and
        changes to `CLEARED` when the service no longer observes it.


        By default, the list shows the `OPEN` findings, from oldest to newest.
        Filter by `check`, `status`, and resource type. `openByCheck` gives the
        count of open findings per check for the whole tenant, for the
        dashboard. Findings are informational: you make the fix in the resources
        they point to.
      operationId: listInconsistencyFindings
      parameters:
        - description: Checks to list, separated by commas. Missing = all.
          explode: false
          in: query
          name: check
          schema:
            description: Checks to list, separated by commas. Missing = all.
            items:
              enum:
                - RETURN_WITHOUT_REFUND
                - ORPHAN_HOLD
                - SETTLED_WITHOUT_COMMIT
                - RESERVED_AFTER_RELEASE
                - LEDGER_STATUS_CONTRADICTION
                - CREDIT_WITHOUT_FACT
                - CREDIT_STATUS_CONTRADICTION
                - RETURN_WITHOUT_REVERT
              type: string
            type: array
        - description: 'State of the findings: OPEN (default) or CLEARED.'
          explode: false
          in: query
          name: status
          schema:
            default: OPEN
            description: 'State of the findings: OPEN (default) or CLEARED.'
            enum:
              - OPEN
              - CLEARED
            type: string
        - description: Resource type. Missing = both.
          explode: false
          in: query
          name: resource_type
          schema:
            description: Resource type. Missing = both.
            enum:
              - TRANSFER
              - INCOMING_TRANSFER
            type: string
        - description: Maximum items per page
          explode: false
          in: query
          name: limit
          schema:
            default: 20
            description: Maximum items per page
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Opaque cursor returned in next_cursor
          explode: false
          in: query
          name: cursor
          schema:
            description: Opaque cursor returned in next_cursor
            maxLength: 512
            type: string
        - $ref: '#/components/parameters/XRequestId'
      responses:
        '200':
          content:
            application/json:
              example:
                items:
                  - amount: '1500.00'
                    check: SETTLED_WITHOUT_COMMIT
                    detail: SETTLED transfer with no ledger_commit_id recorded.
                    firstDetectedAt: '2026-10-22T13:10:00Z'
                    id: d0a6b2c4-5e7f-4a91-8c3d-4e6f8a0b2c3d
                    lastDetectedAt: '2026-10-22T13:40:00Z'
                    nuop: '87654321202610220000123'
                    observedStatus: SETTLED
                    organizationId: 0f1e2d3c-4b5a-4968-8776-655443322110
                    resourceId: 6f1c2b3a-4d5e-4f60-8a9b-0c1d2e3f4a5b
                    resourceType: TRANSFER
                    status: OPEN
                limit: 20
                next_cursor: null
                openByCheck:
                  CREDIT_STATUS_CONTRADICTION: 0
                  CREDIT_WITHOUT_FACT: 0
                  LEDGER_STATUS_CONTRADICTION: 0
                  ORPHAN_HOLD: 0
                  RESERVED_AFTER_RELEASE: 0
                  RETURN_WITHOUT_REFUND: 0
                  RETURN_WITHOUT_REVERT: 0
                  SETTLED_WITHOUT_COMMIT: 1
                prev_cursor: null
              schema:
                $ref: '#/components/schemas/InconsistencyFindingPage'
          description: >-
            Page of findings and, in `openByCheck`, the count of open findings
            per check across the whole tenant.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Invalid query parameter: cursor, date range, status, or filter in
            the wrong format (`TED-0001`).
          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`).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Parameter outside the declared format (for example, a `date` that is
            not YYYY-MM-DD): framework validation, with no TED code.
          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: 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:
    InconsistencyFindingPage:
      additionalProperties: false
      description: >-
        Page of inconsistency findings, with the count of open findings per
        check for the whole tenant.
      properties:
        items:
          description: Findings on the page.
          items:
            $ref: '#/components/schemas/InconsistencyFinding'
          type: array
        limit:
          description: Actual page size, already limited to the contract maximum.
          format: int64
          type: integer
        next_cursor:
          description: Token of the next page; null when there is none.
          type:
            - string
            - 'null'
        openByCheck:
          additionalProperties:
            format: int64
            type: integer
          description: >-
            OPEN findings per check for the whole tenant, regardless of the
            filter. Always includes the eight checks.
          type: object
        prev_cursor:
          description: 'Always null: the list only moves forward.'
          type:
            - string
            - 'null'
      required:
        - items
        - limit
        - openByCheck
      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
    InconsistencyFinding:
      additionalProperties: false
      description: >-
        A mismatch between what the ledger records and what the rail (STR)
        reported for the same resource. It stays OPEN while it is observed and
        changes to CLEARED when it is no longer observed.
      properties:
        amount:
          description: Amount (BRL).
          examples:
            - '1500.00'
          pattern: ^(0|[1-9][0-9]{0,11})\.[0-9]{2}$
          type: string
        check:
          description: Consistency check that created the finding.
          enum:
            - RETURN_WITHOUT_REFUND
            - ORPHAN_HOLD
            - SETTLED_WITHOUT_COMMIT
            - RESERVED_AFTER_RELEASE
            - LEDGER_STATUS_CONTRADICTION
            - CREDIT_WITHOUT_FACT
            - CREDIT_STATUS_CONTRADICTION
            - RETURN_WITHOUT_REVERT
          type: string
        clearedAt:
          description: >-
            Time when the service stopped observing the inconsistency; absent
            while OPEN.
          format: date-time
          type: string
        detail:
          description: Description of the observed inconsistency.
          type: string
        firstDetectedAt:
          description: First detection. Sort key of the list (oldest first).
          format: date-time
          type: string
        id:
          description: Identifier of the finding.
          format: uuid
          type: string
        lastDetectedAt:
          description: Last detection.
          format: date-time
          type: string
        nuop:
          description: Unique operation number on the rail (ISPB[8]+AAAAMMDD[8]+SEQ[7])
          pattern: ^[0-9]{23}$
          type: string
        observedStatus:
          description: Status of the resource at the last detection.
          type: string
        organizationId:
          description: Organization of the resource. Missing when not resolved.
          format: uuid
          type: string
        reopenedAt:
          description: >-
            Last reopening of a finding that was already resolved. Missing if it
            was never reopened.
          format: date-time
          type: string
        resourceId:
          description: Identifier of the resource (transferId or incomingTransferId).
          format: uuid
          type: string
        resourceType:
          description: >-
            Type of the inconsistent resource: sent TED (TRANSFER) or incoming
            TED (INCOMING_TRANSFER).
          enum:
            - TRANSFER
            - INCOMING_TRANSFER
          type: string
        status:
          description: >-
            OPEN while the inconsistency continues; CLEARED when it is no longer
            observed.
          enum:
            - OPEN
            - CLEARED
          type: string
      required:
        - id
        - check
        - resourceType
        - resourceId
        - status
        - observedStatus
        - detail
        - firstDetectedAt
        - lastDetectedAt
      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.