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

# Resolve the effective instruction per policy for a ledger scenario

> Use this endpoint to see, for a ledger and a transaction scenario, the instruction each control (rules, limits) of every published policy gets and which binding decided it. The scenario is the transaction's scheme: a binding matches when its selector is empty or names that scheme, compared without case; without scheme, only empty selectors match. The Tracer does not read ledger settings: pass the ledger's fallback mode as fallback_mode; without it, controls no binding decides answer LEDGER_FALLBACK (they follow the ledger's fallback, whatever it is). Read-only: nothing is evaluated and no limit moves; the ledger's decide resolves its controls the same way; with fallback_mode=ENFORCE an OFF binding shows AUDIT, and without fallback_mode it shows OFF, which a ledger in enforce mode runs as AUDIT.



## OpenAPI

````yaml /en/openapi/v3-current/tracer.yaml get /v1/bindings/effective
openapi: 3.1.0
info:
  title: Midaz Tracer API
  description: >-
    Reference for Midaz Tracer transaction validation, fraud rules, spending
    limits, policies and bindings, and audit events.
  version: 4.0.0
servers:
  - url: https://tracer.sandbox.lerian.net
security: []
tags:
  - name: Validations API
  - name: Rules API
  - name: Limits API
  - name: Policies API
  - name: Bindings API
  - name: Audit Events API
  - name: Dashboards API
paths:
  /v1/bindings/effective:
    get:
      tags:
        - Bindings API
      summary: Resolve the effective instruction per policy for a ledger scenario
      description: >-
        Use this endpoint to see, for a ledger and a transaction scenario, the
        instruction each control (rules, limits) of every published policy gets
        and which binding decided it. The scenario is the transaction's scheme:
        a binding matches when its selector is empty or names that scheme,
        compared without case; without scheme, only empty selectors match. The
        Tracer does not read ledger settings: pass the ledger's fallback mode as
        fallback_mode; without it, controls no binding decides answer
        LEDGER_FALLBACK (they follow the ledger's fallback, whatever it is).
        Read-only: nothing is evaluated and no limit moves; the ledger's decide
        resolves its controls the same way; with fallback_mode=ENFORCE an OFF
        binding shows AUDIT, and without fallback_mode it shows OFF, which a
        ledger in enforce mode runs as AUDIT.
      operationId: getEffectiveBindings
      parameters:
        - description: Ledger (UUID). Required.
          explode: false
          in: query
          name: ledger_id
          required: true
          schema:
            description: Ledger (UUID). Required.
            type: string
        - description: >-
            ENFORCE or ADVISORY: the ledger's fallback mode, read from its
            settings by the caller. Omitted, controls no binding decides answer
            LEDGER_FALLBACK.
          explode: false
          in: query
          name: fallback_mode
          schema:
            description: >-
              ENFORCE or ADVISORY: the ledger's fallback mode, read from its
              settings by the caller. Omitted, controls no binding decides
              answer LEDGER_FALLBACK.
            type: string
        - description: >-
            Transaction scheme, compared without case. Omitted, only bindings
            with an empty selector match.
          explode: false
          in: query
          name: scheme
          schema:
            description: >-
              Transaction scheme, compared without case. Omitted, only bindings
              with an empty selector match.
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EffectiveBindingsResponse'
          description: OK
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    EffectiveBindingsResponse:
      additionalProperties: false
      properties:
        fallbackMode:
          enum:
            - ENFORCE
            - ADVISORY
          type: string
        ledgerId:
          type: string
        policies:
          items:
            $ref: '#/components/schemas/EffectivePolicyResponse'
          type:
            - array
            - 'null'
      required:
        - ledgerId
        - policies
      type: object
    Error:
      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
    EffectivePolicyResponse:
      additionalProperties: false
      properties:
        limits:
          $ref: '#/components/schemas/EffectiveControl'
        policyId:
          type: string
        policyName:
          type: string
        publishedRevision:
          format: int64
          type: integer
        rules:
          $ref: '#/components/schemas/EffectiveControl'
      required:
        - policyId
        - policyName
        - publishedRevision
        - rules
        - limits
      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
    EffectiveControl:
      additionalProperties: false
      properties:
        action:
          description: >-
            Instruction; LEDGER_FALLBACK when no binding decides the control and
            no fallback_mode was given. An OFF binding shows AUDIT with
            fallback_mode=ENFORCE; without fallback_mode it shows OFF, which an
            enforce ledger runs as AUDIT.
          enum:
            - ENFORCE
            - ADVISORY
            - AUDIT
            - 'OFF'
            - LEDGER_FALLBACK
          type: string
        bindingId:
          description: Binding that decided the control.
          type: string
        bindingPosition:
          format: int64
          type: integer
        source:
          description: BINDING when a binding decided the control, FALLBACK otherwise.
          enum:
            - BINDING
            - FALLBACK
          type: string
      required:
        - action
        - source
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http
    ApiKeyAuth:
      description: Static API key presented in the X-API-Key header.
      in: header
      name: X-API-Key
      type: apiKey

````

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