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

# Set the connection to the PCR

> <Warning>**Under development.** This Payments PCR preview is subject to change. Endpoint descriptions distinguish current behavior from planned changes. Confirm availability with Lerian before integration.</Warning>

Creates or replaces the tenant's connection to its institution's PCR: the PCR address (`baseUrl`), the ISPB and the bank code (barcode positions 1 to 3).

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

**How it works**

- No credential or secret travels through this API. The platform provisions the service's PCR credential outside it.
- `baseUrl` must match a PCR destination the platform allows the tenant, by scheme, host and port. Any other is refused with `PBP-0818`.
- Bank code 000 is refused with `PBP-0006`. Bank code 988, an institution without its own number code, is refused with `PBP-0801`.
- The bank code is part of every barcode the connection composes. Once a title of the connection has a composed barcode, even pending submission, a `bankCode` change is refused with `PBP-0802`. A title withdrawn before it was sent does not count.
- The tenant has one connection. Omit `version` only to create it. To replace it, send the `version` you last read. Any other is refused with `PBP-0803`, and nothing is written.
- Every change is recorded in the collections audit trail with its `reason` and the identity that made it.



## OpenAPI

````yaml /pt/openapi/v3-current/payments-pcr.yaml put /v1/collections/connection
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/connection:
    put:
      tags:
        - Collections Settings
      summary: Set the connection to the PCR
      description: >-
        <Warning>**Under development.** This Payments PCR preview is subject to
        change. Endpoint descriptions distinguish current behavior from planned
        changes. Confirm availability with Lerian before integration.</Warning>


        Creates or replaces the tenant's connection to its institution's PCR:
        the PCR address (`baseUrl`), the ISPB and the bank code (barcode
        positions 1 to 3).


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


        **How it works**


        - No credential or secret travels through this API. The platform
        provisions the service's PCR credential outside it.

        - `baseUrl` must match a PCR destination the platform allows the tenant,
        by scheme, host and port. Any other is refused with `PBP-0818`.

        - Bank code 000 is refused with `PBP-0006`. Bank code 988, an
        institution without its own number code, is refused with `PBP-0801`.

        - The bank code is part of every barcode the connection composes. Once a
        title of the connection has a composed barcode, even pending submission,
        a `bankCode` change is refused with `PBP-0802`. A title withdrawn before
        it was sent does not count.

        - The tenant has one connection. Omit `version` only to create it. To
        replace it, send the `version` you last read. Any other is refused with
        `PBP-0803`, and nothing is written.

        - Every change is recorded in the collections audit trail with its
        `reason` and the identity that made it.
      operationId: putPcrConnection
      parameters:
        - 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/PutPcrConnectionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PcrConnection'
          description: OK. The connection as stored.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0001:
                  summary: 'PBP-0001: Body missing or invalid'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0001
                    title: Bad Request
                    status: 400
                    detail: the body is missing or is not valid JSON
                    code: PBP-0001
                PBP-0012:
                  summary: 'PBP-0012: Idempotency-Key missing'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0012
                    title: Idempotency Key Required
                    status: 400
                    detail: The Idempotency-Key header is required for this endpoint.
                    code: PBP-0012
          description: >-
            Bad Request.


            - `PBP-0001`: the body is missing or is not valid JSON.

            - `PBP-0012`: `Idempotency-Key` is missing, is not a UUID, or is the
            nil 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 is required to access this resource.
                    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: You do not have permission to access this resource.
                    code: PBP-0004
          description: >-
            Forbidden.


            - `PBP-0004`: the credential does not have permission for this
            operation.
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                PBP-0803:
                  summary: 'PBP-0803: Version is not current'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0803
                    title: Version Mismatch
                    status: 409
                    detail: Version Mismatch
                    code: PBP-0803
                PBP-0007:
                  summary: 'PBP-0007: Same key still running'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0007
                    title: Request In Progress
                    status: 409
                    detail: >-
                      A request with this idempotency key is already being
                      processed.
                    code: PBP-0007
          description: >-
            Conflict.


            - `PBP-0803`: the connection changed since it was read: `version` is
            not the current one, was omitted while the connection exists, or was
            sent before it exists. Nothing was written. Read the connection
            again and send the change with the current `version`.

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


            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: The request payload is 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: Value breaks a rule'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0006
                    title: Unprocessable Entity
                    status: 422
                    detail: invalid bank code
                    code: PBP-0006
                PBP-0801:
                  summary: 'PBP-0801: Bank code 988 not supported'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0801
                    title: Capability Not Supported
                    status: 422
                    detail: institution without a number code is not supported
                    code: PBP-0801
                PBP-0818:
                  summary: 'PBP-0818: PCR address not allowed'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0818
                    title: PCR Destination Not Allowed
                    status: 422
                    detail: PCR Destination Not Allowed
                    code: PBP-0818
                PBP-0802:
                  summary: 'PBP-0802: Bank code locked'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0802
                    title: Action Not Allowed In State
                    status: 422
                    detail: >-
                      bankCode cannot change after the first title of the
                      connection got a composed barcode
                    code: PBP-0802
                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
                PBP-0013:
                  summary: 'PBP-0013: Key used with another body'
                  value:
                    type: https://errors.lerian.studio/v1/PBP-0013
                    title: Idempotency Key Conflict
                    status: 422
                    detail: >-
                      The request body does not match the original request for
                      this idempotency key.
                    code: PBP-0013
          description: >-
            Unprocessable Entity. Refused, and nothing was written.


            - `PBP-0006`: the body does not match the schema, or a value breaks
            a rule, such as bank code 000 or a reason shorter than 10 characters
            once trimmed.

            - `PBP-0801`: bank code 988, an institution without its own number
            code.

            - `PBP-0818`: `baseUrl` is outside the PCR destinations the platform
            allows the tenant. Ask the platform to add the PCR address and send
            again.

            - `PBP-0802`: `bankCode` changed after a title of the connection got
            a composed barcode.

            - `PBP-0830`: collections is not enabled for the tenant. Retrying
            does not change the answer. Ask Lerian to add the collections module
            to the tenant.

            - `PBP-0013`: the same `Idempotency-Key` was sent with another body.
            Send a new request under a new key.


            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.


            - `PBP-0002`: an unexpected failure, or the stored answer of this
            key cannot be replayed. Contact support. Do not resend under a new
            key: the earlier request may have taken effect.
        '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.


            - `PBP-0008`: a dependency the request needs, authentication or the
            tenant's storage, is temporarily unavailable. The request was not
            processed. Retry under the same `Idempotency-Key`.
      security:
        - BearerAuth: []
