> ## Documentation Index
> Fetch the complete documentation index at: https://developers.portao3.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Get an invoice

> Returns one invoice, with its customer, totals, statements and products.

Read it as its issuer (`role=VENDOR`, the default) or as its payer (`role=BUYER`, when your organization is the invoice's payer — the issuer's `creditParties` are not shown then). `customer` is the payer as a customer of the issuing organization, with the link to its page in the customer portal — `null` as the payer, when no customer has the payer's document, or when it could not be looked up in time; the invoice is answered either way. `financialValues` adds up the invoice's statements, `statements` lists them, and `products` groups the invoice's open entries by product.

Any member of the organization, or an admin of the realm, can read it.


## OpenAPI

````yaml /api-reference/billing.openapi.json get /realms/{realmId}/organizations/{organizationId}/invoices/{invoiceId}
openapi: 3.0.3
info:
  title: Billing
  version: 1.0.0
  description: >-
    Portão 3 billing API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). Full billing surface —
    contracts, deals, invoices, statements, payment links, checkout and NFSe
    orchestration. (The product/supplier catalog moved to registry.) Confidence
    tiers: generated:typed=74 copied:manual=0 unknown=5.
servers:
  - url: https://api.billing.v2.portao3.com.br/
    description: production
  - url: https://api.billing.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Contracts
  - name: Deals
  - name: Invoices
  - name: Invoice Entries
  - name: Invoice Statements
  - name: NFSe Configuration
  - name: Payment Links
