Skip to main content
GET
Export invoices
The file has every invoice that matches the same filters and order as the invoice list — plus contractId and dealId, to export one contract’s or one deal’s invoices — one per row, with six columns whose headers are in Portuguese: Descrição (the description, or the deal’s), Cliente (the payer’s name), Quantidade (the installment, as 1/12, or Única), Data de Vencimento (the due date, as DD/MM/YYYY, UTC), Status (the displayStatus, in Portuguese) and Valor (the invoice amount, in centavos). When no invoice matches, the file has the header and one empty row. ?type=csv answers a UTF-8 CSV file; ?type=xlsx an Excel workbook, base64-encoded. An export is limited to 50,000 invoices and 4 MiB: narrow the filters to export more. Any member of the organization, or an admin of the realm, can export them.

Path Parameters

realmId
string<uuid>
required

ID of your realm.

Format: UUID

organizationId
string<uuid>
required

ID of your organization: the one whose invoices you export.

Format: UUID

Query Parameters

type
enum<string>
required

Format of the exported file.

Available options:
csv,
xlsx
encoding
enum<string>
default:base64

How an xlsx file is encoded in the response body: always base64, the default. A csv file is always sent as plain text.

Available options:
base64
status
enum<string>[]

Only invoices in these stored statuses (OPEN, CLOSED, PAID, CANCELED). Repeat the parameter or separate values with commas.


Example (comma-separated list): ?status=CLOSED,PAID

Available options:
OPEN,
CLOSED,
PAID,
CANCELED
debitPartyDocuments
string[]

Only invoices whose payer (the debit party) has one of these CPF/CNPJ documents, digits only (exact match).


Example (comma-separated list): ?debitPartyDocuments=11144477735,39053344705

Maximum string length: 32
debitPartyOrgIds
string<uuid>[]

Only invoices whose payer (the debit party) pays from a Portão 3 wallet of one of these organizations. It matches the organization of the payer's wallet, so a payer with no wallet (a customer who pays by boleto or PIX, for example) is not found by it: filter by debitPartyDocuments instead.

Format: UUID


Example: ?debitPartyOrgIds=5e0a1c2b-3d4f-4a6b-8c9d-0e1f2a3b4c5d

chargeType
enum<string>[]

Only invoices whose deal has one of these charge types (SINGLE, RECURRENT, SUBSCRIPTION).


Example: ?chargeType=SINGLE

Available options:
SINGLE,
RECURRENT,
SUBSCRIPTION
contractId
string<uuid>

Only invoices of this contract.

Format: UUID

dealId
string<uuid>

Only invoices of this deal.

Format: UUID

description
string

Only invoices whose name contains this text (case-insensitive).

Maximum string length: 250
startDueAt

Only invoices due on or after this moment, inclusive (ISO 8601 date or date-time).

endDueAt

Only invoices due on or before this moment, inclusive (ISO 8601 date or date-time).

order
enum<string>
default:DESC

Sort direction. Case-insensitive.

Available options:
ASC,
DESC
orderBy
enum<string>
default:createdAt

Field to sort the invoices by.

Available options:
createdAt,
dueAt,
closingAt,
description,
status,
amount,
invoiceNumber

Response

application/csv — The invoices as a UTF-8 CSV file, when type is csv.

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet — The Excel workbook, base64-encoded, when type is xlsx.

The invoices as a UTF-8 CSV file, when type is csv.