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

# Request an amendment of a registered boleto

> Requests a change to the terms of a registered boleto. The digitable line and the barcode never change.

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

<Warning>**Under development.** This endpoint can change before it is released.</Warning>

**How it works**

- Send only the members that change, each with its final value: `dueDate`, `amount`, `discounts`, `fine`, `interest`, `paymentDeadline` and `documentNumber`.
- `discounts` replaces the whole list. An empty list removes every band.
- `fine: null` and `interest: null` exempt the boleto from that charge. `documentNumber: null` removes it. Each needs its own provider capability.
- Lerian (PCR) does not amend `documentNumber` and does not exempt fine or interest today: those requests are refused with `422 PBP-0701` (`BOLETO_AMEND_DOCUMENT_NUMBER`, `BOLETO_AMEND_FINE_EXEMPTION`, `BOLETO_AMEND_INTEREST_EXEMPTION`).
- BTG does not amend boletos today: every request is refused with `422 PBP-0701` (`BOLETO_AMEND`).
- The resulting terms follow the issuance rules and are checked before anything is sent to the provider.
- Refused: a due date before today, a deadline or a fine or interest start moved before today, or a due date moved past the deadline in force without a new deadline.
- `201` with status `APPLIED`: the provider applied it in its answer. `202` with status `PENDING`: the provider's outcome is awaited.
- Both return a `Location` header for the request. The body is a receipt; read the current state from `Location`.
- A provider refusal closes the request as `REJECTED`. The answer carries `amendmentId` and `Location`.
- Refusals before anything is sent record no request and carry no `amendmentId`.
- A resend under the same `Idempotency-Key` returns the same receipt. Once the record expires, it returns `200` with the request as it is now.
- Member order, trailing zeros and spacing do not count when the content is compared. Use one key per intended amendment.



## OpenAPI

