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

# Confirmar la liquidación agregada (liquidación — Phase 2)

> Se informa o consulta el resultado de red de la devolución agregada. Cuando result=SUCCESS, los bloqueos del grupo cambian a SETTLED y la respuesta incluye los datos agregados de liquidación: importe efectivamente devuelto, end-to-end ID agregado, importes ya liquidados y excedentes, y tipo y motivo de liquidación. Cuando result=FAILED, los bloqueos vuelven a PENDING y esos datos permanecen null. La omisión de result consulta el estado actual del grupo sin modificarlo. La devolución permanece OPEN hasta que se cierre por separado. result, cuando se informa, debe ser SUCCESS o FAILED; endToEndId es obligatorio para SUCCESS. Solo el tenant del participante solicitante puede confirmar su propia devolución.



## OpenAPI

````yaml es/openapi/v3-current/pix-lerian-dict.yaml POST /dict/refunds/{id}/settle/confirm
openapi: 3.1.0
info:
  contact:
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    API pública para claves Pix, reclamos, marcadores de fraude, reportes de
    infracción y recuperación de fondos del MED.
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
  title: Pix Lerian — DICT
  version: release-candidate
servers:
  - url: https://api.example.com/dict-hub/v1
    description: >-
      El host de ejemplo debe reemplazarse por la URL proporcionada durante el
      onboarding del entorno.
security:
  - BearerAuth: []
tags:
  - description: Registro, consulta, listado, actualización y eliminación de claves Pix.
    name: Entries
  - description: >-
      Consulta de claves Pix y verificación de su existencia en el directorio
      DICT.
    name: Keys
  - description: Gestión de reclamaciones de titularidad y portabilidad de claves Pix.
    name: Claims
  - description: Gestión de recuperaciones de fondos de MED 2.0 asociadas al participante.
    name: Funds Recoveries
  - description: >-
      Gestión de reportes de infracción de MED 2.0 para la organización
      autenticada.
    name: Infraction Reports
  - description: Creación, consulta, cancelación y liquidación de devoluciones de MED 2.0.
    name: Refunds
  - description: Creación, consulta, listado y cancelación de marcadores de fraude de DICT.
    name: Fraud Markers
paths:
  /dict/refunds/{id}/settle/confirm:
    post:
      tags:
        - Refunds
      summary: Confirmar la liquidación agregada (liquidación — Phase 2)
      description: >-
        Se informa o consulta el resultado de red de la devolución agregada.
        Cuando result=SUCCESS, los bloqueos del grupo cambian a SETTLED y la
        respuesta incluye los datos agregados de liquidación: importe
        efectivamente devuelto, end-to-end ID agregado, importes ya liquidados y
        excedentes, y tipo y motivo de liquidación. Cuando result=FAILED, los
        bloqueos vuelven a PENDING y esos datos permanecen null. La omisión de
        result consulta el estado actual del grupo sin modificarlo. La
        devolución permanece OPEN hasta que se cierre por separado. result,
        cuando se informa, debe ser SUCCESS o FAILED; endToEndId es obligatorio
        para SUCCESS. Solo el tenant del participante solicitante puede
        confirmar su propia devolución.
      operationId: confirmSettleRefund
      parameters:
        - description: >-
            Clave generada por el cliente para reintentar exactamente la misma
            solicitud de forma segura.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 64
            minLength: 1
            type: string
            description: >-
              Clave generada por el cliente para reintentar exactamente la misma
              solicitud de forma segura.
          example: pix-demo-20260903-000001
        - description: Refund internal ID (UUID format)
          in: path
          name: id
          required: true
          schema:
            description: Refund internal ID (UUID format)
            examples:
              - 018f8c1d-1234-7abc-9def-000000000010
            type: string
          example: 01960718-a213-2435-6078-901234567123
        - description: >-
            Best-effort business correlation id (observability only; never
            fabricated).
          in: header
          name: X-Correlation-Id
          schema:
            description: >-
              Best-effort business correlation id (observability only; never
              fabricated).
            type: string
          example: 019606a1-3b4c-7d8e-9f01-234567890abc
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfirmSettleRefundBody'
            examples:
              ejemploFicticio:
                summary: Ejemplo ficticio
                value:
                  endToEndId: D12345678202601011200abcdef01234
                  failureReason: failurereason-example
                  result: SUCCESS
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfirmSettleRefundView'
              examples:
                ejemploFicticio:
                  summary: Ejemplo ficticio
                  value:
                    alreadySettled: '50.00'
                    blocks:
                      - amount: '120.00'
                        lockId: b0f5c2a1-9e3d-4c7a-8f21-1a2b3c4d5e6f
                        spiBlockId: 7c9a1b2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
                    blocksStatus: SETTLING
                    endToEndId: 019606a1-3b4c-7d8e-9f01-234567890abc
                    failureReason:
                      message: falha no Midaz ao liberar o bloqueio
                    operationType: ROOT
                    originalAmount: '200.00'
                    refundId: 018f8c1d-1234-7abc-9def-000000000010
                    settleAmount: '150.00'
                    settleReason: FR01
                    settleType: REFUND
                    settled: false
                    status: OPEN
                    surplusAmount: '50.00'
          description: OK
        '400':
          content:
            application/json:
              example:
                code: PIX-0030
                title: Idempotency Key Required
                message: >-
                  The Idempotency-Key header is required for this operation and
                  must be within the accepted length.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Idempotency-Key absent or longer than 64 bytes (PIX-0030). Legacy
            {code,title,message} envelope, NOT problem+json.
        '412':
          content:
            application/json:
              example:
                code: PIX-0031
                title: Idempotency Key Conflict
                message: The Idempotency-Key was already used with a different request.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Idempotency-Key replayed with a divergent request -- a different
            method, URL (including the path parameter), body, or identity header
            among X-Account-Id / X-Reason / X-End-To-End-Id (PIX-0031). Legacy
            {code,title,message} envelope, NOT problem+json.
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      x-codeSamples:
        - lang: bash
          label: cURL con datos ficticios
          source: |-
            curl --request POST \
              --url https://api.example.com/dict-hub/v1/dict/refunds/01960718-a213-2435-6078-901234567123/settle/confirm \
              --header 'Authorization: Bearer demo-access-token' \
              --header 'Content-Type: application/json' \
              --header 'Idempotency-Key: pix-demo-20260903-000001' \
              --header 'X-Correlation-Id: 019606a1-3b4c-7d8e-9f01-234567890abc' \
              --data '{
              "endToEndId": "D12345678202601011200abcdef01234",
              "failureReason": "failurereason-example",
              "result": "SUCCESS"
            }'