components:
  schemas:
    PutPcrConnectionRequest:
      additionalProperties: false
      properties:
        bankCode:
          description: >-
            Number code of the institution: positions 1 to 3 of the barcode and
            the bank code printed on the boleto. 000 is refused with 422
            PBP-0006, and 988, an institution without a number code of its own,
            with 422 PBP-0801. Once a title of the connection got a composed
            barcode, a change is refused with 422 PBP-0802; a title withdrawn
            before it was sent does not count.
          examples:
            - '699'
          pattern: ^[0-9]{3}$
          type: string
        bankCodeCheckDigit:
          description: >-
            Check digit printed after the bank code in the header of the boleto
            document: one digit or X, as informed by the institution, never
            computed nor checked against bankCode. Optional; left out, it is
            stored null, and while it is null the document of a boleto issued
            through the LERIAN provider (GET /v1/boletos/{id}/pdf) is refused
            with 422 PBP-0800.
          examples:
            - '7'
          pattern: ^[0-9X]$
          type: string
        baseUrl:
          description: >-
            Address of the institution's PCR API. Must match one of the PCR
            destinations the platform allows the tenant, by scheme, host and
            port; any other is refused with 422 PBP-0818.
          examples:
            - https://pcr.instituicao.internal
          format: uri
          maxLength: 2048
          pattern: ^https://
          type: string
        institutionName:
          description: >-
            Name of the institution printed in the header of the boleto
            document: 1 to 60 characters, not blank and without control
            characters; a blank name or one with a control character is refused
            with 422 PBP-0006. Optional; left out, it is stored null, and while
            it is null the document of a boleto issued through the LERIAN
            provider (GET /v1/boletos/{id}/pdf) is refused with 422 PBP-0800.
          examples:
            - Banco da Instituição S.A.
          maxLength: 60
          minLength: 1
          type: string
        ispb:
          description: ISPB of the institution, 8 digits or capital letters.
          examples:
            - '12345678'
          maxLength: 8
          minLength: 8
          pattern: ^[0-9A-Z]{8}$
          type: string
        reason:
          description: >-
            Reason for the change, recorded in the audit trail. Must not carry
            personal data.
          examples:
            - Connection to the institution's PCR.
          maxLength: 500
          minLength: 10
          type: string
        version:
          description: Version last read. Left out only to create the connection.
          examples:
            - 1
          format: int64
          minimum: 1
          type: integer
      required:
        - baseUrl
        - ispb
        - bankCode
        - reason
      type: object
    PcrConnection:
      additionalProperties: false
      properties:
        bankCode:
          description: >-
            Number code of the institution: positions 1 to 3 of the barcode and
            the bank code printed on the boleto.
          examples:
            - '699'
          pattern: ^[0-9]{3}$
          type: string
        bankCodeCheckDigit:
          description: >-
            Check digit printed after the bank code in the header of the boleto
            document, as informed by the institution, never computed; null when
            not informed.
          examples:
            - '7'
          pattern: ^[0-9X]$
          type:
            - string
            - 'null'
        baseUrl:
          description: Address of the institution's PCR API.
          examples:
            - https://pcr.instituicao.internal
          format: uri
          maxLength: 2048
          type: string
        connectionToken:
          description: >-
            Token of the connection's current notice route; changes at every
            rotation. Null before the first subscription completes. The signing
            key is never answered.
          examples:
            - pcn_8Qe2xV7kLm4Rt9Wb1Zc3Hy
          pattern: ^[A-Za-z0-9_-]{22,64}$
          readOnly: true
          type:
            - string
            - 'null'
        id:
          description: Identifier of the connection.
          examples:
            - 0192a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a00
          format: uuid
          type: string
        institutionName:
          description: >-
            Name of the institution printed in the header of the boleto
            document; null when not informed.
          examples:
            - Banco da Instituição S.A.
          maxLength: 60
          minLength: 1
          type:
            - string
            - 'null'
        ispb:
          description: ISPB of the institution.
          examples:
            - '12345678'
          maxLength: 8
          minLength: 8
          pattern: ^[0-9A-Z]{8}$
          type: string
        licenseState:
          description: >-
            State of the institution's PCR license. UNKNOWN while the PCR does
            not expose it; INVALID refuses the commands to that PCR.
          enum:
            - VALID
            - INVALID
            - UNKNOWN
          examples:
            - UNKNOWN
          type: string
        noticeEndpointPath:
          description: >-
            Path of the notice route of the current token. Null before the first
            subscription completes.
          examples:
            - /v1/webhooks/pcr/pcn_8Qe2xV7kLm4Rt9Wb1Zc3Hy
          maxLength: 128
          readOnly: true
          type:
            - string
            - 'null'
        noticeEndpointUrl:
          description: >-
            Full address of the notice route of the current token, the one
            registered in the PCR subscription. Null before the first
            subscription completes.
          examples:
            - >-
              https://payments.instituicao.internal/v1/webhooks/pcr/pcn_8Qe2xV7kLm4Rt9Wb1Zc3Hy
          format: uri
          maxLength: 2048
          readOnly: true
          type:
            - string
            - 'null'
        subscription:
          $ref: '#/components/schemas/PcrNoticeSubscription'
          description: The notice subscription at the PCR.
        updatedAt:
          description: When the connection last changed, RFC 3339 in UTC.
          examples:
            - '2026-11-09T15:04:05Z'
          format: date-time
          type: string
        updatedBy:
          $ref: '#/components/schemas/Actor'
          description: Who made the last change.
        version:
          description: Version of the connection; a replacement sends it back.
          examples:
            - 1
          format: int64
          minimum: 1
          type: integer
      required:
        - id
        - baseUrl
        - ispb
        - bankCode
        - connectionToken
        - noticeEndpointPath
        - noticeEndpointUrl
        - licenseState
        - subscription
        - version
        - updatedAt
      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
    PcrNoticeSubscription:
      additionalProperties: false
      properties:
        eventTypes:
          description: >-
            Event types subscribed, each the PCR's event type name, such as
            boleto.writeoff_received; empty before the first subscription.
          items:
            type: string
          maxItems: 64
          type: array
          uniqueItems: true
        includePii:
          description: 'Always false: the notices carry no personal data.'
          examples:
            - false
          type: boolean
        lastSyncError:
          $ref: '#/components/schemas/Detail'
          description: >-
            The problem the last synchronization failed with, as its route
            answered it: the PCR's code in details.pcrCode when the PCR refused
            it. Absent when it did not fail.
        lastSyncedAt:
          description: >-
            When the subscription was last synchronized with the PCR, RFC 3339
            in UTC; null before the first.
          examples:
            - '2026-11-09T15:04:05Z'
          format: date-time
          type:
            - string
            - 'null'
        pcrState:
          description: >-
            State of the subscription as the PCR reports it; null before the
            first subscription.
          enum:
            - ACTIVE
            - PAUSED
            - FAILING
            - null
          examples:
            - ACTIVE
          type:
            - string
            - 'null'
        pendingOperation:
          description: >-
            A creation or rotation started and not finished: a retry within 24
            hours finishes it with the same secret. Null when nothing is
            pending.
          enum:
            - CREATE
            - ROTATE
            - null
          examples:
            - CREATE
          type:
            - string
            - 'null'
        pendingSince:
          description: >-
            When the pending change started, RFC 3339 in UTC; after 24 hours the
            PCR no longer returns the same secret and a new rotation is needed.
            Null when nothing is pending.
          examples:
            - '2026-11-09T15:04:05Z'
          format: date-time
          type:
            - string
            - 'null'
        previousConnectionValidUntil:
          description: >-
            End of the window in which the previous token and signing key are
            still served after a rotation, RFC 3339 in UTC; null outside a
            rotation.
          examples:
            - '2026-11-10T15:04:05Z'
          format: date-time
          type:
            - string
            - 'null'
        secretRotatedAt:
          description: >-
            When a signing secret was last stored, at the creation or at a
            rotation, RFC 3339 in UTC; null before the first.
          examples:
            - '2026-11-09T15:04:05Z'
          format: date-time
          type:
            - string
            - 'null'
        subscriptionId:
          description: >-
            Identifier of the subscription at the PCR; null before the first
            subscription.
          examples:
            - 0192a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a01
          format: uuid
          type:
            - string
            - 'null'
        syncState:
          description: >-
            How the subscription at the PCR compares with what collections
            expects. NOT_SUBSCRIBED: no subscription. SYNCED: address, event
            types and state match. DIVERGENT: the PCR holds it differently, for
            example paused or changed in the PCR's own console. SYNC_FAILED: the
            last attempt failed (lastSyncError).
          enum:
            - NOT_SUBSCRIBED
            - SYNCED
            - DIVERGENT
            - SYNC_FAILED
          examples:
            - NOT_SUBSCRIBED
          type: string
        url:
          description: Address registered at the PCR; null before the first subscription.
          examples:
            - >-
              https://payments.instituicao.internal/v1/webhooks/pcr/pcn_8Qe2xV7kLm4Rt9Wb1Zc3Hy
          format: uri
          maxLength: 2048
          type:
            - string
            - 'null'
      required:
        - syncState
        - eventTypes
        - includePii
      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
    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
  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.