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

# Reconcile an operation against the counterpart's settlement status

> Consults Núclea for the AUTHORITATIVE SLC0908 settlement status of one operation and synchronises the local record under NUCLEA_RECONCILED, leaving an operation_state_log row whose trigger separates a machine synchronisation from an operator's override. Admin-only (operations:admin). The reason is mandatory and enforced by the domain (400 MISSING_OVERRIDE_JUSTIFICATION); the reconciling subject is taken from the validated request identity, never from the payload. WHY THIS PATH EXISTS ALONGSIDE THE DRAINS: the /v1/connectivity/* recovery verbs (dispatch, forward, repoll, status-relay, reprocess, unpark) re-drive OUR OWN internal transport and never consult the counterpart, so they cannot report what Núclea believes — this operation asks Núclea and records the answer. Disjoint capabilities, not substitutes. Only FORWARDED->CONFIRMED and CONFIRMED->SETTLED are driveable: a counterpart state further away is refused rather than walked (409 INVALID_STATE_TRANSITION), because walking it would fabricate an intermediate transition nobody observed. An operation carrying no NUliquid has no key to run the consulta with and answers 409 SLC-0119 with the state-specific remediation. A counterpart status outside the mapped vocabulary answers 409 SLC-0121 and writes nothing.



## OpenAPI

````yaml /en/openapi/v3-current/slc.yaml post /v1/operations/{operationId}/reconcile
openapi: 3.1.0
info:
  description: >-
    API for Lerian SLC — the participant-side rail that connects the institution
    to Núclea's SLC card settlement.
  title: Lerian SLC API
  version: 1.0.0
servers:
  - url: https://slc.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - description: >-
      Settlement operation lifecycle — create, list, query, and control the
      NUliquid-tracked card operations (NUliquid = the 21-position id Núclea
      assigns each accepted operation) through the state machine.
    name: Operations
  - description: >-
      Participant catalog — the acquirers, sub-acquirers, IF Domicílio (bank
      where the merchant receives its sales), and settlement FIs (financial
      institutions) that take part in card settlement.
    name: Participants
  - description: >-
      Card arrangements (bandeira/scheme configurations, e.g. Visa/Master/Elo)
      attached to a participant.
    name: Arrangements
  - description: >-
      Regulated transport orchestration to Núclea's SLC — dispatch, recovery,
      retransmission, and connectivity testing over managed file-transfer,
      message-broker, and REST.
    name: Connectivity
  - description: >-
      Multilateral netting clearing positions — the net amount each participant
      settles per STR cycle (STR = Banco Central reserves-transfer system).
    name: Clearing
  - description: >-
      SaaS BYOK (Bring Your Own Key) signing-key provisioning — import
      parameters and register the client's ICP-Brasil server-type certificate
      material used to sign ASLC files (RSA, at least 2048 bits, and valid at
      the moment of import — all three are enforced); the SLC never receives the
      private key in cleartext.
    name: SigningKey
  - description: >-
      ASLC file intake and status — passthrough submission and processing status
      of the official Núclea card-settlement XML files (ASLC = Arquivo do
      Sistema de Liquidação de Cartões).
    name: Files
  - description: >-
      Read-only introspection of the embedded Núclea ASLC/RSFN (National
      Financial System Network) XSD schemas used to validate outbound and
      inbound messages.
    name: XSD Schemas
  - description: Read-only regulatory, compliance, and operational settlement reports.
    name: Reports
  - description: >-
      Outbound business-event webhook subscriptions and delivery management for
      consumers (client ledgers — optional).
    name: Webhooks
  - description: >-
      Administrative operations — hot-reloadable runtime configuration,
      dead-letter-queue inspection/replay, and outbox redispatch.
    name: Admin