components:
  schemas:
    ConfirmSettleRefundBody:
      additionalProperties: false
      properties:
        endToEndId:
          examples:
            - D12345678202601011200abcdef01234
          type: string
        failureReason:
          type: string
        result:
          enum:
            - SUCCESS
            - FAILED
          examples:
            - SUCCESS
          type: string
      type: object
    ConfirmSettleRefundView:
      additionalProperties: false
      properties:
        alreadySettled:
          examples:
            - '50.00'
          type: string
        blocks:
          items:
            $ref: '#/components/schemas/SettleBlockView'
          type:
            - array
            - 'null'
        blocksStatus:
          enum:
            - SETTLING
            - PENDING
            - SETTLED
          examples:
            - SETTLING
          type: string
        endToEndId:
          type: string
        failureReason:
          $ref: '#/components/schemas/ConfirmSettleFailureView'
        operationType:
          enum:
            - ROOT
            - SUBSEQUENT
            - UNKNOWN
          examples:
            - ROOT
          type: string
        originalAmount:
          examples:
            - '200.00'
          type: string
        refundId:
          examples:
            - 018f8c1d-1234-7abc-9def-000000000010
          type: string
        settleAmount:
          examples:
            - '150.00'
          type: string
        settleReason:
          examples:
            - FR01
          type: string
        settleType:
          enum:
            - REFUND
            - MANUAL
          examples:
            - REFUND
          type: string
        settled:
          examples:
            - false
          type: boolean
        status:
          enum:
            - OPEN
            - CLOSED
            - CANCELLED
          examples:
            - OPEN
          type: string
        surplusAmount:
          examples:
            - '50.00'
          type: string
      required:
        - refundId
        - status
        - operationType
        - originalAmount
        - alreadySettled
        - blocksStatus
      type: object
    LegacyErrorEnvelope:
      additionalProperties: false
      properties:
        code:
          description: PIX-XXXX error code
          type: string
        message:
          description: Human-readable error message
          type: string
        title:
          description: Short error title
          type: string
      required:
        - code
        - title
        - message
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          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
    SettleBlockView:
      additionalProperties: false
      properties:
        amount:
          examples:
            - '120.00'
          type: string
        lockId:
          examples:
            - b0f5c2a1-9e3d-4c7a-8f21-1a2b3c4d5e6f
          type: string
        spiBlockId:
          examples:
            - 7c9a1b2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
          type: string
      required:
        - lockId
        - spiBlockId
        - amount
      type: object
    ConfirmSettleFailureView:
      additionalProperties: false
      properties:
        message:
          examples:
            - falha no Midaz ao liberar o bloqueio
          type: string
      required:
        - message
      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

````