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

# Issue a single boleto

> Issues one `TRADITIONAL` boleto through the provider the tenant routes `BOLETO_ISSUANCE` to.

<Info>**Providers:** Lerian (PCR) and BTG.</Info>

<Warning>**Lerian (PCR): under development.** The Lerian provider can change before it is released. BTG is available.</Warning>

**How it works**

- The final beneficiary (sacador avalista) is always the holder of the issuing account, read from the account's registration. Do not send `guarantor`: the response returns it.
- The payer cannot be the holder of the issuing account.
- `discounts` takes 1 to 3 bands of one type. Limit dates go in increasing order, each before the due date. An empty `discounts` is `400 PBP-0001`. `discount` with `discounts` is `422 PBP-0006`.
- `fine.startDate` and `interest.startDate` fall after the due date and on or before the payment deadline. Without them, fine and interest start the day after the due date.
- When the deadline is the due date (for example, 0 days set for the tenant), a `fine` or `interest` without a start date is refused with `422 PBP-0006`.
- `documentNumber` (seu número) has 1 to 15 printable ASCII characters. It does not have to be unique. A longer value is refused, never cut.
- `paymentDeadline` is on or after the due date. Without it, the provider's default applies (see the table below). The response shows the deadline in effect.
- No date may fall after 9999-12-31, a default deadline included.
- A term the provider does not register is refused with `422 PBP-0701`.
- An `ourNumber` (nosso número) already held by an active boleto of the same provider account is refused with `422 PBP-0108` before the provider is called.
- A number held by a title this service cannot see (another deployment or tenant on the same provider account) is accepted, then refused by the provider: the boleto moves to `FAILED`. If that title is this same emission, the boleto is bound to it. If the provider cannot tell whose title it is, the boleto stays `PENDING`.
- Checks run in this order, and none issues anything: authentication, `Idempotency-Key`, body schema (empty required members, markup), type `HYBRID` (`501`), the account (`404 PBP-0005`), BTG accounting routes (`422 PBP-0128`, `503 PBP-0301`), the final beneficiary (`503 PBP-0118`, `400 PBP-0116`, `422 PBP-0117`, `422 PBP-0119`), the provider account (`422 PBP-0017`, `422 PBP-0014`, `503 PBP-0015`), Lerian (PCR) term rules (`422 PBP-0006`), then the nosso número (`422 PBP-0108`).

**Responses and retries**

- `201`: the provider accepted the boleto. The body has `providerId`. With BTG it also has `barcode` and `digitableLine`. With Lerian (PCR) they appear once the registration is confirmed and the boleto is `CREATED`.
- `202`: the emission was sent, and the provider's answer is not confirmed yet. The boleto is `PENDING`. Read it with `GET /v1/boletos/{id}`.
- After a `202`, do not send the boleto under a new `Idempotency-Key`: the provider may have issued it. Use a new key only when the boleto reads `FAILED`.
- The response, `GET /v1/boletos/{id}`, `GET /v1/boletos` and the `BOLETO_CREATED` notification show the terms as recorded.
- A provider refusal that proves no title was issued leaves the boleto `FAILED` and sends `BOLETO_FAILED`.
- A provider refusal with a code of its declared refusal catalog comes with that code and its registered status (`409` or `422`), the catalog's `detail` and, when given, `providerReason`.
- A code outside the catalog is answered `500`: the boleto is `FAILED` and `BOLETO_FAILED` is sent. A retry under the same `Idempotency-Key` sends the emission again and, refused again, records another `FAILED` boleto.
- A retry under the same `Idempotency-Key` returns the stored `201` or `202`. After a refusal that issued nothing (for example `PBP-0116`, `PBP-0117`, `PBP-0119`, `PBP-0014`, `PBP-0017`, `PBP-0128` or a `503`), it runs the request again.
- A resend of a `202` under the same key returns the same `202` even after the boleto is completed: read the boleto by id.
- After the stored answer expires, the same key returns the boleto recorded under it (`201`, or `202` while it is `PENDING`), whatever its dates are now, and sends nothing again. Any changed member is `422 PBP-0013`. If the provider that recorded it is no longer installed, the answer is `503 PBP-0704`.

**Provider differences**

| | Lerian (PCR) | BTG |
|---|---|---|
| Status | Under development. Can change before it is released. | Available |
| Nosso número | Up to 16 digits | Up to 11 digits |
| Default deadline | Days of the collections agreement | Days set for the tenant, or 30 |
| Maximum deadline | None | 365 days after the due date |
| Instructions | Refused with 422 PBP-0701 (BOLETO_INSTRUCTIONS) | Accepted |
| Term checks | This service's rules, then the collections rules, before anything is recorded (422 PBP-0006) | This service's rules (422 PBP-0006), then the bank |
| Accounting routes | Not checked | Must be complete |

**Planned changes**

- Lerian (PCR): today a refusal when the title is registered, such as an account without a collections agreement while automatic enablement is off, is `422 PBP-0014`. Each refusal will get its own code instead:
  - `PBP-0801`: a capability the first version does not offer (product type, species, portfolio, or an institution without its own number code).
  - `PBP-0821`: an informed nosso número longer than 16 digits (here refused first with `400 PBP-0001`).
  - `PBP-0831`: the account has no collections agreement and automatic enablement is off. Enable the account, or turn automatic enablement on in the collections settings.
  - `PBP-0832`: an issuance rule is broken. Only this code carries `providerReason`, the rule's stable identifier, never a request value: `MISSING_DATE`, `DUE_DATE_TOO_FAR`, `DUE_DATE_BEFORE_FACTOR_RANGE`, `PAYMENT_DEADLINE_BEFORE_DUE`, `AMOUNT_NOT_POSITIVE`, `AMOUNT_PRECISION`, `AMOUNT_TOO_LARGE_FOR_BARCODE`, `PROJECTED_TOTAL_OUT_OF_RANGE`, `NEGATIVE_VALUE`, `VALUE_TOO_LARGE`, `PERCENTAGE_PRECISION`, `EXEMPT_CODE_WITH_VALUE`, `CALCULATION_MODEL_UNKNOWN`, `CALCULATION_MODEL_DISCONTINUED`, `INTEREST_CODE_UNKNOWN`, `INTEREST_CODE_NOT_IN_MODEL_01`, `INTEREST_VALUE_NOT_POSITIVE`, `INTEREST_VALUE_OUT_OF_RANGE`, `INTEREST_DATE_NOT_AFTER_DUE`, `INTEREST_DATE_AFTER_DEADLINE`, `INTEREST_DATE_WITH_EXEMPT_INTEREST`, `DAILY_RATE_NOT_REPRESENTABLE`, `FINE_CODE_UNKNOWN`, `FINE_VALUE_OUT_OF_RANGE`, `FINE_DATE_NOT_AFTER_DUE`, `FINE_DATE_AFTER_DEADLINE`, `FINE_DATE_WITH_EXEMPT_FINE`, `DISCOUNT_CODE_UNKNOWN`, `DISCOUNT_VALUE_OUT_OF_RANGE`, `DISCOUNT_DATE_NOT_BEFORE_DUE`, `DISCOUNT_DATES_NOT_INCREASING`, `DISCOUNT_DATE_WITH_EXEMPT_DISCOUNT`, `TOO_MANY_DISCOUNT_BANDS`, `MIXED_DISCOUNT_CODES`, `REBATE_NOT_BELOW_AMOUNT`, `DISCOUNT_AND_REBATE_NOT_BELOW_AMOUNT`, `DOCUMENT_NUMBER_TOO_LONG`, `DOCUMENT_NUMBER_INVALID_CHARACTER`, `OUR_NUMBER_EMPTY`, `OUR_NUMBER_NOT_DIGITS`, `FINAL_BENEFICIARY_MISSING`, `PARTY_DOCUMENT_INVALID`, `PARTY_NAME_INVALID`, `PARTY_ADDRESS_INVALID`.