paths:
  /realms/{realmId}/organizations/{organizationId}/invoices/{invoiceId}:
    get:
      tags:
        - Invoices
      summary: Get an invoice
      description: Returns one invoice, with its customer, totals, statements and products.
      operationId: getRealmsByRealmIdOrganizationsByOrganizationIdInvoicesByInvoiceId
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: >-
            ID of your organization: the one that issued the invoice (or pays
            it, with `role=BUYER`).


            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: invoiceId
          in: path
          required: true
          description: |-
            ID of the invoice.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: 0b7c2a44-6f1e-4d3b-9a8e-5c2f1d0e9b7a
        - name: role
          in: query
          required: false
          description: >-
            `VENDOR` (default): read an invoice your organization issued.
            `BUYER`: read an invoice your organization pays.
          schema:
            default: VENDOR
            type: string
            enum:
              - VENDOR
              - BUYER
          example: VENDOR
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the invoice.
                    example: 0b7c2a44-6f1e-4d3b-9a8e-5c2f1d0e9b7a
                    format: uuid
                  realm:
                    type: string
                    description: >-
                      ID of the realm of the organization that issued the
                      invoice.
                    example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                    format: uuid
                  organization:
                    type: string
                    description: ID of the organization that issued the invoice.
                    example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                    format: uuid
                  contract:
                    type: string
                    description: >-
                      ID of the invoice's contract. Absent on an invoice of a
                      deal created without a contract.
                    example: 7e4c2a1b-6d5f-4b3a-9e8d-2f1c0b9a8e7d
                    format: uuid
                  deal:
                    type: string
                    description: >-
                      ID of the deal that generated the invoice. Read the deal
                      with `GET .../deals/{dealId}`.
                    example: 3b9f6d2e-1a4c-4e8b-9f7a-6c5d4e3b2a1f
                    format: uuid
                  previousInvoiceId:
                    type: string
                    description: >-
                      Always empty. The previous invoice sent on creation only
                      decides which products are charged, and is not kept.
                    example: ''
                  dealName:
                    type: string
                    description: The deal's description. Empty when the invoice has none.
                    example: Mensalidade Plano Pro
                  description:
                    type: string
                    description: >-
                      The invoice's name. Empty when it has none (show
                      `dealName` instead).
                    example: Mensalidade Plano Pro - 1/12
                  allowedPaymentMethods:
                    type: array
                    items:
                      type: string
                      enum:
                        - BANK_SLIP
                        - PIX_INITIATION
                        - PIX_AUTOMATIC
                        - PIX
                        - P2P
                      example: PIX_AUTOMATIC
                    description: >-
                      How the invoice can be paid: `BANK_SLIP` (boleto), `PIX`
                      (PIX charge), `PIX_AUTOMATIC` (PIX Automático),
                      `PIX_INITIATION` (recurring scheduled PIX) or `P2P` (a
                      debit from the payer's Portão 3 account). The first one is
                      the deal's main method.


                      ---


                      Example: `["PIX_AUTOMATIC","PIX"]`
                  invoiceNumber:
                    type: integer
                    description: The installment number, from 1.
                    example: 1
                  closingAt:
                    type: string
                    description: >-
                      When the invoice closes: it stops gathering charges and
                      its payment is issued.
                    example: '2026-10-01T00:00:00.000Z'
                    format: date-time
                  dueAt:
                    type: string
                    description: When the invoice is due.
                    example: '2026-10-10T00:00:00.000Z'
                    format: date-time
                  expiresAt:
                    type: string
                    description: The last day the invoice's charge can be paid.
                    example: '2026-11-10T00:00:00.000Z'
                    format: date-time
                  paidAt:
                    type: string
                    description: When the invoice was paid. Absent until it is.
                    example: '2026-10-08T14:32:11.000Z'
                    format: date-time
                  amount:
                    type: integer
                    description: >-
                      Amount of the invoice, in centavos (`15000` is R$ 150,00):
                      the sum of its charges.
                    example: 15000
                  status:
                    type: string
                    enum:
                      - OPEN
                      - CLOSED
                      - PAID
                      - CANCELED
                    description: >-
                      The stored status. `OPEN`: still gathering charges.
                      `CLOSED`: issued and waiting for payment. `PAID`.
                      `CANCELED`.
                    example: CLOSED
                  displayStatus:
                    type: string
                    enum:
                      - OPEN
                      - READY_TO_PAYMENT
                      - OVERDUE
                      - PAID
                      - CANCELED
                      - READY_TO_SCHEDULE
                      - SCHEDULED
                      - PAYMENT_FAILED
                      - REVOKED
                      - EXPIRED
                    description: >-
                      The invoice's status as the Portão 3 app shows it,
                      computed when you read it — the same rule on every invoice
                      route. `OPEN`: still gathering charges.
                      `READY_TO_PAYMENT`: issued, and less than a day past its
                      due date. `OVERDUE`: issued, and more than a day past its
                      due date (for PIX Automático, after the 5-day retry
                      window). `PAID`. `CANCELED`. Only for PIX Automático:
                      `READY_TO_SCHEDULE` (the payment is not scheduled with the
                      payer's bank yet), `SCHEDULED` (it will be charged on the
                      due date), `PAYMENT_FAILED` (the due-date charge did not
                      go through and is being retried, until 5 days after the
                      due date), `REVOKED` (canceled because the payer revoked
                      the authorization) and `EXPIRED` (canceled because the
                      payer never authorized it).
                    example: SCHEDULED
                  paymentStatus:
                    type: string
                    enum:
                      - NONE
                      - PENDING
                      - PROCESSING
                      - PROCESSED
                      - FAILED
                    description: >-
                      Progress of the automatic charge from the payer's Portão 3
                      account (P2P). `NONE` for every other invoice.
                    example: NONE
                  paymentsAttempts:
                    type: integer
                    description: How many times the automatic P2P charge was attempted.
                    example: 0
                  fine:
                    type: object
                    properties:
                      amountType:
                        type: string
                        description: >-
                          How `amount` is read. A fine: `FIXED_VALUE` (centavos)
                          or `PERCENT` (of the invoice amount). Interest:
                          `AMOUNT_CALENDAR_DAYS` / `AMOUNT_WORKING_DAYS`
                          (centavos per day late) or
                          `PERCENT_POINT_PER_DAY_CALENDAR_DAYS` /
                          `PERCENT_POINT_PER_DAY_WORKING_DAYS` (percent per day
                          late), counting calendar or working days. A discount:
                          `AMOUNT_PER_ANTECIPATION` (centavos) or
                          `PERCENT_PER_ANTECIPATION` (of the invoice amount).
                        example: PERCENT
                      amount:
                        type: number
                        description: >-
                          The value, in the unit `amountType` gives: centavos
                          for the `FIXED_VALUE` and `AMOUNT_*` types, a
                          percentage for the others.
                        example: 2
                    required:
                      - amountType
                      - amount
                    description: >-
                      Late fee charged after the due date, when the deal has
                      one.
                  interest:
                    type: object
                    properties:
                      amountType:
                        type: string
                        description: >-
                          How `amount` is read. A fine: `FIXED_VALUE` (centavos)
                          or `PERCENT` (of the invoice amount). Interest:
                          `AMOUNT_CALENDAR_DAYS` / `AMOUNT_WORKING_DAYS`
                          (centavos per day late) or
                          `PERCENT_POINT_PER_DAY_CALENDAR_DAYS` /
                          `PERCENT_POINT_PER_DAY_WORKING_DAYS` (percent per day
                          late), counting calendar or working days. A discount:
                          `AMOUNT_PER_ANTECIPATION` (centavos) or
                          `PERCENT_PER_ANTECIPATION` (of the invoice amount).
                        example: PERCENT
                      amount:
                        type: number
                        description: >-
                          The value, in the unit `amountType` gives: centavos
                          for the `FIXED_VALUE` and `AMOUNT_*` types, a
                          percentage for the others.
                        example: 2
                    required:
                      - amountType
                      - amount
                    description: Interest charged after the due date, when the deal has it.
                  discount:
                    type: object
                    properties:
                      amountType:
                        type: string
                        description: >-
                          How `amount` is read. A fine: `FIXED_VALUE` (centavos)
                          or `PERCENT` (of the invoice amount). Interest:
                          `AMOUNT_CALENDAR_DAYS` / `AMOUNT_WORKING_DAYS`
                          (centavos per day late) or
                          `PERCENT_POINT_PER_DAY_CALENDAR_DAYS` /
                          `PERCENT_POINT_PER_DAY_WORKING_DAYS` (percent per day
                          late), counting calendar or working days. A discount:
                          `AMOUNT_PER_ANTECIPATION` (centavos) or
                          `PERCENT_PER_ANTECIPATION` (of the invoice amount).
                        example: PERCENT
                      amount:
                        type: number
                        description: >-
                          The value, in the unit `amountType` gives: centavos
                          for the `FIXED_VALUE` and `AMOUNT_*` types, a
                          percentage for the others.
                        example: 2
                    required:
                      - amountType
                      - amount
                    description: Discount for paying early, when the deal has one.
                  external:
                    type: object
                    properties:
                      b3BankSlip:
                        type: string
                        description: ID of the boleto created for the invoice.
                        example: 4c9e2f1a-7b3d-4e5f-8a6b-0c1d2e3f4a5b
                      b3Pix:
                        type: string
                        description: ID of the PIX charge created for the invoice.
                        example: 6d1a3b5c-8e2f-4a7b-9c0d-1e2f3a4b5c6d
                    description: IDs of the invoice's boleto and PIX charge, once created.
                  creditParties:
                    type: array
                    items:
                      type: object
                      properties:
                        partyAccount:
                          type: object
                          properties:
                            document:
                              type: string
                              description: CPF or CNPJ, digits only.
                              example: '12345678000195'
                            name:
                              type: string
                              example: Empresa Exemplo Ltda
                            email:
                              type: string
                              example: financeiro@empresaexemplo.com.br
                            bank:
                              type: string
                              enum:
                                - P3
                              description: >-
                                Where the party's account is held. `P3`: a
                                Portão 3 account.
                              example: P3
                            type:
                              type: string
                              enum:
                                - WALLET
                              description: 'Kind of account. `WALLET`: a Portão 3 wallet.'
                              example: WALLET
                            identifier:
                              type: object
                              properties:
                                realm:
                                  type: string
                                  description: ID of the party's realm.
                                  example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                                  format: uuid
                                organization:
                                  type: string
                                  description: ID of the party's organization.
                                  example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                                  format: uuid
                                account:
                                  type: string
                                  description: ID of the party's account.
                                  example: 2a7d9c4e-5b1f-4e3a-8c6d-9f0e1a2b3c4d
                                  format: uuid
                                wallet:
                                  type: string
                                  description: ID of the party's wallet.
                                  example: 8e1f2a3b-4c5d-4e6f-9a0b-1c2d3e4f5a6b
                                  format: uuid
                              required:
                                - realm
                                - organization
                                - account
                                - wallet
                              description: The account and wallet the money is paid into.
                          required:
                            - name
                            - bank
                            - type
                            - identifier
                          description: Who receives the invoice's money.
                        unit:
                          type: string
                          enum:
                            - PERCENTAGE
                          description: >-
                            `PERCENTAGE`: `amount` is a share of the invoice
                            amount, in percent.
                          example: PERCENTAGE
                        amount:
                          type: number
                          description: >-
                            The receiver's share. The shares of all receivers
                            add up to 100.
                          example: 100
                      required:
                        - partyAccount
                        - unit
                        - amount
                      description: A share of the invoice that goes to one receiver.
                    description: >-
                      Who receives the money. Absent when you read the invoice
                      as its payer (`role=BUYER`).
                  debitParties:
                    type: array
                    items:
                      type: object
                      properties:
                        partyAccount:
                          type: object
                          properties:
                            document:
                              type: string
                              description: CPF or CNPJ, digits only.
                              example: '11144477735'
                            name:
                              type: string
                              example: Maria Silva
                            email:
                              type: string
                              example: maria.silva@exemplo.com.br
                            address:
                              type: object
                              properties:
                                street:
                                  type: string
                                  example: Rua das Flores
                                number:
                                  type: string
                                  example: '123'
                                complement:
                                  type: string
                                  example: Sala 4
                                neighborhood:
                                  type: string
                                  example: Centro
                                city:
                                  type: string
                                  example: São Paulo
                                state:
                                  type: string
                                  description: Two-letter state code.
                                  example: SP
                                postalCode:
                                  type: string
                                  description: Postal code (CEP), as `NNNNN-NNN`.
                                  example: 01310-100
                              required:
                                - street
                                - number
                                - neighborhood
                                - city
                                - state
                                - postalCode
                              description: >-
                                The payer's address. Present when the invoice is
                                paid by boleto or PIX charge.
                            bank:
                              type: string
                              enum:
                                - P3
                              description: >-
                                Where the payer's account is held, when the
                                payer pays from a Portão 3 account (`P3`).
                              example: P3
                            type:
                              type: string
                              enum:
                                - WALLET
                              description: >-
                                Kind of the payer's account, when it is a Portão
                                3 wallet (`WALLET`).
                              example: WALLET
                            identifier:
                              type: object
                              properties:
                                realm:
                                  type: string
                                  description: ID of the party's realm.
                                  example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                                  format: uuid
                                organization:
                                  type: string
                                  description: ID of the party's organization.
                                  example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                                  format: uuid
                                account:
                                  type: string
                                  description: ID of the party's account.
                                  example: 2a7d9c4e-5b1f-4e3a-8c6d-9f0e1a2b3c4d
                                  format: uuid
                                wallet:
                                  type: string
                                  description: ID of the party's wallet.
                                  example: 8e1f2a3b-4c5d-4e6f-9a0b-1c2d3e4f5a6b
                                  format: uuid
                              required:
                                - realm
                                - organization
                                - account
                                - wallet
                              description: >-
                                The payer's Portão 3 account and wallet, when
                                the invoice is paid from one (P2P).
                          required:
                            - name
                          description: Who pays the invoice.
                        unit:
                          type: string
                          enum:
                            - PERCENTAGE
                          description: >-
                            `PERCENTAGE`: `amount` is a share of the invoice
                            amount, in percent.
                          example: PERCENTAGE
                        amount:
                          type: number
                          description: >-
                            The payer's share: always 100 (an invoice has one
                            payer).
                          example: 100
                      required:
                        - partyAccount
                        - unit
                        - amount
                      description: The invoice's payer and its share.
                    description: 'Who pays: one payer.'
                  createdBy:
                    type: string
                    description: >-
                      Who created the invoice: the caller of the API, or the
                      Portão 3 service that generated it from its deal.
                    example: BILLING:DEAL:3b9f6d2e-1a4c-4e8b-9f7a-6c5d4e3b2a1f
                  updatedBy:
                    type: string
                    description: Who last changed the invoice.
                    example: BILLING:DEAL:3b9f6d2e-1a4c-4e8b-9f7a-6c5d4e3b2a1f
                  createdAt:
                    type: string
                    description: When the invoice was created.
                    example: '2026-09-01T00:00:00.000Z'
                    format: date-time
                  updatedAt:
                    type: string
                    description: >-
                      When the invoice was created. It does not move when the
                      invoice changes.
                    example: '2026-09-01T00:00:00.000Z'
                    format: date-time
                  chargeType:
                    type: string
                    enum:
                      - SINGLE
                      - RECURRENT
                      - SUBSCRIPTION
                    description: >-
                      The deal's charge type: `SINGLE` (one invoice),
                      `RECURRENT` (a fixed number of installments) or
                      `SUBSCRIPTION` (renews until the deal ends).
                    example: RECURRENT
                  totalInstallments:
                    type: integer
                    description: >-
                      How many installments the deal has (`1` for a single
                      charge).
                    example: 12
                  customer:
                    description: >-
                      The payer as a customer of your organization, found by the
                      payer's document, with their portal link. `null` when no
                      customer has that document, when it could not be looked up
                      in time, and always when you read the invoice as its payer
                      (`role=BUYER`).
                    type: object
                    properties:
                      id:
                        type: string
                        description: ID of the customer.
                        example: 9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d
                        format: uuid
                      name:
                        type: string
                        example: Maria Silva
                      url:
                        type: string
                        nullable: true
                        description: >-
                          Link to the customer's portal page, where they see and
                          pay their invoices. `null` when the customer has none.
                        example: >-
                          https://portal.example.com/c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f
                    required:
                      - id
                      - name
                      - url
                    nullable: true
                  financialValues:
                    type: object
                    properties:
                      total:
                        type: integer
                        description: The invoice amount.
                        example: 15000
                      totalPaid:
                        type: integer
                        description: >-
                          The invoice amount once the invoice is `PAID`, `0`
                          before. A partial payment does not count here: see
                          `statements`.
                        example: 0
                      outstandingBalance:
                        type: integer
                        description: '`total` minus `totalPaid`.'
                        example: 15000
                    required:
                      - total
                      - totalPaid
                      - outstandingBalance
                    description: The invoice's totals.
                  statements:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: ID of the statement.
                          example: 9d4e1f6a-3b2c-4a5d-8e7f-1a2b3c4d5e6f
                          format: uuid
                        realm:
                          type: string
                          description: >-
                            ID of the realm of the organization that issued the
                            invoice.
                          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                          format: uuid
                        organization:
                          type: string
                          description: ID of the organization that issued the invoice.
                          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                          format: uuid
                        invoice:
                          type: string
                          description: ID of the invoice.
                          example: 0b7c2a44-6f1e-4d3b-9a8e-5c2f1d0e9b7a
                          format: uuid
                        identifier:
                          type: string
                          description: >-
                            The kind of movement. Portão 3 writes
                            `INVOICE_CLOSED` (a `DEBIT` for the invoice amount,
                            when the invoice closes), one statement per payment
                            instrument created for the invoice —
                            `BANK_SLIP_CREATED` (boleto), `PIX_CREATED` (PIX
                            charge), `P2P_CREATED` (a debit from the payer's
                            Portão 3 account) and `PIX_INITIATION_CREATED` (PIX
                            Automático or recurring scheduled PIX) —,
                            `INTEREST_AND_FINES` (a `DEBIT` for what a late
                            boleto or PIX payment paid above the charge) and
                            `MANUAL_SETTLEMENT` (the invoice was marked as paid
                            by hand). A statement recorded through the API
                            carries the label it was sent with.
                          example: BANK_SLIP_CREATED
                        description:
                          type: string
                          description: >-
                            Free text describing the movement. Empty when there
                            is none.
                          example: Boleto da fatura de outubro
                        billingAmount:
                          type: integer
                          description: >-
                            Amount in centavos (`15000` is R$ 150,00) that
                            counts toward the invoice balance while the
                            statement is `DONE`: as paid when
                            `financialImpactType` is `CREDIT`, as owed when it
                            is `DEBIT`. A payment instrument starts at `0` and
                            takes the amount actually paid when it is paid.
                          example: 15000
                        originalAmount:
                          type: integer
                          description: >-
                            Reference amount in centavos: the amount a payment
                            instrument charges, the invoice amount on
                            `INVOICE_CLOSED` and `MANUAL_SETTLEMENT`, or the
                            amount sent on a statement recorded through the API.
                            Informational: it does not change the balance.
                          example: 15000
                        financialImpactType:
                          type: string
                          enum:
                            - CREDIT
                            - DEBIT
                            - NONE
                          description: >-
                            `CREDIT`: reduces what is owed (a payment, a
                            discount). `DEBIT`: adds to what is owed (the
                            invoice amount, interest and fines, a fee). `NONE`:
                            no effect on the balance.
                          example: CREDIT
                        status:
                          type: string
                          enum:
                            - CREATED
                            - PROCESSING
                            - SCHEDULED
                            - PAID
                            - CANCELED
                            - DONE
                            - ERROR
                            - SCHEDULE_ERROR
                          description: >-
                            Only `DONE` counts toward the balance. `DONE`: in
                            effect — the amount owed, a paid instrument, an
                            adjustment or a settlement. `CREATED`: a payment
                            instrument waiting to be paid (a PIX charge, a
                            registered boleto, a PIX Automático installment not
                            scheduled yet). `PROCESSING`: a boleto being
                            registered, or a debit from the payer's account in
                            progress. `SCHEDULED`: a PIX Automático or scheduled
                            PIX installment waiting for its date. `CANCELED`: a
                            PIX Automático or scheduled PIX installment that was
                            canceled. `ERROR`: the charge failed.
                            `SCHEDULE_ERROR`: a PIX Automático installment could
                            not be scheduled. `PAID` is not used.
                          example: DONE
                        effectiveAt:
                          type: string
                          description: >-
                            When the movement took effect. For Portão 3's own
                            statements it is when the statement was created; a
                            statement recorded through the API carries the date
                            it was sent with.
                          example: '2026-10-01T09:00:00.000Z'
                          format: date-time
                        createdBy:
                          type: string
                          description: >-
                            ID of who recorded the statement: the authenticated
                            caller of the API that created it, or the Portão 3
                            service that wrote it.
                          example: 5f0c2b1e-8a3d-4e6f-9b7c-2d1a0e9f8c7b
                        updatedBy:
                          type: string
                          description: >-
                            Who last changed the statement. It is set when the
                            statement is created and later status changes (a
                            payment confirmed, an installment scheduled) do not
                            change it, so it is usually the same as `createdBy`.
                          example: 5f0c2b1e-8a3d-4e6f-9b7c-2d1a0e9f8c7b
                        createdAt:
                          type: string
                          description: When the statement was recorded.
                          example: '2026-10-01T09:00:00.000Z'
                          format: date-time
                        updatedAt:
                          type: string
                          description: When the statement last changed, such as its status.
                          example: '2026-10-08T14:32:11.000Z'
                          format: date-time
                        paymentData:
                          type: object
                          properties:
                            pix:
                              type: object
                              properties:
                                emv:
                                  type: string
                                  description: >-
                                    The PIX copy-and-paste code (EMV) the payer
                                    pays.
                                  example: >-
                                    00020101021226870014br.gov.bcb.pix2565qrcode.exemplo.com.br/pix/v2/9d4e1f6a5204000053039865406150.005802BR5913EMPRESA
                                    EXEMPLO6009SAO PAULO62070503***6304ABCD
                                dueAt:
                                  type: string
                                  description: When the PIX charge is due.
                                  example: '2026-10-10T23:59:59.000Z'
                                  format: date-time
                              required:
                                - emv
                              description: >-
                                The PIX charge, on a `PIX_CREATED` statement
                                (and on the `INTEREST_AND_FINES` statement of
                                its late payment).
                            bankSlip:
                              type: object
                              properties:
                                digitableLine:
                                  type: string
                                  description: >-
                                    The boleto's typeable line (linha
                                    digitável). Empty until the boleto is
                                    registered.
                                  example: '34191790010104351004791020150008291070026000'
                                barcode:
                                  type: string
                                  description: >-
                                    The boleto's barcode. Empty until the boleto
                                    is registered.
                                  example: '34192910700260001790001043510047902015000829'
                                dueAt:
                                  type: string
                                  description: When the boleto is due.
                                  example: '2026-10-10T23:59:59.000Z'
                                  format: date-time
                                expiresAt:
                                  type: string
                                  description: >-
                                    After this date the boleto can no longer be
                                    paid.
                                  example: '2026-11-09T23:59:59.000Z'
                                  format: date-time
                              required:
                                - digitableLine
                                - barcode
                              description: >-
                                The boleto, on a `BANK_SLIP_CREATED` statement
                                (and on the `INTEREST_AND_FINES` statement of
                                its late payment).
                            pixInitiation:
                              type: object
                              properties:
                                paymentUrl:
                                  type: string
                                  description: Link where the payer authorizes the payment.
                                  example: https://pix.example.com/authorize/9d4e1f6a
                                scheduledTo:
                                  type: string
                                  description: >-
                                    When the payment is scheduled to be charged:
                                    the invoice's due date.
                                  example: '2026-10-10T12:00:00.000Z'
                                  format: date-time
                              required:
                                - paymentUrl
                              description: >-
                                The authorized PIX payment, on a
                                `PIX_INITIATION_CREATED` statement.
                          description: >-
                            The payment instrument: on `BANK_SLIP_CREATED`,
                            `PIX_CREATED` and `PIX_INITIATION_CREATED`
                            statements, and on the `INTEREST_AND_FINES`
                            statement of a late boleto or PIX payment.
                        external:
                          type: object
                          properties:
                            b3BankSlip:
                              type: string
                              description: ID of the boleto.
                              example: 6711b4c0d8e1a30012b7c9f2
                            b3Pix:
                              type: string
                              description: ID of the PIX charge.
                              example: 6711b4c0d8e1a30012b7c9f3
                            b3PixBillingInitiationRequest:
                              type: string
                              description: >-
                                ID of the PIX Automático authorization, or of
                                the recurring scheduled PIX payment, this
                                statement belongs to. Every installment of the
                                same deal shares it.
                              example: 6711b4c0d8e1a30012b7c9f4
                            b3PixBillingInitiationRequestItem:
                              type: string
                              description: >-
                                ID of this installment's scheduled charge. Empty
                                until the charge is scheduled.
                              example: 6711b4c0d8e1a30012b7c9f5
                          description: >-
                            IDs of the charge in the Banking service: on the
                            same statements as `paymentData`.
                        error:
                          description: >-
                            Why a PIX Automático or scheduled PIX charge failed.
                            Present once a failure was recorded, and kept if a
                            later attempt succeeds. `null` on a few statements
                            recorded through the API with an empty `error`.
                          type: object
                          properties:
                            code:
                              type: string
                              description: Error code, or `UNKNOWN_ERROR`.
                              example: PAYMENT_REJECTED
                            detail:
                              type: string
                              description: Detail of the failure, or `Desconhecido`.
                              example: Saldo insuficiente na conta do pagador.
                            description:
                              type: string
                              description: >-
                                Description of the failure, or `Erro
                                desconhecido`.
                              example: >-
                                O pagamento foi recusado pela instituição do
                                pagador.
                          nullable: true
                      required:
                        - id
                        - realm
                        - organization
                        - invoice
                        - identifier
                        - description
                        - billingAmount
                        - originalAmount
                        - financialImpactType
                        - status
                        - effectiveAt
                        - createdBy
                        - updatedBy
                        - createdAt
                        - updatedAt
                      description: >-
                        One entry of an invoice's ledger: the amount owed, a
                        payment instrument and its payment, interest and fines,
                        an adjustment or a manual settlement.
                    description: >-
                      The invoice's ledger: what it owes, its payment
                      instruments (with the PIX code or the boleto line) and its
                      payments, in no particular order.
                  products:
                    type: array
                    items:
                      type: object
                      properties:
                        productName:
                          type: string
                          example: Plano Pro
                        unitPrice:
                          type: number
                          description: Price of one unit, in centavos.
                          example: 15000
                        quantity:
                          type: integer
                          description: How many units of it the invoice charges.
                          example: 1
                      required:
                        - productName
                        - unitPrice
                        - quantity
                      description: >-
                        A product charged on the invoice, grouped by name and
                        price.
                    description: >-
                      What the invoice charges: its own charges (not deleted),
                      grouped by name and price.
                required:
                  - allowedPaymentMethods
                  - amount
                  - chargeType
                  - closingAt
                  - createdAt
                  - createdBy
                  - customer
                  - deal
                  - dealName
                  - debitParties
                  - description
                  - displayStatus
                  - dueAt
                  - expiresAt
                  - external
                  - financialValues
                  - id
                  - invoiceNumber
                  - organization
                  - paymentStatus
                  - paymentsAttempts
                  - previousInvoiceId
                  - products
                  - realm
                  - statements
                  - status
                  - totalInstallments
                  - updatedAt
                  - updatedBy
                description: An invoice, with its customer, totals, ledger and products.
        '403':
          description: >-
            `INSUFFICIENT_PERMISSIONS` — You are not a member of the
            organization nor an admin of the realm.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - INSUFFICIENT_PERMISSIONS
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: INSUFFICIENT_PERMISSIONS
                origin: BILLING
                message: insufficient permissions
        '404':
          description: >-
            `INVOICE_NOT_FOUND` — No invoice with this ID was issued by the
            organization (or, with `role=BUYER`, is paid by it).
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - INVOICE_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: INVOICE_NOT_FOUND
                origin: BILLING
                message: invoice not found
        '422':
          description: >-
            `BAD_REQUEST` — A path parameter is not a valid ID, or `role` is
            unknown; `fields` lists each one.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BAD_REQUEST
                origin: BILLING
                message: >-
                  Bad Request: Your request is invalid or incomplete. Please
                  make sure you are requesting with the right fields.
                fields:
                  - field: role
                    message: 'Invalid option: expected one of "VENDOR"|"BUYER"'
                    code: ROLE_ONE_OF

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.