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

# Confirm a cautionary block settlement

> Applies the outcome of the devolution that Settle a cautionary block started: the lock becomes `SETTLED` when the devolution was paid, goes back to `PENDING` when it was rejected, and stays as it is while the devolution is in flight. The call carries no result, because Pix Lerian reads it from the devolution. Repeat the call until the lock leaves `SETTLING`.

A `pix_manual` surplus is returned once, when the lock settles. If that return fails, the lock stays `SETTLED` and the answer is `200` without `surplus_midaz_tx_id`; this does not prove that the surplus stayed blocked. Check the ledger, then use [Return a settlement surplus to the account holder](/en/reference/interfaces/pix-lerian/spi/return-a-settlement-surplus-to-the-account-holder). A lock whose surplus was already returned is refused with `409` (`PIX-0656`) and stays `SETTLING`.

`X-Actor-Id`, `X-Override-Reason` and `X-Override-Ticket` are optional. Sending any of them records the confirmation in the audit trail. For a lock opened for a MED infraction (`origin_system` `med-infraction`), use [Confirm settle refund](/en/reference/interfaces/pix-lerian/dict/confirm-settle-refund) instead: DICT holds MED state that this route cannot see.



## OpenAPI

````yaml /en/openapi/v3-current/pix-lerian-spi.yaml post /balance-locks/{lock_id}/settle/confirm
openapi: 3.1.0
info:
  contact:
    name: Lerian Studio
    url: https://lerian.studio
  description: Public API for outbound Pix transfers, refunds, and scheduled payments.
  license:
    name: Lerian Studio General License
  title: Pix Lerian — Payments
  version: 1.2.0
servers:
  - url: https://api.example.com/spi/v1
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
tags:
  - description: Create, list, and retrieve Pix refunds.
    name: Refunds
  - name: Scheduled Payments
    description: Register, list, retrieve, and cancel scheduled Pix payments.
  - description: Initiate, process, list, and retrieve outbound Pix transfers.
    name: Transfers
  - description: >-
      Register, list, retrieve, and cancel recurring series of scheduled Pix
      payments.
    name: Scheduled Payment Recurrences
  - description: >-
      Hold the funds of a received Pix in a cautionary block (MED 2.0), return
      them to the payer, or give them back to the account holder.
    name: Balance Locks