- `PBP-0108`: today it names the holder whatever its organization, and reading a holder of another organization returns `404`. The holder will be named only when it belongs to the `X-Organization-Id` organization.



## OpenAPI

````yaml /es/openapi/v3-current/payments-pcr.yaml post /v1/boletos
openapi: 3.1.0
info:
  title: Payments PCR preview
  version: 2026-11-23-preview
  description: >-
    Preview of Payments with boleto collections through Lerian (PCR), CNAB 240,
    electronic payers (DDA), bill payments, and shared administration. This
    reference includes current behavior and planned changes. Read each
    operation's provider information: some operations support BTG only today.
    The preview is under development and can change before release. Confirm
    availability with Lerian before integration.


    The webhooks section describes notices Payments sends to your callback URL.
    Verify the signature and timestamp before processing a notice. Use the
    eventId and X-Webhook-Id described by each notice to detect repeated
    delivery. Do not assume delivery order.
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
  - name: CNAB Agreements
    description: >-
      CNAB agreements: the link between a Lerian-provider collections agreement
      and the CNAB 240 Lerian files of one account, with its remittance and
      return sequence numbers (NSA) and its return cut times. Every operation of
      this section answers 422 PBP-0900 to a tenant without CNAB 240 enabled.
  - name: CNAB Remittances
    description: >-
      CNAB remittances: the CNAB 240 Lerian remittance files of an organization,
      each received whole, validated and stored encrypted, its title lines
      executed afterwards. A file already received is answered with its stored
      receipt; a new one answers 422 PBP-0900 to a tenant without CNAB 240
      enabled.
  - name: CNAB Returns
    description: >-
      CNAB 240 Lerian return files, one per agreement and cut, built from the
      journal of what happened to the titles that entered by remittance, and
      their download. Every operation of this section answers 422 PBP-0900 to a
      tenant without CNAB 240 enabled.
  - description: >-
      Boleto collections agreements and their reconciliation with the
      beneficiary base of the PCR: the consumption of each beneficiary inventory
      the PCR publishes and the divergences it raises, which carry only
      agreement and situation attributes, never a document or a name. Every
      operation of this section answers 422 PBP-0830 to a tenant without
      collections enabled.
    name: Collections Agreements
  - description: >-
      Boleto collections audit trail: every operation and configuration action,
      append-only, with its author, instant, reason, evidence and the module's
      fields before and after it. Every operation of this section answers 422
      PBP-0830 to a tenant without collections enabled.
    name: Collections Audit
  - description: >-
      Boleto collections beneficiaries: the enablement of the tenant's accounts
      for collections, in batches of up to 5,000 accounts, and the progress and
      per-item outcome of the enablement and bulk adoption batches. Every
      operation of this section answers 422 PBP-0830 to a tenant without
      collections enabled.
    name: Collections Beneficiaries
  - name: Collections Credit Entries
    description: >-
      Boleto collections credit entries: what the credit of each write-off moves
      in the ledger, one entry per write-off and phase, the RELEASE to the
      available balance of the title's account and the CHARGEBACK of a write-off
      cancelled after its release, with where each entry stands with the ledger
      and, when it is not posted, why, as a closed code and never the ledger's
      own text. Every operation of this section answers 422 PBP-0830 to a tenant
      without collections enabled.
  - description: >-
      Boleto collections operation queues: each case that waits for an operator
      and already has its state in collections, with its reason, since when it
      waits and the operations that act on it, read over the states collections
      keeps rather than from a list of its own. Each queue counts the items
      whose age reached its age limit, a per-tenant operational parameter. Every
      operation of this section answers 422 PBP-0830 to a tenant without
      collections enabled.
    name: Collections Operation Queues
  - description: >-
      Boleto collections commands to the PCR: each registration, change and
      write-off sent to the PCR of the institution, with the idempotency key it
      keeps across attempts, its attempts, its next attempt and the last answer
      that did not accept it, never the body sent. Every operation of this
      section answers 422 PBP-0830 to a tenant without collections enabled.
    name: Collections PCR Commands
  - description: >-
      Boleto collections notice subscription of the tenant's connection to the
      PCR: its synchronization with the PCR, the rotation of the secret the PCR
      signs the notices with, the deliveries of notices the PCR recorded for it,
      and the redelivery of a notice whose delivery failed. Every operation of
      this section answers 422 PBP-0830 to a tenant without collections enabled.
    name: Collections PCR Connection
  - description: >-
      Boleto collections notices received from the PCR: each event the PCR of
      the institution delivered to collections, stored once per connection and
      event, with where its processing stands and what it was matched with,
      never the body received. Every operation of this section answers 422
      PBP-0830 to a tenant without collections enabled.
    name: Collections PCR Notices
  - description: >-
      Boleto collections pooled accounts: the links of accounts that issue under
      the agreement of a pooled account, whose holder stays the beneficiary
      while the account's holder is the final one. A link registers nothing at
      Núclea. Every operation of this section answers 422 PBP-0830 to a tenant
      without collections enabled.
    name: Collections Pooled Accounts
  - description: >-
      Boleto collections setup: the tenant's business settings, with the default
      agreement template, the automatic enablement and the retention periods,
      and the tenant's connection to the PCR of its institution. Every operation
      of this section answers 422 PBP-0830 to a tenant without collections
      enabled.
    name: Collections Settings
  - description: >-
      Boleto collections titles: each boleto collections issues at the PCR of
      the institution, with its four state axes (registration, situation at the
      base, credit and block), never the data of a payer or of a beneficiary.
      The barcode and the digitable line are answered only while the title is
      REGISTERED. Every operation of this section answers 422 PBP-0830 to a
      tenant without collections enabled.
    name: Collections Titles
  - name: Collections Write-offs
    description: >-
      Boleto collections write-offs: each write-off of a collections title the
      PCR of the institution notified, with its route, its settlement, the state
      of its credit, its hold and its cancellation deadline, never the data of a
      payer. Every operation of this section answers 422 PBP-0830 to a tenant
      without collections enabled.
  - description: >-
      Aggregated counts, amounts and breakdowns over a period, for boletos and
      for payments.
    name: Dashboards
  - name: Electronic payers
    description: >-
      Electronic payer (DDA): adhesion of the institution's customer to
      electronic presentment of boletos, its accounts and aggregates, and the
      outcome of each request. Under development: can change before it is
      released.
  - 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. The webhook is the channel of the first
      delivery: delivery will later move to Lerian's Streaming Hub, which will
      then be the only channel, with a change of subscription and a migration
      plan communicated to the client.
    name: Notices
  - description: >-
      Paying bankslips, utility bills and DARF tax slips, and querying those
      payments.
    name: Payments
  - name: Presented boletos
    description: >-
      Boletos of other institutions presented to the electronic payer: list,
      detail, acceptance and authorized third parties. Under development: can
      change before it is released.