````yaml /pt/openapi/v3-current/payments-pcr.yaml post /v1/boletos/{id}/amendments
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/{id}/amendments:
    post:
      tags:
        - Boletos
      summary: Request an amendment of a registered boleto
      description: >-
        Requests a change to the terms of a registered boleto. The digitable
        line and the barcode never change.


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


        <Warning>**Under development.** This endpoint can change before it is
        released.</Warning>


        **How it works**


        - Send only the members that change, each with its final value:
        `dueDate`, `amount`, `discounts`, `fine`, `interest`, `paymentDeadline`
        and `documentNumber`.

        - `discounts` replaces the whole list. An empty list removes every band.

        - `fine: null` and `interest: null` exempt the boleto from that charge.
        `documentNumber: null` removes it. Each needs its own provider
        capability.

        - Lerian (PCR) does not amend `documentNumber` and does not exempt fine
        or interest today: those requests are refused with `422 PBP-0701`
        (`BOLETO_AMEND_DOCUMENT_NUMBER`, `BOLETO_AMEND_FINE_EXEMPTION`,
        `BOLETO_AMEND_INTEREST_EXEMPTION`).

        - BTG does not amend boletos today: every request is refused with `422
        PBP-0701` (`BOLETO_AMEND`).

        - The resulting terms follow the issuance rules and are checked before
        anything is sent to the provider.

        - Refused: a due date before today, a deadline or a fine or interest
        start moved before today, or a due date moved past the deadline in force
        without a new deadline.

        - `201` with status `APPLIED`: the provider applied it in its answer.
        `202` with status `PENDING`: the provider's outcome is awaited.

        - Both return a `Location` header for the request. The body is a
        receipt; read the current state from `Location`.

        - A provider refusal closes the request as `REJECTED`. The answer
        carries `amendmentId` and `Location`.

        - Refusals before anything is sent record no request and carry no
        `amendmentId`.

        - A resend under the same `Idempotency-Key` returns the same receipt.
        Once the record expires, it returns `200` with the request as it is now.

        - Member order, trailing zeros and spacing do not count when the content
        is compared. Use one key per intended amendment.
      operationId: requestBoletoAmendment
      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: >-
            Client-supplied idempotency key, a UUID, one per intended amendment.
            Required: a request without it, with a value that is not a UUID, or
            with the nil UUID is refused with 400 PBP-0012.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            description: >-
              Client-supplied idempotency key, a UUID, one per intended
              amendment. Required: a request without it, with a value that is
              not a UUID, or with the nil UUID is refused with 400 PBP-0012.
            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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BoletoAmendmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoletoAmendmentResponse'
          description: >-
            OK. A resend under the same `Idempotency-Key` after its record
            expired: the recorded request as it is now.
          headers:
            Location:
              schema:
                description: URL of the amendment request.
                type: string
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoletoAmendmentResponse'
          description: >-
            Created. The provider applied the request: status `APPLIED`. The
            body is a receipt at that moment.
          headers:
            Location:
              schema:
                description: URL of the amendment request.
                type: string
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoletoAmendmentResponse'
          description: >-
            Accepted. The request is `PENDING` until the provider answers. Read
            its current state from `Location`.
          headers:
            Location:
              schema:
                description: URL of the amendment request.
                type: string
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0001:
                  summary: 'PBP-0001: Request 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: expected string, got null
                        location: body.dueDate
                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
          description: >-
            Bad Request.


            - `PBP-0001`: the body does not match the schema, or `dueDate`,
            `amount`, `discounts` or `paymentDeadline` is null.

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

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


            See the [error
            list](/pt/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 for this
            operation.
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0005:
                  summary: 'PBP-0005: Boleto not found'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0005
                    title: Not Found
                    status: 404
                    detail: boleto not found
                    code: PBP-0005
          description: >-
            Not Found.


            - `PBP-0005`: the boleto does not exist, or belongs to another
            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
                PBP-0130:
                  summary: 'PBP-0130: Amendment already pending'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0130
                    title: Amendment In Progress
                    status: 409
                    detail: >-
                      boleto already has an amendment awaiting the provider's
                      confirmation
                    code: PBP-0130
                    pendingAmendmentId: 0196a3c2-8f4e-7b1a-9c2d-3e4f5a6b7c8d
                PBP-0133:
                  summary: 'PBP-0133: Cancellation pending'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0133
                    title: Cancellation Pending
                    status: 409
                    detail: boleto has a cancellation awaiting the provider's answer
                    code: PBP-0133
          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.

            - `PBP-0130`: another amendment of this boleto is awaiting the
            provider. `pendingAmendmentId` names it.

            - `PBP-0133`: a cancellation of this boleto is awaiting the
            provider.

            - Provider refusal: the provider's own code registered as `409`,
            with `providerReason` when given. The request is `REJECTED` and
            `Location` names it.


            See the [error
            list](/pt/reference/interfaces/payments-btg/payments-error-list) for
            every code.
        '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: dueDate must not be before today
                    code: PBP-0006
                PBP-0013:
                  summary: 'PBP-0013: Key used for another request'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0013
                    title: Idempotency Key Conflict
                    status: 422
                    detail: >-
                      the Idempotency-Key was already used for another amendment
                      request; use a new key
                    code: PBP-0013
                PBP-0131:
                  summary: 'PBP-0131: Boleto not amendable'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0131
                    title: Boleto Not Amendable
                    status: 422
                    detail: >-
                      boleto cannot be amended in status SETTLED, only CREATED
                      boletos can be amended
                    code: PBP-0131
                PBP-0132:
                  summary: 'PBP-0132: Member not amendable'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0132
                    title: Amendment Field Not Allowed
                    status: 422
                    detail: the amendment changes no member
                    code: PBP-0132
                PBP-0135:
                  summary: 'PBP-0135: Terms already in force'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0135
                    title: Amendment Changes Nothing
                    status: 422
                    detail: >-
                      the amendment asks for the terms in force; nothing was
                      recorded
                    code: PBP-0135
                PBP-0701:
                  summary: 'PBP-0701: Capability not supported'
                  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_AMEND_DUE_DATE
          description: >-
            Unprocessable Entity.


            - `PBP-0006`: a resulting term breaks an issuance rule. The `detail`
            names the member.

            - `PBP-0013`: the `Idempotency-Key` was used with other content.
            Send under a new key.

            - `PBP-0131`: the boleto is not registered and open.

            - `PBP-0132`: the body is empty, or has a member no amendment
            changes. The `detail` names it.

            - `PBP-0135`: the resulting terms are the terms in force. Lerian
            (PCR): a `MONTHLY_PERCENTAGE` interest equal to 30 times a
            `DAILY_PERCENTAGE` is the same term.

            - `PBP-0701`: the provider does not declare a capability the
            amendment needs: `BOLETO_AMEND`, `BOLETO_AMEND_DUE_DATE`,
            `BOLETO_AMEND_AMOUNT`, `BOLETO_AMEND_DISCOUNTS`,
            `BOLETO_AMEND_FINE`, `BOLETO_AMEND_INTEREST`,
            `BOLETO_AMEND_PAYMENT_DEADLINE`, `BOLETO_AMEND_DOCUMENT_NUMBER`,
            `BOLETO_AMEND_FINE_EXEMPTION` or `BOLETO_AMEND_INTEREST_EXEMPTION`.
            The `capability` member names it. Nothing is written.

            - Provider refusal: the provider's own code registered as `422`,
            with `providerReason` when given. The request is `REJECTED` and
            `Location` names it.


            See the [error
            list](/pt/reference/interfaces/payments-btg/payments-error-list) for
            every code.
          headers:
            Location:
              description: >-
                URL of the amendment request. Only on a refusal by the provider,
                which recorded the request.
              schema:
                format: uri-reference
                type: string
        '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 a provider refusal with a
            code outside its declared catalog. Contact support. Do not resend
            under a new key.
        '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`: the boleto is a hybrid boleto (boleto with Pix), which
            is not available. No request is recorded. 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-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 processed. Retry under the same
            `Idempotency-Key`. The `detail` is a fixed text.


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

            - `PBP-0704`: the provider recorded on the boleto is not installed.
      security:
        - BearerAuth: []
components:
  schemas:
    BoletoAmendmentRequest:
      additionalProperties: true
      properties:
        amount:
          description: >-
            New amount as a decimal string, positive, at most two decimal
            places. Cannot be null. On LERIAN it must be below 100000000.00;
            otherwise 422 PBP-0006 naming the member, before anything is
            recorded.
          examples:
            - '150.00'
          maxLength: 32
          type: string
        discounts:
          description: >-
            The whole new list of discount bands, under the issuance's rules for
            bands; an empty list removes every band. Cannot be null.
          items:
            $ref: '#/components/schemas/DiscountRequest'
          maxItems: 3
          type: array
        documentNumber:
          description: >-
            New payee's reference of the charge (seu numero), 1 to 15 printable
            ASCII characters. null removes it.
          examples:
            - INV-0042
          maxLength: 15
          minLength: 1
          pattern: ^[ -~]{1,15}$
          type:
            - string
            - 'null'
        dueDate:
          description: >-
            New due date, YYYY-MM-DD, not before today in Brazil. Cannot be
            null. On LERIAN it must be at most 3650 days after the day of
            issuance; otherwise 422 PBP-0006 naming the member, before anything
            is recorded.
          examples:
            - '2030-01-20'
          format: date
          type: string
        fine:
          additionalProperties: false
          description: New fine. null exempts the boleto from the fine.
          properties:
            amount:
              description: >-
                Fine amount as a decimal string, greater than zero. On LERIAN a
                PERCENTAGE must be at most 100 and a FIXED below the boleto's
                amount; otherwise 422 PBP-0006 naming the member, before
                anything is recorded.
              maxLength: 32
              type: string
            startDate:
              description: >-
                Day the fine starts to apply, YYYY-MM-DD: after the resulting
                due date, on or before the resulting payment deadline, and not
                before today; otherwise 422 PBP-0006 naming fine.startDate.
                Absent, the day after the resulting due date. On LERIAN, without
                paymentDeadline in the request, the resulting payment deadline
                is the one the boleto holds, which a new due date does not move,
                and a later day is refused: 422 PBP-0006 naming the member,
                before anything is recorded.
              examples:
                - '2030-01-21'
              format: date
              type: string
            type:
              description: >-
                Fine type, charged once when the boleto is paid after its due
                date: FIXED (amount in BRL, at most 2 decimal places) or
                PERCENTAGE (percent of the boleto's amount, at most 6 decimal
                places, 5 on LERIAN). An absent, empty or unlisted value is
                refused with 422 PBP-0006.
              type: string
          required:
            - amount
          type:
            - object
            - 'null'
        interest:
          additionalProperties: false
          description: New interest. null exempts the boleto from interest.
          properties:
            amount:
              description: >-
                Interest amount as a decimal string, greater than zero. On
                LERIAN a DAILY_FIXED must be below 1000000000000, and a
                MONTHLY_PERCENTAGE, or 30 times a DAILY_PERCENTAGE, below
                1000000000; otherwise 422 PBP-0006 naming the member, before
                anything is recorded.
              maxLength: 32
              type: string
            startDate:
              description: >-
                Day the interest starts to accrue, YYYY-MM-DD: after the
                resulting due date, on or before the resulting payment deadline,
                and not before today; otherwise 422 PBP-0006 naming
                interest.startDate. Absent, the day after the resulting due
                date. On LERIAN, without paymentDeadline in the request, the
                resulting payment deadline is the one the boleto holds, which a
                new due date does not move, and a later day is refused: 422
                PBP-0006 naming the member, before anything is recorded.
              examples:
                - '2030-01-21'
              format: date
              type: string
            type:
              description: >-
                Interest type, accrued for each calendar day the boleto is paid
                late: DAILY_FIXED (BRL per day, at most 2 decimal places),
                DAILY_PERCENTAGE or MONTHLY_PERCENTAGE (percent of the boleto's
                amount, at most 6 decimal places, 5 on LERIAN, where 30 times a
                DAILY_PERCENTAGE, the monthly rate it is registered as, must
                have at most 2). An absent, empty or unlisted value is refused
                with 422 PBP-0006.
              type: string
          required:
            - amount
          type:
            - object
            - 'null'
        paymentDeadline:
          description: >-
            New last day the boleto can be paid, YYYY-MM-DD, on or after the
            resulting due date and within the provider's maximum after it,
            LERIAN declaring none. It can be changed, never removed: null is
            refused with 400 PBP-0001.
          examples:
            - '2030-02-20'
          format: date
          type: string
      type: object
    BoletoAmendmentResponse:
      additionalProperties: false
      properties:
        boletoId:
          description: Boleto the request amends.
          format: uuid
          type: string
        effectiveTerms:
          $ref: '#/components/schemas/BoletoAmendmentTerms'
          description: >-
            Every term in force once the request was applied; present on
            APPLIED. A null member is a clause or reference the boleto does not
            have.
        id:
          description: Amendment request identifier.
          format: uuid
          type: string
        provider:
          description: Provider of the boleto.
          type: string
        rejection:
          $ref: '#/components/schemas/BoletoAmendmentRejection'
          description: >-
            Why the request was refused; present on REJECTED and on a SUPERSEDED
            request the provider refused afterwards.
        requestedAt:
          description: When the request was recorded, in UTC.
          format: date-time
          type: string
        requestedChanges:
          $ref: '#/components/schemas/BoletoAmendmentTerms'
          description: >-
            The members the request changes, with their final values, in
            normalized form: null exempts a fine or interest, or removes the seu
            numero.
        resolvedAt:
          description: When the request was decided, in UTC; absent while it is PENDING.
          format: date-time
          type: string
        status:
          description: >-
            PENDING while the provider's outcome is awaited; APPLIED and
            REJECTED once decided; SUPERSEDED when a cancellation of the boleto
            came first.
          enum:
            - PENDING
            - APPLIED
            - REJECTED
            - SUPERSEDED
          type: string
      required:
        - id
        - boletoId
        - status
        - requestedChanges
        - requestedAt
        - provider
      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
    BoletoAmendmentTerms:
      additionalProperties: false
      properties:
        amount:
          description: Amount as a decimal string, without trailing zeros.
          examples:
            - '150.5'
          type: string
        discounts:
          description: >-
            The discount bands, in the order they apply; an empty list is no
            band.
          items:
            $ref: '#/components/schemas/BoletoAmendmentDiscount'
          type: array
        documentNumber:
          description: The payee's reference of the charge (seu numero); null is none.
          examples:
            - INV-0042
          type:
            - string
            - 'null'
        dueDate:
          description: Due date, YYYY-MM-DD.
          examples:
            - '2030-01-20'
          format: date
          type: string
        fine:
          additionalProperties: false
          description: The fine; null is no fine.
          properties:
            amount:
              description: Clause amount as a decimal string.
              examples:
                - '2'
              type: string
            startDate:
              description: Day the clause starts; absent, the day after the due date.
              examples:
                - '2030-01-21'
              format: date
              type: string
            type:
              description: Clause type.
              examples:
                - PERCENTAGE
              type: string
          required:
            - type
            - amount
          type:
            - object
            - 'null'
        interest:
          additionalProperties: false
          description: The interest; null is no interest.
          properties:
            amount:
              description: Clause amount as a decimal string.
              examples:
                - '2'
              type: string
            startDate:
              description: Day the clause starts; absent, the day after the due date.
              examples:
                - '2030-01-21'
              format: date
              type: string
            type:
              description: Clause type.
              examples:
                - PERCENTAGE
              type: string
          required:
            - type
            - amount
          type:
            - object
            - 'null'
        paymentDeadline:
          description: >-
            Last day the boleto can be paid, YYYY-MM-DD; null when none is
            recorded.
          examples:
            - '2030-02-20'
          format: date
          type:
            - string
            - 'null'
      type: object
    BoletoAmendmentRejection:
      additionalProperties: false
      properties:
        code:
          description: Product code of the refusal.
          examples:
            - PBP-0014
          type: string
        detail:
          description: Explanation of the refusal.
          type: string
        providerReason:
          description: Stable reason of the provider's rule, when it gave one.
          type: string
        status:
          description: Status of the refusal.
          examples:
            - 422
          format: int64
          type: integer
        title:
          description: Short summary of the refusal.
          examples:
            - Unprocessable Entity
          type: string
      required:
        - title
        - status
        - detail
        - code
      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
    BoletoAmendmentDiscount:
      additionalProperties: false
      properties:
        amount:
          description: Discount amount as a decimal string.
          examples:
            - '5'
          type: string
        limitDate:
          description: Last day the discount applies, YYYY-MM-DD.
          examples:
            - '2030-01-10'
          format: date
          type: string
        type:
          description: Discount type.
          examples:
            - FIXED
          type: string
      required:
        - type
        - amount
        - limitDate
      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.