paths:
  /balance-locks/{lock_id}/settle/confirm:
    post:
      tags:
        - Balance Locks
      summary: Confirm a cautionary block settlement
      description: >-
        Applies the outcome of the devolution that Settle a cautionary block
        started: the lock becomes `SETTLED` when the devolution was paid, goes
        back to `PENDING` when it was rejected, and stays as it is while the
        devolution is in flight. The call carries no result, because Pix Lerian
        reads it from the devolution. Repeat the call until the lock leaves
        `SETTLING`.


        A `pix_manual` surplus is returned once, when the lock settles. If that
        return fails, the lock stays `SETTLED` and the answer is `200` without
        `surplus_midaz_tx_id`; this does not prove that the surplus stayed
        blocked. Check the ledger, then use [Return a settlement surplus to the
        account
        holder](/en/reference/interfaces/pix-lerian/spi/return-a-settlement-surplus-to-the-account-holder).
        A lock whose surplus was already returned is refused with `409`
        (`PIX-0656`) and stays `SETTLING`.


        `X-Actor-Id`, `X-Override-Reason` and `X-Override-Ticket` are optional.
        Sending any of them records the confirmation in the audit trail. For a
        lock opened for a MED infraction (`origin_system` `med-infraction`), use
        [Confirm settle
        refund](/en/reference/interfaces/pix-lerian/dict/confirm-settle-refund)
        instead: DICT holds MED state that this route cannot see.
      operationId: confirmSettle
      parameters:
        - description: >-
            REQUIRED. Client-supplied replay key, at most 64 bytes. A request
            without it is refused with PIX-0030 @ 400 before the handler runs.
            An identical resend within 1 hour returns the original response,
            status included, with X-Idempotency-Replayed: true. Reusing the key
            with a divergent method, URL or body is PIX-0031 @ 412.
          in: header
          name: X-Idempotency
          required: true
          schema:
            maxLength: 64
            minLength: 1
            type: string
        - description: Balance lock UUID
          in: path
          name: lock_id
          required: true
          schema:
            description: Balance lock UUID
            examples:
              - 01a17cf3-128e-7c41-9b2e-5d7a3f8c1e60
            type: string
        - description: >-
            Who is acting. Declared by the caller; not verified against the
            access token
          in: header
          name: X-Actor-Id
          schema:
            description: >-
              Who is acting. Declared by the caller; not verified against the
              access token
            examples:
              - backoffice.ops@example.com
            type: string
        - description: Why the caller is acting
          in: header
          name: X-Override-Reason
          schema:
            description: Why the caller is acting
            examples:
              - manual devolution paid by Pix
            type: string
        - description: Ticket reference
          in: header
          name: X-Override-Ticket
          schema:
            description: Ticket reference
            examples:
              - MED-4821
            type: string
        - description: Correlation id
          in: header
          name: X-Correlation-Id
          schema:
            description: Correlation id
            examples:
              - med-2026-000123
            type: string
        - description: Request id
          in: header
          name: X-Request-Id
          schema:
            description: Request id
            examples:
              - 01a17e29-5302-7c0a-b5e1-94d2f6a83c17
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                lock_id: 01a17cf3-128e-7c41-9b2e-5d7a3f8c1e60
                payment_type: PIX_MANUAL
                status: SETTLED
                pix_end_to_end_id: E87654321202610271405m3Hs7Yc5Pv1
                settled_at: '2026-10-27T14:06:03Z'
                surplus_midaz_tx_id: 01a17dae-b16e-7f28-9a03-6b1c4d8e2f75
              schema:
                $ref: '#/components/schemas/ConfirmSettleResponse'
          description: OK
        '400':
          content:
            application/json:
              example:
                code: PIX-0030
                title: Idempotency Key Required
                message: >-
                  The X-Idempotency header is required for this operation and
                  must be within the accepted length.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0015
                title: Bad Request
                status: 400
                detail: One or more path parameters are invalid.
                code: PIX-0015
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            A duplicated or padded attribution header (PIX-0001), an oversized
            attribution header (PIX-0003), or a lock_id that is not a UUID
            (PIX-0015). X-Idempotency absent or longer than 64 bytes (PIX-0030).
            Legacy {code,title,message} envelope, NOT problem+json. Route-guard
            refusals (PIX-0001) answer in the legacy {code,title,message}
            envelope too.
        '404':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0011
                title: Not Found
                status: 404
                detail: >-
                  No entity was found for the given ID. Please make sure to use
                  the correct ID.
                code: PIX-0011
              schema:
                $ref: '#/components/schemas/Detail'
          description: No lock exists for lock_id (PIX-0011).
        '409':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0012
                title: Conflict
                status: 409
                detail: >-
                  The entity already exists or conflicts with an existing
                  resource.
                code: PIX-0012
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The lock is PENDING or RELEASED, or a concurrent update won
            (PIX-0012); the payment was rejected but the lock or its settle
            group already returned the surplus (PIX-0656).
        '412':
          content:
            application/json:
              example:
                code: PIX-0031
                title: Idempotency Key Conflict
                message: >-
                  The X-Idempotency header is held by a request still running or
                  whose receipt could not be stored, or was already used with a
                  different request.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
          description: >-
            Refused under this X-Idempotency (PIX-0031): the first request under
            it is still running (with Retry-After: 1), its receipt could not be
            stored and the key is held for the hour, or the request differs from
            the first (method, URL, body or identity header). An earlier request
            under this key may already have executed. Legacy
            {code,title,message} envelope, NOT problem+json.
        '422':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0328
                title: Unprocessable Entity
                status: 422
                detail: >-
                  The ledger account is blocked and cannot be used for the
                  requested operation.
                code: PIX-0328
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            A rejected pixRefund whose re-hold, or a completed devolution whose
            cancel of a left-behind re-hold, finds a blocked ledger account
            (PIX-0328); a rejected pixRefund whose re-hold finds a closed
            account or one whose status forbids sending (PIX-0332); a rejected
            pixRefund whose re-hold finds an account without a ledger alias
            (PIX-0655); no blocking account is configured for the participant
            (PIX-0650).
        '500':
          content:
            application/json:
              example:
                code: PIX-0000
                title: Internal Server Error
                message: >-
                  The server encountered an unexpected error. Please try again
                  later.
              schema:
                $ref: '#/components/schemas/LegacyErrorEnvelope'
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0000
                title: Internal Server Error
                status: 500
                detail: >-
                  The server could not complete the request. Please try again
                  later.
                code: PIX-0000
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Unexpected server error (PIX-0000). With attribution headers, the
            confirm may already have taken effect when the audit record fails.
        '502':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0652
                title: Bad Gateway
                status: 502
                detail: >-
                  The server could not complete the request. Please try again
                  later.
                code: PIX-0652
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            A completed devolution whose ledger search for, or cancel of, a
            left-behind re-hold failed, the lock staying SETTLING: repeat the
            confirm (PIX-0652). A rejected pixRefund whose re-hold failed in the
            ledger, or was refused after an automatic retry so it may stand
            (PIX-0652); with a detail naming overrides.allowFeeSkip, the lock
            stays SETTLING: repeat the confirm once it is enabled on the ledger
            that holds the blocking account.
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    ConfirmSettleResponse:
      additionalProperties: false
      properties:
        failure_reason:
          type: string
        lock_id:
          examples:
            - 01a17cf3-128e-7c41-9b2e-5d7a3f8c1e60
          type: string
        payment_type:
          examples:
            - PIX_MANUAL
          type: string
        pix_end_to_end_id:
          examples:
            - E87654321202610271405m3Hs7Yc5Pv1
          type: string
        reset_at:
          examples:
            - '2026-10-27T14:06:03Z'
          format: date-time
          type: string
        settled_at:
          examples:
            - '2026-10-27T14:06:03Z'
          format: date-time
          type: string
        status:
          examples:
            - SETTLED
          type: string
        surplus_midaz_tx_id:
          description: >-
            On SETTLED, the Midaz transaction that returned the pixManual
            surplus to the customer: made by this confirm once the lock is
            SETTLED, or already recorded (a replay, or a group member's). Absent
            when there is no surplus, or when the best-effort return failed --
            recover it with POST /balance-locks/{lock_id}/return-surplus.
          examples:
            - 01a17dae-b16e-7f28-9a03-6b1c4d8e2f75
          type: string
      required:
        - lock_id
        - status
      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
        fields:
          additionalProperties:
            type: string
          description: Per-field detail, keyed by the field or header the refusal names
          type: object
        headers:
          additionalProperties:
            type: string
          description: Per-header detail, keyed by the request header the refusal names
          type: object
      required:
        - code
        - title
        - message
      type: object
    Detail:
      additionalProperties: true
      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
    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

````

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