paths:
  /v1/boletos:
    post:
      tags:
        - Boletos
      summary: Issue a single boleto
      description: >-
        Issues one `TRADITIONAL` boleto through the provider the tenant routes
        `BOLETO_ISSUANCE` to.


        <Info>**Providers:** Lerian (PCR) and BTG.</Info>


        <Warning>**Lerian (PCR): under development.** The Lerian provider can
        change before it is released. BTG is available.</Warning>


        **How it works**


        - The final beneficiary (sacador avalista) is always the holder of the
        issuing account, read from the account's registration. Do not send
        `guarantor`: the response returns it.

        - The payer cannot be the holder of the issuing account.

        - `discounts` takes 1 to 3 bands of one type. Limit dates go in
        increasing order, each before the due date. An empty `discounts` is `400
        PBP-0001`. `discount` with `discounts` is `422 PBP-0006`.

        - `fine.startDate` and `interest.startDate` fall after the due date and
        on or before the payment deadline. Without them, fine and interest start
        the day after the due date.

        - When the deadline is the due date (for example, 0 days set for the
        tenant), a `fine` or `interest` without a start date is refused with
        `422 PBP-0006`.

        - `documentNumber` (seu número) has 1 to 15 printable ASCII characters.
        It does not have to be unique. A longer value is refused, never cut.

        - `paymentDeadline` is on or after the due date. Without it, the
        provider's default applies (see the table below). The response shows the
        deadline in effect.

        - No date may fall after 9999-12-31, a default deadline included.

        - A term the provider does not register is refused with `422 PBP-0701`.

        - An `ourNumber` (nosso número) already held by an active boleto of the
        same provider account is refused with `422 PBP-0108` before the provider
        is called.

        - A number held by a title this service cannot see (another deployment
        or tenant on the same provider account) is accepted, then refused by the
        provider: the boleto moves to `FAILED`. If that title is this same
        emission, the boleto is bound to it. If the provider cannot tell whose
        title it is, the boleto stays `PENDING`.

        - Checks run in this order, and none issues anything: authentication,
        `Idempotency-Key`, body schema (empty required members, markup), type
        `HYBRID` (`501`), the account (`404 PBP-0005`), BTG accounting routes
        (`422 PBP-0128`, `503 PBP-0301`), the final beneficiary (`503 PBP-0118`,
        `400 PBP-0116`, `422 PBP-0117`, `422 PBP-0119`), the provider account
        (`422 PBP-0017`, `422 PBP-0014`, `503 PBP-0015`), Lerian (PCR) term
        rules (`422 PBP-0006`), then the nosso número (`422 PBP-0108`).


        **Responses and retries**


        - `201`: the provider accepted the boleto. The body has `providerId`.
        With BTG it also has `barcode` and `digitableLine`. With Lerian (PCR)
        they appear once the registration is confirmed and the boleto is
        `CREATED`.

        - `202`: the emission was sent, and the provider's answer is not
        confirmed yet. The boleto is `PENDING`. Read it with `GET
        /v1/boletos/{id}`.

        - After a `202`, do not send the boleto under a new `Idempotency-Key`:
        the provider may have issued it. Use a new key only when the boleto
        reads `FAILED`.

        - The response, `GET /v1/boletos/{id}`, `GET /v1/boletos` and the
        `BOLETO_CREATED` notification show the terms as recorded.

        - A provider refusal that proves no title was issued leaves the boleto
        `FAILED` and sends `BOLETO_FAILED`.

        - A provider refusal with a code of its declared refusal catalog comes
        with that code and its registered status (`409` or `422`), the catalog's
        `detail` and, when given, `providerReason`.

        - A code outside the catalog is answered `500`: the boleto is `FAILED`
        and `BOLETO_FAILED` is sent. A retry under the same `Idempotency-Key`
        sends the emission again and, refused again, records another `FAILED`
        boleto.

        - A retry under the same `Idempotency-Key` returns the stored `201` or
        `202`. After a refusal that issued nothing (for example `PBP-0116`,
        `PBP-0117`, `PBP-0119`, `PBP-0014`, `PBP-0017`, `PBP-0128` or a `503`),
        it runs the request again.

        - A resend of a `202` under the same key returns the same `202` even
        after the boleto is completed: read the boleto by id.

        - After the stored answer expires, the same key returns the boleto
        recorded under it (`201`, or `202` while it is `PENDING`), whatever its
        dates are now, and sends nothing again. Any changed member is `422
        PBP-0013`. If the provider that recorded it is no longer installed, the
        answer is `503 PBP-0704`.


        **Provider differences**


        | | Lerian (PCR) | BTG |

        |---|---|---|

        | Status | Under development. Can change before it is released. |
        Available |

        | Nosso número | Up to 16 digits | Up to 11 digits |

        | Default deadline | Days of the collections agreement | Days set for
        the tenant, or 30 |

        | Maximum deadline | None | 365 days after the due date |

        | Instructions | Refused with 422 PBP-0701 (BOLETO_INSTRUCTIONS) |
        Accepted |

        | Term checks | This service's rules, then the collections rules, before
        anything is recorded (422 PBP-0006) | This service's rules (422
        PBP-0006), then the bank |

        | Accounting routes | Not checked | Must be complete |


        **Planned changes**


        - Lerian (PCR): today a refusal when the title is registered, such as an
        account without a collections agreement while automatic enablement is
        off, is `422 PBP-0014`. Each refusal will get its own code instead:
          - `PBP-0801`: a capability the first version does not offer (product type, species, portfolio, or an institution without its own number code).
          - `PBP-0821`: an informed nosso número longer than 16 digits (here refused first with `400 PBP-0001`).
          - `PBP-0831`: the account has no collections agreement and automatic enablement is off. Enable the account, or turn automatic enablement on in the collections settings.
          - `PBP-0832`: an issuance rule is broken. Only this code carries `providerReason`, the rule's stable identifier, never a request value: `MISSING_DATE`, `DUE_DATE_TOO_FAR`, `DUE_DATE_BEFORE_FACTOR_RANGE`, `PAYMENT_DEADLINE_BEFORE_DUE`, `AMOUNT_NOT_POSITIVE`, `AMOUNT_PRECISION`, `AMOUNT_TOO_LARGE_FOR_BARCODE`, `PROJECTED_TOTAL_OUT_OF_RANGE`, `NEGATIVE_VALUE`, `VALUE_TOO_LARGE`, `PERCENTAGE_PRECISION`, `EXEMPT_CODE_WITH_VALUE`, `CALCULATION_MODEL_UNKNOWN`, `CALCULATION_MODEL_DISCONTINUED`, `INTEREST_CODE_UNKNOWN`, `INTEREST_CODE_NOT_IN_MODEL_01`, `INTEREST_VALUE_NOT_POSITIVE`, `INTEREST_VALUE_OUT_OF_RANGE`, `INTEREST_DATE_NOT_AFTER_DUE`, `INTEREST_DATE_AFTER_DEADLINE`, `INTEREST_DATE_WITH_EXEMPT_INTEREST`, `DAILY_RATE_NOT_REPRESENTABLE`, `FINE_CODE_UNKNOWN`, `FINE_VALUE_OUT_OF_RANGE`, `FINE_DATE_NOT_AFTER_DUE`, `FINE_DATE_AFTER_DEADLINE`, `FINE_DATE_WITH_EXEMPT_FINE`, `DISCOUNT_CODE_UNKNOWN`, `DISCOUNT_VALUE_OUT_OF_RANGE`, `DISCOUNT_DATE_NOT_BEFORE_DUE`, `DISCOUNT_DATES_NOT_INCREASING`, `DISCOUNT_DATE_WITH_EXEMPT_DISCOUNT`, `TOO_MANY_DISCOUNT_BANDS`, `MIXED_DISCOUNT_CODES`, `REBATE_NOT_BELOW_AMOUNT`, `DISCOUNT_AND_REBATE_NOT_BELOW_AMOUNT`, `DOCUMENT_NUMBER_TOO_LONG`, `DOCUMENT_NUMBER_INVALID_CHARACTER`, `OUR_NUMBER_EMPTY`, `OUR_NUMBER_NOT_DIGITS`, `FINAL_BENEFICIARY_MISSING`, `PARTY_DOCUMENT_INVALID`, `PARTY_NAME_INVALID`, `PARTY_ADDRESS_INVALID`.
        - `PBP-0108`: today it names the holder whatever its organization, and
        reading a holder of another organization returns `404`. The holder will
        be named only when it belongs to the `X-Organization-Id` organization.
      operationId: createBoleto
      parameters:
        - description: >-
            Midaz organization the account and the ledger entry live under.
            Required: a request without it, or with a value that is not a
            canonical UUID, is refused with 400 PBP-0025.
          in: header
          name: X-Organization-Id
          schema:
            description: >-
              Midaz organization the account and the ledger entry live under.
              Required: a request without it, or with a value that is not a
              canonical UUID, is refused with 400 PBP-0025.
            type: string
        - description: >-
            Client-supplied idempotency key, a UUID. Required: a request without
            it, with a value that is not a UUID, or with the nil UUID
            (00000000-0000-0000-0000-000000000000) is refused with 400 PBP-0012.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            description: >-
              Client-supplied idempotency key, a UUID. Required: a request
              without it, with a value that is not a UUID, or with the nil UUID
              (00000000-0000-0000-0000-000000000000) is refused with 400
              PBP-0012.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBoletoRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBoletoResponse'
          description: >-
            Created. The provider accepted the boleto: the body has its
            `providerId`. The boleto stays `PENDING` until the provider confirms
            the registration. With BTG the body also has `barcode` and
            `digitableLine`. With Lerian (PCR) they appear once the registration
            is confirmed and the boleto is `CREATED`: read it with `GET
            /v1/boletos/{id}`.
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBoletoResponse'
          description: >-
            Accepted. The emission was sent, and the provider's answer is not
            confirmed yet. The boleto is `PENDING`, without `providerId`,
            `barcode` or `digitableLine`. Read it with `GET /v1/boletos/{id}`.
            Do not resend it under a new `Idempotency-Key`: the provider may
            have issued it. A resend under the same key returns this same `202`,
            even after the boleto is completed. Use a new key only after the
            boleto reads `FAILED`.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0001:
                  summary: 'PBP-0001: Body does not match the schema'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0001
                    title: Bad Request
                    status: 400
                    detail: validation failed
                    code: PBP-0001
                    errors:
                      - message: unexpected property
                        location: body.guarantor
                PBP-0012:
                  summary: 'PBP-0012: Idempotency-Key missing'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0012
                    title: Bad Request
                    status: 400
                    detail: Idempotency-Key header is required and must be a UUID
                    code: PBP-0012
                PBP-0025:
                  summary: 'PBP-0025: Organization header missing'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0025
                    title: Bad Request
                    status: 400
                    detail: X-Organization-Id header is required and must be a UUID
                    code: PBP-0025
                PBP-0116:
                  summary: 'PBP-0116: Account without a registered holder'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0116
                    title: FINAL_BENEFICIARY_DATA_MISSING
                    status: 400
                    detail: >-
                      The account this boleto would be issued against has no
                      registered owner on file, so the boleto's final
                      beneficiary cannot be established. Register the account's
                      owner, or use an account that has one.
                    code: PBP-0116
          description: >-
            Bad Request.


            - `PBP-0001`: the body does not match the schema. Examples:
            `guarantor` sent, a fourth discount band, an empty `discounts`,
            `documentNumber` longer than 15 characters or outside printable
            ASCII. The `errors` member names the field.

            - `PBP-0012`: `Idempotency-Key` is missing or is not a UUID.

            - `PBP-0025`: `X-Organization-Id` is missing or is not a UUID.

            - `PBP-0116`: the issuing account has no registered holder, or the
            registration is incomplete. Complete the holder's registration.


            See the [error
            list](/es/reference/interfaces/payments-btg/payments-error-list) for
            every code.
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0003:
                  summary: 'PBP-0003: Invalid credential'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0003
                    title: Unauthorized
                    status: 401
                    detail: authentication required
                    code: PBP-0003
          description: >-
            Unauthorized.


            - `PBP-0003`: the credential is missing or invalid, or does not
            identify a tenant. Get a valid bearer token.
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0004:
                  summary: 'PBP-0004: No permission'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0004
                    title: Forbidden
                    status: 403
                    detail: permission denied
                    code: PBP-0004
          description: >-
            Forbidden.


            - `PBP-0004`: the credential does not have permission to issue
            boletos.
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0005:
                  summary: 'PBP-0005: Account not found'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0005
                    title: Not Found
                    status: 404
                    detail: account not found
                    code: PBP-0005
          description: >-
            Not Found.


            - `PBP-0005`: the issuing account does not exist in this
            organization.
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0007:
                  summary: 'PBP-0007: Same key still running'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0007
                    title: Conflict
                    status: 409
                    detail: >-
                      a request with this Idempotency-Key is still being
                      processed
                    code: PBP-0007
          description: >-
            Conflict.


            - `PBP-0007`: an earlier request under the same `Idempotency-Key` is
            still running. Retry under the same key after a few seconds. Do not
            switch keys: the earlier request can still take effect. This code
            lasts at most five minutes after the earlier request arrived. After
            that, the same key returns the earlier answer, `500 PBP-0002` when
            it cannot be replayed, or runs the request when no answer was kept.

            - Provider refusal: a code of the provider's declared refusal
            catalog registered as `409` comes here, with the catalog's `detail`
            and `providerReason` when given.
        '413':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0010:
                  summary: 'PBP-0010: Body too large'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0010
                    title: Request Entity Too Large
                    status: 413
                    detail: request body too large
                    code: PBP-0010
          description: |-
            Payload Too Large.

            - `PBP-0010`: the body is larger than the size limit.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0006:
                  summary: 'PBP-0006: Term breaks a rule'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0006
                    title: Unprocessable Entity
                    status: 422
                    detail: discount and discounts cannot be sent together
                    code: PBP-0006
                PBP-0013:
                  summary: 'PBP-0013: Key used for another boleto'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0013
                    title: Idempotency Key Conflict
                    status: 422
                    detail: this Idempotency-Key was used for a different request
                    code: PBP-0013
                PBP-0014:
                  summary: 'PBP-0014: Provider refused'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0014
                    title: PROVIDER_REJECTED
                    status: 422
                    detail: banking provider rejected the boleto emission request
                    code: PBP-0014
                PBP-0017:
                  summary: 'PBP-0017: Provider not set up'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0017
                    title: PROVIDER_SETUP_INCOMPLETE
                    status: 422
                    detail: >-
                      the provider account for this tenant is not fully
                      configured
                    code: PBP-0017
                PBP-0108:
                  summary: 'PBP-0108: ourNumber in use'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0108
                    title: DUPLICATE_OUR_NUMBER
                    status: 422
                    detail: >-
                      ourNumber is held by boleto
                      0196a3c2-8f4e-7b1a-9c2d-3e4f5a6b7c8d; read it before you
                      inform another number
                    code: PBP-0108
                    ourNumberHolderBoletoId: 0196a3c2-8f4e-7b1a-9c2d-3e4f5a6b7c8d
                PBP-0117:
                  summary: 'PBP-0117: Holder cannot be final beneficiary'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0117
                    title: FINAL_BENEFICIARY_DATA_INVALID
                    status: 422
                    detail: >-
                      The registered owner of the account this boleto would be
                      issued against is recorded in a way that cannot be used as
                      the boleto's final beneficiary. Correct the account
                      owner's registration; resubmitting this request unchanged
                      will not resolve it.
                    code: PBP-0117
                PBP-0119:
                  summary: 'PBP-0119: Payer is the account holder'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0119
                    title: FINAL_BENEFICIARY_SAME_AS_PAYER
                    status: 422
                    detail: the payer is the holder of the issuing account
                    code: PBP-0119
                PBP-0128:
                  summary: 'PBP-0128: Accounting routes incomplete (BTG)'
                  value:
                    title: ACCOUNTING_ROUTES_NOT_READY
                    status: 422
                    code: PBP-0128
                    detail: >-
                      boleto issuance refused: this organization's Payments
                      accounting routes cannot carry the boleto's settlement
                      credit (accounting_routes_incomplete); read GET
                      /v1/admin/accounting-routes/preflight for this
                      organization and ledger
                    type: https://errors.lerian.studio/v1/PBP-0128
                PBP-0700:
                  summary: 'PBP-0700: No provider route'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0700
                    title: PROVIDER_ROUTE_NOT_CONFIGURED
                    status: 422
                    detail: no provider is configured for BOLETO_ISSUANCE
                    code: PBP-0700
                PBP-0701:
                  summary: 'PBP-0701: Capability not declared'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0701
                    title: PROVIDER_CAPABILITY_NOT_SUPPORTED
                    status: 422
                    detail: the provider does not support this capability
                    code: PBP-0701
                    capability: BOLETO_INSTRUCTIONS
                PBP-0801:
                  summary: 'PBP-0801: Planned: capability not offered'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0801
                    title: Provider Refusal
                    status: 422
                    detail: The provider refused the request (PBP-0801)
                    code: PBP-0801
                PBP-0821:
                  summary: 'PBP-0821: Planned: nosso número too long'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0821
                    title: Provider Refusal
                    status: 422
                    detail: The provider refused the request (PBP-0821)
                    code: PBP-0821
                PBP-0831:
                  summary: 'PBP-0831: Planned: account without agreement'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0831
                    title: Provider Refusal
                    status: 422
                    detail: The provider refused the request (PBP-0831)
                    code: PBP-0831
                PBP-0832:
                  summary: 'PBP-0832: Planned: issuance rule broken'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0832
                    title: Provider Refusal
                    status: 422
                    detail: The provider refused the request (PBP-0832)
                    code: PBP-0832
                    providerReason: PAYMENT_DEADLINE_BEFORE_DUE
          description: >-
            Unprocessable Entity.


            - `PBP-0006`: a term breaks an issuance rule, for example type
            `QR_CODE`, a date outside its range, `discount` with `discounts`, or
            a `fine` or `interest` without a start date when the deadline is the
            due date. Lerian (PCR) also applies its collections rules before
            anything is recorded. The `detail` names the member.

            - `PBP-0013`: the `Idempotency-Key` belongs to a different boleto,
            or to an emission that failed. Send under a new key.

            - `PBP-0014`: the provider refused. On the issuance itself it proved
            no title was issued: the boleto is recorded `FAILED` and
            `BOLETO_FAILED` is sent, with any provider. On the lookup of the
            issuing account nothing is recorded. A retry under the same
            `Idempotency-Key` runs the request again. Lerian (PCR) answers this
            code today for an account without a collections agreement while
            automatic enablement is off.

            - `PBP-0017`: the provider is not connected to the tenant, refused
            the tenant's credential, or the issuing account cannot be
            determined. The same on every boleto type, with or without
            `ourNumber`. Retrying unchanged does not help: fix the provider
            connection first.

            - `PBP-0108`: the `ourNumber` is held by an active boleto of the
            same provider account. `ourNumberHolderBoletoId` names it when it
            can be read. If the holder is an earlier emission still awaiting the
            provider, do not use another number: it can still become a live
            boleto. If the provider already answered it, read it first: it can
            be an earlier emission of the same charge. If the holder is a hybrid
            boleto, no id is given; do not issue the charge again, and use
            another number only for a different charge. Planned: the holder is
            named only when it belongs to the `X-Organization-Id` organization.

            - `PBP-0117`: the account holder cannot be a final beneficiary.
            Correct the holder's registration.

            - `PBP-0119`: the payer is the holder of the issuing account.

            - `PBP-0128` (BTG): the organization's accounting routes are
            incomplete, ambiguous or malformed, or absent on a ledger that
            validates them. The `detail` names the reason as `GET
            /v1/admin/accounting-routes/preflight` does. Run that read for the
            organization and ledger. A retry under the same key runs again.

            - `PBP-0700`: the tenant has no provider for `BOLETO_ISSUANCE`.

            - `PBP-0701`: the provider does not declare a capability the request
            needs. Nothing is written and the provider is not called.
            `capability` is one of `OPERATION_BOLETO_ISSUANCE`,
            `BOLETO_TYPE_TRADITIONAL`, `CLIENT_SUPPLIED_OUR_NUMBER`,
            `BOLETO_DOCUMENT_NUMBER`, `BOLETO_CHARGE_START_DATE`,
            `BOLETO_INSTRUCTIONS`, `BOLETO_DISCOUNT_BANDS` or
            `BOLETO_PAYMENT_DEADLINE`.

            - `PBP-0801`: Planned, Lerian (PCR): a capability the first version
            does not offer. Replaces `PBP-0014` for this refusal.

            - `PBP-0821`: Planned, Lerian (PCR): an informed nosso número longer
            than 16 digits. On this operation `400 PBP-0001` refuses it first.

            - `PBP-0831`: Planned, Lerian (PCR): the account has no collections
            agreement and automatic enablement is off. Enable the account, or
            turn automatic enablement on in the collections settings.

            - `PBP-0832`: Planned, Lerian (PCR): an issuance rule is broken.
            Only this code carries `providerReason`, the rule's stable
            identifier (values in Planned changes above).

            - Provider refusal: a code of the provider's declared refusal
            catalog registered as `422` comes with that code, the catalog's
            `detail` and `providerReason` when given.


            See the [error
            list](/es/reference/interfaces/payments-btg/payments-error-list) for
            every code.
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0002:
                  summary: 'PBP-0002: Unexpected failure'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0002
                    title: Internal Server Error
                    status: 500
                    detail: internal error
                    code: PBP-0002
          description: >-
            Internal Server Error. The `detail` is a fixed text.


            - `PBP-0002`: an unexpected failure, or the stored answer of this
            key cannot be replayed. Contact support. Do not resend under a new
            key.

            - Provider refusal with a code outside its declared refusal catalog:
            the boleto is `FAILED` and `BOLETO_FAILED` is sent. A retry under
            the same key sends the emission again and, refused again, records
            another `FAILED` boleto.
        '501':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0127:
                  summary: 'PBP-0127: Hybrid boleto'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0127
                    title: Hybrid Boleto Not Available
                    status: 501
                    detail: >-
                      Hybrid boletos (boleto with Pix) are not available on this
                      service.
                    code: PBP-0127
          description: >-
            Not Implemented.


            - `PBP-0127`: type `HYBRID`. Hybrid boletos (boleto with Pix) are
            not available. Do not retry.
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0008:
                  summary: 'PBP-0008: Dependency unavailable'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0008
                    title: Service Unavailable
                    status: 503
                    detail: internal error
                    code: PBP-0008
                PBP-0015:
                  summary: 'PBP-0015: Provider did not answer'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0015
                    title: PROVIDER_UNAVAILABLE
                    status: 503
                    detail: internal error
                    code: PBP-0015
                PBP-0118:
                  summary: 'PBP-0118: Holder registration unavailable'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0118
                    title: FINAL_BENEFICIARY_UNAVAILABLE
                    status: 503
                    detail: internal error
                    code: PBP-0118
                PBP-0301:
                  summary: 'PBP-0301: Accounting routes unavailable (BTG)'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0301
                    title: Ledger Unavailable
                    status: 503
                    detail: internal error
                    code: PBP-0301
                PBP-0704:
                  summary: 'PBP-0704: Provider not installed'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0704
                    title: PROVIDER_NOT_INSTALLED
                    status: 503
                    detail: internal error
                    code: PBP-0704
          description: >-
            Service Unavailable. Nothing was issued. Retry under the same
            `Idempotency-Key`. The `detail` is a fixed text.


            - `PBP-0008`: a dependency (authentication or storage) is
            unavailable.

            - `PBP-0015`: the provider did not answer the account lookup.

            - `PBP-0118`: the holder's registration could not be read.

            - `PBP-0301` (BTG): the accounting routes or the ledger settings
            could not be read.

            - `PBP-0704`: the provider is not installed or not connected for the
            tenant.
      security:
        - BearerAuth: []
