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

# Quote the amount left to settle

> Returns, for the received Pix identified by its original `end_to_end_id`, the `original_amount`, the amount `already_settled` by both devolution mechanisms (`pix_manual` locks that are `SETTLING` or `SETTLED`, and outbound refunds that are `PROCESSING` or `COMPLETED`), and `available_to_settle`, their difference. The difference can be zero or negative. The call is read-only: it holds nothing, so the value can be stale against a concurrent close. The settle and close operations enforce the ceiling themselves.

Call it before you settle, to size the devolution: a settle whose `original_amount` minus `already_settled` is zero or less is refused with `422` (`PIX-0654`).



## OpenAPI

````yaml /en/openapi/v3-current/pix-lerian-spi.yaml get /balance-locks/settle-quote
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/settle-quote:
    get:
      tags:
        - Balance Locks
      summary: Quote the amount left to settle
      description: >-
        Returns, for the received Pix identified by its original
        `end_to_end_id`, the `original_amount`, the amount `already_settled` by
        both devolution mechanisms (`pix_manual` locks that are `SETTLING` or
        `SETTLED`, and outbound refunds that are `PROCESSING` or `COMPLETED`),
        and `available_to_settle`, their difference. The difference can be zero
        or negative. The call is read-only: it holds nothing, so the value can
        be stale against a concurrent close. The settle and close operations
        enforce the ceiling themselves.


        Call it before you settle, to size the devolution: a settle whose
        `original_amount` minus `already_settled` is zero or less is refused
        with `422` (`PIX-0654`).
      operationId: getSettleQuote
      parameters:
        - description: >-
            Canonical original end-to-end id of the INBOUND transfer to quote
            the settle ceiling for
          explode: false
          in: query
          name: end_to_end_id
          required: true
          schema:
            description: >-
              Canonical original end-to-end id of the INBOUND transfer to quote
              the settle ceiling for
            examples:
              - E12345678202610271032k7Qm2Xp9Ld4
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                original_amount: '150.75'
                already_settled: '100.26'
                available_to_settle: '50.49'
              schema:
                $ref: '#/components/schemas/SettleQuoteResponse'
          description: OK
        '400':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0003
                title: Bad Request
                status: 400
                detail: >-
                  Your request contains one or more fields with an invalid data
                  type.
                code: PIX-0003
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            end_to_end_id is missing or is not a valid end-to-end or return id
            (PIX-0003).
        '422':
          content:
            application/problem+json:
              example:
                type: https://errors.lerian.studio/v1/PIX-0013
                title: Unprocessable Entity
                status: 422
                detail: >-
                  The operation could not be processed due to a business rule
                  violation.
                code: PIX-0013
              schema:
                $ref: '#/components/schemas/Detail'
          description: No INBOUND transfer matches end_to_end_id (PIX-0013).
        '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).
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    SettleQuoteResponse:
      additionalProperties: false
      properties:
        already_settled:
          examples:
            - '100.26'
          type: string
        available_to_settle:
          examples:
            - '50.49'
          type: string
        original_amount:
          examples:
            - '150.75'
          type: string
      required:
        - original_amount
        - already_settled
        - available_to_settle
      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
    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
    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.