> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a write-off

> Returns one of the tenant's write-offs, with its route, settlement, credit state, hold and cancellation deadline.

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

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

**How it works**

- The response never carries payer data.



## OpenAPI

````yaml /pt/openapi/v3-current/payments-pcr.yaml get /v1/collections/write-offs/{write_off_id}
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/collections/write-offs/{write_off_id}:
    get:
      tags:
        - Collections Write-offs
      summary: Get a write-off
      description: >-
        Returns one of the tenant's write-offs, with its route, settlement,
        credit state, hold and cancellation deadline.


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


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


        **How it works**


        - The response never carries payer data.
      operationId: getWriteOff
      parameters:
        - description: Identifier of the write-off.
          in: path
          name: write_off_id
          required: true
          schema:
            description: Identifier of the write-off.
            examples:
              - 5b0c1e2d-3f4a-4b5c-8d6e-7f8091a2b3c4
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WriteOff'
          description: OK. The write-off.
        '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: Write-off not found'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0005
                    title: Not Found
                    status: 404
                    detail: write-off not found
                    code: PBP-0005
          description: |-
            Not Found.

            - `PBP-0005`: the tenant has no write-off with this id.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0006:
                  summary: 'PBP-0006: Request does not match the schema'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0006
                    title: Unprocessable Entity
                    status: 422
                    detail: validation failed
                    code: PBP-0006
                PBP-0830:
                  summary: 'PBP-0830: Collections not enabled'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0830
                    title: Collections Not Enabled
                    status: 422
                    detail: Collections Not Enabled
                    code: PBP-0830
          description: >-
            Unprocessable Entity.


            - `PBP-0006`: `write_off_id` is not a UUID.

            - `PBP-0830`: the tenant does not have the collections module.
            Retrying does not change the answer.


            See the [error
            list](/pt/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. Contact support.
        '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
          description: >-
            Service Unavailable. The `detail` is a fixed text.


            - `PBP-0008`: a dependency (authentication or the tenant's storage)
            is unavailable. The request was not processed. Wait and retry.
      security:
        - BearerAuth: []
components:
  schemas:
    WriteOff:
      additionalProperties: false
      properties:
        accountId:
          description: >-
            Midaz account of the title, the account that issues it: the
            write-off's credit always goes to it, under a pooled account too.
          examples:
            - 0192a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a6d
          format: uuid
          type: string
        amount:
          description: >-
            Amount of the write-off in reais, as a decimal string with two
            decimal places: the one Núclea notified, or the title's when the
            write-off carries none.
          examples:
            - '1000.00'
          maxLength: 32
          pattern: ^[0-9]{1,15}(\.[0-9]{1,2})?$
          type: string
        cancellationDeadline:
          description: >-
            End of the period in which the write-off can be cancelled, RFC 3339
            in UTC: the one the PCR gave or, when it gave none, 23:59:59 in
            Brasília of the first business day of the SILOC calendar after the
            settlement date of the route. Null only on route NONE.
          examples:
            - '2026-11-12T02:59:59Z'
          format: date-time
          type:
            - string
            - 'null'
        cancelled:
          description: Whether the write-off was cancelled.
          examples:
            - false
          type: boolean
        creditReleaseDate:
          description: >-
            First day the credit can be released: the write-off's movement day
            plus the title's creditDelayBusinessDays business days of the SILOC
            calendar. The movement day is the civil date of writeOffAt in
            Brasília, or the next business day when it falls on a weekend or
            holiday. The release waits for this date and for the settlement and,
            under the title's releasePolicy AFTER_CANCELLATION_WINDOW, for the
            end of the cancellation deadline. Null until the credit is owed, and
            always on route NONE.
          examples:
            - '2026-11-12'
          format: date
          type:
            - string
            - 'null'
        creditState:
          description: >-
            Where the write-off's credit is. NONE: no credit, because the
            write-off moves no money or was cancelled before its credit was
            owed. TO_RELEASE: credit waiting for its release. RELEASED: credit
            released to the account. REVERSED: credit reversed before its
            release, the write-off cancelled. CHARGEBACK_PENDING: a reversal
            after the release that the ledger refused, waiting to be processed
            again. CHARGED_BACK: credit reversed after its release.
          enum:
            - NONE
            - TO_RELEASE
            - RELEASED
            - REVERSED
            - CHARGEBACK_PENDING
            - CHARGED_BACK
          examples:
            - TO_RELEASE
          type: string
        expectedCycleDate:
          description: >-
            Date of the SILOC cycle the write-off is expected to settle in; null
            when the PCR gave none.
          examples:
            - '2026-11-11'
          format: date
          type:
            - string
            - 'null'
        held:
          description: >-
            Whether the release of the write-off's credit is held; holdReason
            says why.
          examples:
            - false
          type: boolean
        holdReason:
          description: >-
            Why the release is held. STR_UNCONFIRMED: an STR write-off whose
            credit nobody confirmed yet. NOT_SETTLED_IN_CYCLE: a CMP write-off
            its cycle did not settle. SETTLEMENT_OVERDUE: a CMP write-off still
            without its settlement past its expected cycle and the tolerance.
            NEGOTIATED: a write-off of a boleto flagged as negotiated. Null when
            the release is not held.
          oneOf:
            - enum:
                - STR_UNCONFIRMED
                - NOT_SETTLED_IN_CYCLE
                - SETTLEMENT_OVERDUE
                - NEGOTIATED
              type: string
            - type: 'null'
        id:
          description: Identifier of the write-off.
          examples:
            - 5b0c1e2d-3f4a-4b5c-8d6e-7f8091a2b3c4
          format: uuid
          type: string
        organizationId:
          description: Midaz organization of the title's account.
          examples:
            - 0192a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a6b
          format: uuid
          readOnly: true
          type: string
        origin:
          description: >-
            Message the write-off reached the PCR by. DDA0108R2: a write-off
            notice by message. ADDA108RR2: a write-off notice by file.
            ADDA114RR2: a write-off notice of the receiving contingency file.
            ADDA120: the lapse of the title after its payment deadline, which
            carries neither an identifier nor an amount of Núclea. DESTINATARIA:
            a write-off by the Destinatária, which carries no amount.
          enum:
            - DDA0108R2
            - ADDA108RR2
            - ADDA114RR2
            - ADDA120
            - DESTINATARIA
          examples:
            - DDA0108R2
          type: string
        pcrWriteOffId:
          description: >-
            Identifier Núclea gave the write-off (NumIdentcBaixa); null only on
            the lapse of the title (origin ADDA120), which carries none.
          examples:
            - '2026101400000098765'
          pattern: ^[0-9]{1,19}$
          type:
            - string
            - 'null'
        receivedAt:
          description: >-
            When collections received the notice of the write-off, RFC 3339 in
            UTC; not when the write-off happened (writeOffAt).
          examples:
            - '2026-11-10T16:43:05Z'
          format: date-time
          type: string
        route:
          description: >-
            Route the write-off settles by. CMP: a SILOC cycle. STR: the STR,
            outside the cycles. INTRABANK: inside the institution, on the
            write-off itself. PIX: Pix, outside the cycles. NONE: no money
            moves, so the write-off never makes a credit.
          enum:
            - CMP
            - STR
            - INTRABANK
            - PIX
            - NONE
          examples:
            - STR
          type: string
        scheduledRelease:
          description: >-
            Manual release an operator scheduled for a date, cancellable until
            it; null when none is scheduled.
          oneOf:
            - $ref: '#/components/schemas/WriteOffScheduledRelease'
            - type: 'null'
        settledAt:
          description: >-
            When the money of the write-off settled on its route, RFC 3339 in
            UTC; null while it has not.
          examples:
            - '2026-11-11T08:20:00Z'
          format: date-time
          type:
            - string
            - 'null'
        settlementState:
          description: >-
            Where the money of the write-off is on its route.
            AWAITING_SETTLEMENT: not settled yet. SETTLED: settled, at
            settledAt. NOT_SETTLED: a CMP write-off its cycle did not settle.
            NO_MOVEMENT: route NONE, with nothing to settle.
          enum:
            - AWAITING_SETTLEMENT
            - SETTLED
            - NOT_SETTLED
            - NO_MOVEMENT
          examples:
            - AWAITING_SETTLEMENT
          type: string
        titleId:
          description: Collections title the write-off is of.
          examples:
            - 7c9e6679-7425-40de-944b-e07fc1f90ae7
          format: uuid
          type: string
        type:
          description: >-
            Type of the write-off at Núclea (TpBaixa), such as 0 for a full
            interbank write-off or 9 for a full write-off via STR; null on the
            lapse of the title.
          examples:
            - '9'
          pattern: ^[0-9]{1,2}$
          type:
            - string
            - 'null'
        writeOffAt:
          description: >-
            When the write-off happened at Núclea (DtHrSitBaixa), RFC 3339 in
            UTC: the base of the credit release date and of the cancellation
            deadline. Null only on route NONE, on the lapse of the title, which
            carries none.
          examples:
            - '2026-11-10T16:42:00Z'
          format: date-time
          type:
            - string
            - 'null'
      required:
        - id
        - titleId
        - organizationId
        - pcrWriteOffId
        - origin
        - amount
        - route
        - writeOffAt
        - settlementState
        - creditState
        - held
        - cancelled
        - receivedAt
      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
    WriteOffScheduledRelease:
      additionalProperties: false
      properties:
        auditActionId:
          description: Entry of the audit trail that records the scheduling.
          examples:
            - 0192a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a31
          format: uuid
          type: string
        scheduledAt:
          description: When the release was scheduled, RFC 3339 in UTC.
          examples:
            - '2026-11-11T13:00:00Z'
          format: date-time
          type: string
        scheduledBy:
          $ref: '#/components/schemas/Actor'
          description: Who scheduled the release.
        scheduledFor:
          description: Date the release is scheduled for.
          examples:
            - '2026-11-13'
          format: date
          type: string
      required:
        - scheduledFor
        - scheduledAt
        - scheduledBy
        - auditActionId
      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
    Actor:
      additionalProperties: false
      properties:
        clientId:
          description: OAuth client that presented the token, null when unknown.
          examples:
            - console
          maxLength: 128
          type:
            - string
            - 'null'
        id:
          description: >-
            Subject of the token, or the name of the service's worker for
            SYSTEM.
          examples:
            - a1b2c3d4-0000-4000-8000-000000000001
          maxLength: 128
          type: string
        type:
          description: >-
            USER for a person's token, MACHINE for a machine client's, SYSTEM
            for the service itself.
          enum:
            - USER
            - MACHINE
            - SYSTEM
          examples:
            - USER
          type: string
      required:
        - type
        - id
      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.