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

# Get the provider a boleto is bound to

> Returns the provider recorded on the boleto when it was created, its identifier at that provider and the provider account. The recorded provider never changes: cancellation, PDF, reconciliation and notices of this boleto always go to it, whatever the current route says. Boletos created before provider routing read `BTG`.

The public GET /v1/boletos/{id} does not change and does not carry these fields.

X-Organization-Id is required (400 PBP-0025 without it). A boleto that does not exist, or belongs to another organization, is answered 404 PBP-0005. WHO MAY CALL IT: `boletos:read`.



## OpenAPI

````yaml /es/openapi/v3-current/payments.yaml get /v1/admin/boletos/{id}/provider-binding
openapi: 3.1.0
info:
  description: >-
    API for the Lerian Payments interface via BTG. It covers boleto issuance,
    cancellation, and queries; bill payments (bankslip, utilities, and DARF) and
    queries; aggregated boleto and payment dashboards; provider connection and
    outbound webhook configuration; and the provider webhook receiver for
    settlement events.


    ERROR BODIES. A failed request arrives as an RFC 9457 problem document on
    application/problem+json. Branch on the code member. A license refusal
    carries an LCS code, listed in the License Manager error list.


    NOTICES. The webhooks section describes each notice Payments posts to the
    tenant's callback URL. Delivery does not guarantee order: order a boleto's
    notices by the occurredAt member of the body. Notices of one boleto recorded
    together never tie and follow the order of the facts; notices recorded at
    different moments can tie, and in a tie the boleto query tells the current
    state. The same notice can arrive more than once: after verifying its
    signature and its X-Webhook-Timestamp, discard repetitions by the eventId
    member of the body, equal to the X-Webhook-Id header and the same on every
    attempt.
  title: Payments — via BTG API
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security: []
tags:
  - description: >-
      Tenant-level setup: connecting the banking provider and configuring where
      status notifications are delivered.
    name: Admin
  - description: Issuing, querying and cancelling boletos, and retrieving the rendered PDF.
    name: Boletos
  - description: >-
      Aggregated counts, amounts and breakdowns over a period, for boletos and
      for payments.
    name: Dashboards
  - description: >-
      The notices Payments posts to the tenant's callback URL, one per type
      enabled in enabledEvents, each signed with the configuration's secret.
      Each item describes the body, the delivery headers, when the notice is
      sent and which providers send it.
    name: Notices
  - description: >-
      Paying bankslips, utility bills and DARF tax slips, and querying those
      payments.
    name: Payments
  - description: >-
      The webhook the payment provider posts settlement events to. Authenticated
      with a credential agreed with the provider, not with the platform identity
      used by the rest of this API.
    name: Settlement
paths:
  /v1/admin/boletos/{id}/provider-binding:
    get:
      tags:
        - Admin
      summary: Get the provider a boleto is bound to
      description: >-
        Returns the provider recorded on the boleto when it was created, its
        identifier at that provider and the provider account. The recorded
        provider never changes: cancellation, PDF, reconciliation and notices of
        this boleto always go to it, whatever the current route says. Boletos
        created before provider routing read `BTG`.


        The public GET /v1/boletos/{id} does not change and does not carry these
        fields.


        X-Organization-Id is required (400 PBP-0025 without it). A boleto that
        does not exist, or belongs to another organization, is answered 404
        PBP-0005. WHO MAY CALL IT: `boletos:read`.
      operationId: getBoletoProviderBinding
      parameters:
        - description: >-
            Midaz organization the boleto belongs to. Required: a request
            without it, or with a value that is not a canonical UUID, is refused
            with 400 PBP-0025. A boleto of another organization is answered 404,
            exactly as one that does not exist.
          in: header
          name: X-Organization-Id
          schema:
            description: >-
              Midaz organization the boleto belongs to. Required: a request
              without it, or with a value that is not a canonical UUID, is
              refused with 400 PBP-0025. A boleto of another organization is
              answered 404, exactly as one that does not exist.
            type: string
        - description: Boleto identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Boleto identifier (UUID).
            examples:
              - 123e4567-e89b-12d3-a456-426614174000
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoletoProviderBinding'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Authentication failed: the request carries no valid credential, or
            the credential does not identify a tenant. The error body is an RFC
            9457 problem document (`application/problem+json`) with error code
            `PBP-0003`. Obtain a valid bearer token and send the request again.
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            The authenticated principal is not allowed to perform this request.
            The error body is an RFC 9457 problem document
            (`application/problem+json`) with error code `PBP-0004`: the
            principal lacks permission for this operation, and the permission
            has to be granted before the request can succeed.
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Not Found
        '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
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: >-
            Service Unavailable. PBP-0008 means a dependency the request needs,
            authentication or the tenant's storage, is temporarily unavailable.
            The request was not processed; wait and send it again.
      security:
        - BearerAuth: []
components:
  schemas:
    BoletoProviderBinding:
      additionalProperties: false
      properties:
        boletoId:
          examples:
            - 123e4567-e89b-12d3-a456-426614174000
          format: uuid
          type: string
        providerAccountId:
          description: >-
            Provider account the boleto was issued on. Null only in these cases.
            An installment of a series created without ourNumbers: until the
            series' first emission looks its account up at the provider. Such an
            installment, for good: when that lookup found no numbering account
            for the series' midazAccountId, because the installation has no
            account discovery or the account was not yet enabled at the
            provider. A boleto created without ourNumber whose lookup at
            creation found no numbering account for its midazAccountId: until
            the provider's answer to the issuance names an account; on an
            installation without account discovery the answer names none, and
            the boleto is issued on the credential's default account.
          examples:
            - '001234567'
          maxLength: 100
          type:
            - string
            - 'null'
        providerId:
          description: >-
            Identifier of the boleto at the provider. Null while the provider
            has not returned one (PENDING without identifier).
          examples:
            - 8f2a1c3d-4e5b-6a7c-8d9e-0f1a2b3c4d5e
          maxLength: 100
          type:
            - string
            - 'null'
        providerType:
          description: >-
            Provider identifier, uppercase. Records created before provider
            routing read BTG.
          examples:
            - BTG
          maxLength: 20
          minLength: 1
          pattern: ^[A-Z][A-Z0-9_]{0,19}$
          type: string
      required:
        - boletoId
        - providerType
        - providerId
        - providerAccountId
      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.