Skip to main content
GET
Export deals
The file has every deal that matches the same filters and order as the deal list, one per row, with six columns whose headers are in Portuguese: Descrição (the description), Cliente (the payer’s name), Quantidade (the number of installments), Data de vencimento (the deal’s end date, as DD/MM/YYYY, UTC), Status (Ativo, Cancelado, Terminado, Expirado or Revogado) and Valor (what the invoices are expected to charge in total, in reais, as 1.234,56). When no deal matches, the file has the header and one row with Quantidade 0 and Valor 0,00. ?type=csv answers a UTF-8 CSV file; ?type=xlsx an Excel workbook, base64-encoded. An export is limited to 50,000 deals 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 deals 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 deals in these statuses.


Example (comma-separated list): ?status=OPEN,TERMINATED

Available options:
OPEN,
CANCELED,
TERMINATED,
EXPIRED,
REVOKED
debitPartyDocuments
string[]

Only deals whose debit party has one of these documents (exact match).


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

debitPartyOrgIds
string<uuid>[]

Only deals 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 deals with this charge type.

Available options:
SINGLE,
RECURRENT,
SUBSCRIPTION
numberOfInstallments
integer

Only deals with exactly this number of installments.

Required range: x >= 1
description
string

Only deals whose description contains this text (case-insensitive).

Maximum string length: 250
startAt

Only deals that start on or after this date (ISO 8601 date or date-time).

endAt

Only deals that end on or before this date (ISO 8601 date or date-time). Combines with endAtFrom and endAtTo: every bound you send applies.

endAtFrom

Only deals that end on or after this date, inclusive (ISO 8601 date or date-time). Send endAtTo as well for a closed range.

endAtTo

Only deals that end on or before this date, inclusive (ISO 8601 date or date-time). Send endAtFrom as well for a closed range.

startDate

Only deals created on or after this date, inclusive (ISO 8601 date or date-time). Send endDate as well for a closed window.

endDate

Only deals created on or before this date, inclusive (ISO 8601 date or date-time). Send startDate as well for a closed window.

order
enum<string>
default:DESC

Sort direction. Case-insensitive.

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

Field to sort the deals by.

Available options:
createdAt,
description,
startAt

Response

application/csv — The deals 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 deals as a UTF-8 CSV file, when type is csv.