components:
  schemas:
    CreateBoletoRequest:
      additionalProperties: false
      properties:
        amount:
          description: >-
            Face value in BRL, as a decimal string with up to 2 decimal places.


            - Lerian (PCR): must be below `100000000.00`. Otherwise 422
            `PBP-0006` naming the member, before anything is recorded.
          examples:
            - '100.00'
          maxLength: 32
          type: string
        discount:
          $ref: '#/components/schemas/DiscountRequest'
          description: >-
            One discount band, granted when the boleto is paid on or before
            `limitDate`. Use `discounts` for more than one. Sending `discount`
            and `discounts` together is refused with 422 `PBP-0006` naming
            `discounts`.
        discounts:
          description: >-
            1 to 3 discount bands, in the order they apply. Each band grants its
            amount when the boleto is paid on or before its `limitDate`.


            - All bands have the type of the first band.

            - Each `limitDate` is after the previous one and before the due
            date. Otherwise 422 `PBP-0006` naming the band, as in
            `discounts[1].limitDate`.

            - One band is the same as `discount`. Do not send both (422
            `PBP-0006` naming `discounts`).

            - More than one band, on a provider that does not register them, is
            refused with 422 `PBP-0701` and `capability`
            `BOLETO_DISCOUNT_BANDS`.
          items:
            $ref: '#/components/schemas/DiscountRequest'
          maxItems: 3
          minItems: 1
          type:
            - array
            - 'null'
        documentNumber:
          description: >-
            Your own reference for the charge (seu número), such as an invoice
            number. Optional. It does not have to be unique, and it is stored as
            sent.


            - 1 to 15 printable ASCII characters (space through tilde: letters
            without accents, digits, space and punctuation).

            - Empty, longer than 15 characters, only spaces, any other character
            (accented letter, control character, non-ASCII) or markup: 400
            `PBP-0001`. A longer value is refused, never cut.

            - A provider that does not register it refuses it with 422
            `PBP-0701` and `capability` `BOLETO_DOCUMENT_NUMBER`. Nothing is
            recorded and the provider is not called.
          examples:
            - NF-2030/0001
          maxLength: 15
          minLength: 1
          pattern: ^[ -~]{1,15}$
          type: string
        dueDate:
          description: >-
            Due date, `YYYY-MM-DD`.


            - Lerian (PCR): at most 3650 days after the issuance day. Otherwise
            422 `PBP-0006` naming the member, before anything is recorded.
          examples:
            - '2030-01-15'
          format: date
          type: string
        fine:
          $ref: '#/components/schemas/FineRequest'
        instructions:
          description: >-
            Free-text instructions printed on the boleto. Optional.


            - BTG: accepted.

            - Lerian (PCR): non-empty instructions are refused with 422
            `PBP-0701` and `capability` `BOLETO_INSTRUCTIONS`. Nothing is
            recorded and the provider is not called.
          type: string
        interest:
          $ref: '#/components/schemas/InterestRequest'
        ledgerId:
          description: >-
            Midaz ledger the account belongs to and the entry is posted to.
            Required. Absent, blank or not a canonical UUID: 400 `PBP-0026`.
          type: string
        midazAccountId:
          description: >-
            Midaz account the boleto settles into. Its holder is the final
            beneficiary.
          type: string
        ourNumber:
          description: >-
            Bank identification of the boleto (nosso número), chosen by you.
            Optional: without it, the provider assigns the number.


            - Digits only. Surrounding spaces are removed. A hyphen is accepted
            only when followed by exactly one digit, which is dropped because
            the bank computes the check digit: `152-3` is sent as `152`; `152-`
            and `152-abc` are refused.

            - Leading zeros do not count: `152` and `00000000152` are the same
            number.

            - Maximum width, in significant digits: BTG 11, Lerian (PCR) 16.
            Read `numbering.maxWidth` in `GET /v1/admin/providers/capabilities`.

            - Format and width refusals: 400 `PBP-0001`. A provider that does
            not accept a number you choose: 422 `PBP-0701` with `capability`
            `CLIENT_SUPPLIED_OUR_NUMBER`.

            - A number held by an active boleto of any type of the same provider
            account (a hybrid issued earlier included) is refused with 422
            `PBP-0108`, before the provider is called. When the holder can be
            read, the `detail` names it and `ourNumberHolderBoletoId` carries
            its id. It can be an earlier emission of the same charge: read it
            before you use another number. When it is an emission still without
            a provider answer, the `detail` says so.

            - After a 422 `PBP-0014` or a `5xx` answered once the emission was
            sent, the number stays held until reconciliation resolves that
            emission, which happens no earlier than a grace period (30 minutes
            by default). Meanwhile that emission can still become a live boleto:
            issuing the same charge with another number can leave two boletos.
            Refusals answered before the emission was sent hold nothing.
          examples:
            - '00000000152'
          type: string
        payer:
          $ref: '#/components/schemas/PayerRequest'
        paymentDeadline:
          description: >-
            Last day the boleto can be paid, `YYYY-MM-DD`. On or after the due
            date.


            - Maximum: BTG, 365 days after the due date. Lerian (PCR), no
            maximum. Out of range: 422 `PBP-0006` naming `paymentDeadline`. A
            fine or interest start date after it is refused the same way.

            - Without it: BTG uses the due date plus the days set for the
            tenant, or 30 days. Lerian (PCR) uses the due date plus the
            `paymentDeadlineDays` of the agreement the boleto is issued under.

            - A provider that does not register it refuses it with 422
            `PBP-0701` and `capability` `BOLETO_PAYMENT_DEADLINE`.
          examples:
            - '2030-02-14'
          format: date
          type: string
        type:
          description: >-
            Boleto type. Send `TRADITIONAL`. `QR_CODE` is refused with 422
            `PBP-0006`. `HYBRID` is refused with 501 `PBP-0127`: hybrid boletos
            (boleto with Pix) are not available.
          examples:
            - TRADITIONAL
          type: string
      required:
        - type
        - payer
        - amount
        - dueDate
        - midazAccountId
      type: object
    CreateBoletoResponse:
      additionalProperties: false
      properties:
        amount:
          type: string
        barcode:
          type: string
        createdAt:
          type: string
        digitableLine:
          type: string
        discount:
          $ref: '#/components/schemas/DiscountResponse'
          description: >-
            The first discount band, whether it was sent as discount or first in
            discounts.
        discounts:
          description: >-
            Every discount band of the boleto, in the order they apply, the
            first included. Absent when the boleto grants no discount.
          items:
            $ref: '#/components/schemas/DiscountResponse'
          type:
            - array
            - 'null'
        documentNumber:
          description: >-
            Your reference for the charge (seu número), as sent. Present only
            when sent. It can hold quotes, `&`, `=`, `+`, `-` or `@`: encode it
            for where you write it, such as a spreadsheet cell or a web page.
          type: string
        dueDate:
          type: string
        fine:
          $ref: '#/components/schemas/FineTermsResponse'
        guarantor:
          $ref: '#/components/schemas/GuarantorResponse'
          description: >-
            Final beneficiary (sacador avalista): the holder of the issuing
            account, read from the account registration at issuance. The request
            never chooses it, and every boleto carries it.
        id:
          type: string
        instructions:
          type: string
        interest:
          $ref: '#/components/schemas/InterestTermsResponse'
        ledgerId:
          description: Midaz ledger the boleto was written with. Always present.
          type: string
        organizationId:
          description: Midaz organization the boleto was written with. Always present.
          type: string
        ourNumber:
          description: >-
            Bank identification of the boleto (nosso número), as the provider
            registered it, with leading zeros, at the provider's width. If you
            sent a different number, this is the one the provider issued.


            - Absent while the provider has not made it known, and on boletos
            issued before this field existed. Reconciliation fills it in later,
            with no action from you.

            - Never sent as an empty string.
          examples:
            - 29
          type: string
        ourNumberDigit:
          description: >-
            Check digit of `ourNumber`, computed by the bank and never accepted
            in a request. Absent when the provider does not return it: providers
            return it only for numbers they assigned, and some never return it.
            Without it, show `ourNumber` alone, with no trailing hyphen. With
            it, show `{ourNumber}-{ourNumberDigit}`.
          examples:
            - '3'
          type: string
        paymentDeadline:
          description: >-
            Last day the boleto can be paid, `YYYY-MM-DD`: the one you sent or,
            without it, the tenant setting or the provider default (Lerian
            (PCR): due date plus the agreement's `paymentDeadlineDays`). Absent
            when the provider registers no deadline, while Lerian (PCR) has not
            answered the emission, and on a resend answered by a boleto recorded
            before the service stored the deadline.
          examples:
            - '2030-01-31'
          format: date
          type: string
        pixLocation:
          description: >-
            Location of the dynamic Pix QR code of a hybrid boleto, whose
            payload is qrCode. Hybrid boletos (boleto with Pix) are not
            available on this service, so this member is absent.
          examples:
            - pix.example.com/qr/v2/cobv/5d9a8e91c88c43db942d01a0ad92ffc3
          type: string
        pixTxId:
          description: >-
            Identifier of the due-date Pix charge of a hybrid boleto. Hybrid
            boletos (boleto with Pix) are not available on this service, so this
            member is absent.
          examples:
            - 35dabf21d3b941e8a937409b8749f281
          type: string
        providerId:
          description: >-
            Identifier the banking provider assigned to this boleto. Absent from
            the 202 response, while the provider's answer is not confirmed; read
            the boleto with GET /v1/boletos/{id} for its current state.
          type: string
        qrCode:
          description: >-
            Pix copy-and-paste code of a hybrid boleto's Pix charge. Hybrid
            boletos (boleto with Pix) are not available on this service, so this
            member is absent.
          type: string
        status:
          type: string
        type:
          type: string
      required:
        - id
        - organizationId
        - ledgerId
        - status
        - type
        - amount
        - dueDate
        - createdAt
      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
    DiscountRequest:
      additionalProperties: false
      properties:
        amount:
          description: >-
            Decimal string greater than zero.


            - `FIXED`: BRL, up to 2 decimal places, below the boleto amount
            (each installment's own amount on installments).

            - `PERCENTAGE`: percent (`2.5` means 2.5%), below 100, up to 6
            decimal places. Lerian (PCR): up to 5.

            - More places, or at or above the ceiling: 422 `PBP-0006` naming it.
          maxLength: 32
          type: string
        limitDate:
          description: >-
            Last day the discount applies, `YYYY-MM-DD`. On or after the
            issuance day (Brazilian calendar) and before the due date: before
            `dueDate` on a single boleto, before `firstDueDate` on installments.
            Outside that window: 422 `PBP-0006`.
          examples:
            - '2029-12-31'
          format: date
          type: string
        type:
          description: >-
            `FIXED` (BRL, up to 2 decimal places) or `PERCENTAGE` (percent of
            the face value, up to 6 decimal places, 5 on Lerian (PCR)). Granted
            when the boleto is paid on or before `limitDate`. Required when a
            discount is sent, together with `amount` and `limitDate`: absent,
            empty or unlisted is refused with 422 `PBP-0006`.
          type: string
      required:
        - amount
        - limitDate
      type: object
    FineRequest:
      additionalProperties: false
      properties:
        amount:
          description: >-
            Decimal string greater than zero.


            - `FIXED`: BRL, up to 2 decimal places.

            - `PERCENTAGE`: percent (`2.5` means 2.5%), up to 6 decimal places.

            - More places: 422 `PBP-0006` naming `fine.amount`.

            - Lerian (PCR): `PERCENTAGE` up to 5 decimal places and at most 100;
            `FIXED` below the boleto amount. Otherwise 422 `PBP-0006` naming the
            member, before anything is recorded.
          maxLength: 32
          type: string
        startDate:
          description: >-
            First day the fine is charged, `YYYY-MM-DD`. Optional. Without it,
            the day after the due date.


            - After the due date and on or before the payment deadline.
            Otherwise 422 `PBP-0006` naming `fine.startDate` (in a batch, an
            item problem `PBP-0006`).

            - Not a calendar date, or `0001-01-01` or earlier: 400 `PBP-0001`
            (in `POST /v1/boletos/batches`, an item problem `PBP-0001` reported
            in 422 `PBP-0123`).

            - Lerian (PCR), without `paymentDeadline`: the deadline is the due
            date plus the agreement's `paymentDeadlineDays`, and a later day is
            refused with 422 `PBP-0006`.

            - `POST /v1/boletos/installments`: the day for the first
            installment. Installment k (from 1) takes that day plus (k - 1)
            times `intervalDays`.

            - A provider that does not register it refuses it with 422
            `PBP-0701` and `capability` `BOLETO_CHARGE_START_DATE`. Nothing is
            recorded.
          examples:
            - '2030-01-16'
          format: date
          type: string
        type:
          description: >-
            `FIXED` (BRL, up to 2 decimal places) or `PERCENTAGE` (percent of
            the face value, up to 6 decimal places, 5 on Lerian (PCR)). Charged
            once, when the boleto is paid after the due date. Required when a
            fine is sent: absent, empty or unlisted is refused with 422
            `PBP-0006`.
          type: string
      required:
        - amount
      type: object
    InterestRequest:
      additionalProperties: false
      properties:
        amount:
          description: >-
            Decimal string greater than zero.


            - `DAILY_FIXED`: BRL per calendar day, up to 2 decimal places.

            - `DAILY_PERCENTAGE` and `MONTHLY_PERCENTAGE`: percent (`1` means
            1%), up to 6 decimal places.

            - Refused amounts: 422 `PBP-0006` naming `interest.amount`.

            - Lerian (PCR): percentages up to 5 decimal places. A
            `DAILY_PERCENTAGE` is registered as 30 times its value per month,
            which must have up to 2 decimal places: `0.001` is 0.03 a month;
            `0.0333` (0.999 a month) is refused. `DAILY_FIXED` below
            `1000000000000`; `MONTHLY_PERCENTAGE`, or 30 times a
            `DAILY_PERCENTAGE`, below `1000000000`.
          maxLength: 32
          type: string
        startDate:
          description: >-
            First day interest accrues, `YYYY-MM-DD`. Optional. Without it, the
            day after the due date.


            - After the due date and on or before the payment deadline.
            Otherwise 422 `PBP-0006` naming `interest.startDate` (in a batch, an
            item problem `PBP-0006`).

            - Not a calendar date, or `0001-01-01` or earlier: 400 `PBP-0001`
            (in `POST /v1/boletos/batches`, an item problem `PBP-0001` reported
            in 422 `PBP-0123`).

            - Lerian (PCR), without `paymentDeadline`: the deadline is the due
            date plus the agreement's `paymentDeadlineDays`, and a later day is
            refused with 422 `PBP-0006`.

            - `POST /v1/boletos/installments`: the day for the first
            installment. Installment k (from 1) takes that day plus (k - 1)
            times `intervalDays`.

            - A provider that does not register it refuses it with 422
            `PBP-0701` and `capability` `BOLETO_CHARGE_START_DATE`. Nothing is
            recorded.
          examples:
            - '2030-01-16'
          format: date
          type: string
        type:
          description: >-
            Accrued for each calendar day the boleto is paid late. Required when
            interest is sent: absent, empty or unlisted is refused with 422
            `PBP-0006`.


            - `DAILY_FIXED`: BRL per day late, up to 2 decimal places.

            - `DAILY_PERCENTAGE`: percent of the face value per day late, up to
            6 decimal places (5 on Lerian (PCR), where 30 times it must have up
            to 2).

            - `MONTHLY_PERCENTAGE`: percent of the face value per month, accrued
            per calendar day over a 30-day month, up to 6 decimal places (5 on
            Lerian (PCR)).
          type: string
      required:
        - amount
      type: object
    PayerRequest:
      additionalProperties: false
      properties:
        address:
          $ref: '#/components/schemas/AddressRequest'
        document:
          description: Payer CPF or CNPJ, digits only.
          type: string
        name:
          description: Payer full name.
          type: string
      required:
        - document
        - name
      type: object
    DiscountResponse:
      additionalProperties: false
      properties:
        amount:
          type: string
        limitDate:
          type: string
        type:
          type: string
      required:
        - type
        - amount
        - limitDate
      type: object
    FineTermsResponse:
      additionalProperties: false
      properties:
        amount:
          type: string
        startDate:
          description: >-
            First day the fine applies, `YYYY-MM-DD`. Present only when sent at
            issuance; absent, it applies from the day after the due date. On an
            installment, the installment's own day, shifted from the first
            installment's.
          type: string
        type:
          type: string
      required:
        - type
        - amount
      type: object
    GuarantorResponse:
      additionalProperties: false
      properties:
        address:
          $ref: '#/components/schemas/AddressResponse'
          description: >-
            Never filled for the final beneficiary: the issuing account's
            registration data carries no address for it. Kept so the shape of
            this component does not change.
        document:
          description: >-
            CPF or CNPJ of the final beneficiary, the issuing account's holder,
            as registered. Answered whole, never masked, wherever this component
            appears.
          type: string
        name:
          description: >-
            Name of the final beneficiary, the issuing account's holder, as
            registered and in full. The printed boleto may abbreviate it; this
            member never does.
          type: string
      required:
        - name
        - document
      type: object
    InterestTermsResponse:
      additionalProperties: false
      properties:
        amount:
          type: string
        startDate:
          description: >-
            First day interest accrues, `YYYY-MM-DD`. Present only when sent at
            issuance; absent, it accrues from the day after the due date. On an
            installment, the installment's own day, shifted from the first
            installment's.
          type: string
        type:
          type: string
      required:
        - type
        - amount
      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: 'Never returned: the service drops the rejected value.'
      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
    AddressRequest:
      additionalProperties: false
      properties:
        city:
          type: string
        complement:
          type: string
        neighborhood:
          type: string
        number:
          type: string
        state:
          type: string
        street:
          type: string
        zipCode:
          type: string
      type: object
    AddressResponse:
      additionalProperties: false
      properties:
        city:
          type: string
        complement:
          type: string
        neighborhood:
          type: string
        number:
          type: string
        state:
          type: string
        street:
          type: string
        zipCode:
          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.