paths:
  /v1/operations/{operationId}/reconcile:
    post:
      tags:
        - Operations
      summary: Reconcile an operation against the counterpart's settlement status
      description: >-
        Consults Núclea for the AUTHORITATIVE SLC0908 settlement status of one
        operation and synchronises the local record under NUCLEA_RECONCILED,
        leaving an operation_state_log row whose trigger separates a machine
        synchronisation from an operator's override. Admin-only
        (operations:admin). The reason is mandatory and enforced by the domain
        (400 MISSING_OVERRIDE_JUSTIFICATION); the reconciling subject is taken
        from the validated request identity, never from the payload. WHY THIS
        PATH EXISTS ALONGSIDE THE DRAINS: the /v1/connectivity/* recovery verbs
        (dispatch, forward, repoll, status-relay, reprocess, unpark) re-drive
        OUR OWN internal transport and never consult the counterpart, so they
        cannot report what Núclea believes — this operation asks Núclea and
        records the answer. Disjoint capabilities, not substitutes. Only
        FORWARDED->CONFIRMED and CONFIRMED->SETTLED are driveable: a counterpart
        state further away is refused rather than walked (409
        INVALID_STATE_TRANSITION), because walking it would fabricate an
        intermediate transition nobody observed. An operation carrying no
        NUliquid has no key to run the consulta with and answers 409 SLC-0119
        with the state-specific remediation. A counterpart status outside the
        mapped vocabulary answers 409 SLC-0121 and writes nothing.
      operationId: reconcileOperation
      parameters:
        - description: Operation id (UUID).
          in: path
          name: operationId
          required: true
          schema:
            description: Operation id (UUID).
            examples:
              - 018f8a3e-4b2c-7c1a-9e5d-2f6a1b3c4d5e
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReconcileRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReconcileResponse'
          description: OK
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        '501':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Not Implemented: this capability is not part of this deployment.
            Operations are registered unconditionally so the published contract
            is identical across deploy shapes; when the capability behind one
            did not compose here (authentication disabled, no database, no
            outbound transport, or the feature switched off) it answers this
            coded SLC-0012 problem. It is definitive for this deployment:
            retrying does not help, and the `detail` is deliberately scrubbed
            (any status >= 500 is).
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    ReconcileRequest:
      additionalProperties: false
      properties:
        participantIspb:
          description: >-
            ISPB (8 characters) the SLC0908 consulta is run on behalf of. A
            resource selector for the counterpart node, not an identity claim.
          examples:
            - '12345678'
          type: string
        reason:
          description: >-
            Audit justification (mandatory; enforced by the domain). At most
            1024 characters. This verb takes no evidence — the counterpart's
            answer is the evidence.
          examples:
            - operation stuck at FORWARDED after the ASLC023 window closed
          maxLength: 1024
          type: string
      type: object
    ReconcileResponse:
      additionalProperties: false
      properties:
        action:
          description: >-
            Outcome class: IN_SYNC (the two ledgers already agreed, nothing
            written) or SYNCHRONIZED (the local record was advanced).
          enum:
            - IN_SYNC
            - SYNCHRONIZED
          examples:
            - SYNCHRONIZED
          type: string
        controlNumber:
          description: >-
            Counterpart control number correlating the operation, when the
            answer carried one.
          examples:
            - CTRL-0042
          type: string
        counterpartStatus:
          description: >-
            The counterpart's RAW SLC0908 settlement status, echoed verbatim
            rather than re-rendered through this service's vocabulary.
          examples:
            - CONFIRMED
          type: string
        localState:
          description: Local state after the reconcile.
          examples:
            - CONFIRMED
          type: string
        operationId:
          description: Operation id (UUID) that was reconciled.
          examples:
            - 018f8a3e-4b2c-7c1a-9e5d-2f6a1b3c4d5e
          type: string
        previousState:
          description: >-
            Local state before the reconcile. Equal to localState on an IN_SYNC
            run.
          examples:
            - FORWARDED
          type: string
        reconciledBy:
          description: >-
            Authenticated subject who requested the reconcile, taken from the
            validated request identity and never from the payload.
          examples:
            - ops@acquirer.com
          type: string
        trigger:
          description: >-
            Transition trigger (always NUCLEA_RECONCILED). Absent on an IN_SYNC
            run, where no transition was persisted.
          examples:
            - NUCLEA_RECONCILED
          type: string
      required:
        - operationId
        - action
        - previousState
        - localState
        - counterpartStatus
        - reconciledBy
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        correlationId:
          description: Request-scoped correlation identifier echoing X-Request-ID.
          examples:
            - req-7a3f9c2e
          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.
      required:
        - correlationId
      type: object
    ErrorDetail:
      additionalProperties: false
      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
      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
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````