curl --request GET \
--url https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/exportimport requests
url = "https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>"{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "INSUFFICIENT_PERMISSIONS",
"origin": "BILLING",
"message": "insufficient permissions"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "EXPORT_TOO_LARGE",
"origin": "BILLING",
"message": "This export is too large to generate in a single request. Narrow the filters (for example a shorter date range) and try again."
}Export deals
Exports the deals of your organization as a CSV or XLSX file.
curl --request GET \
--url https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/exportimport requests
url = "https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.billing.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/deals/export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>"{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "INSUFFICIENT_PERMISSIONS",
"origin": "BILLING",
"message": "insufficient permissions"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "EXPORT_TOO_LARGE",
"origin": "BILLING",
"message": "This export is too large to generate in a single request. Narrow the filters (for example a shorter date range) and try again."
}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
ID of your realm.
Format: UUID
ID of your organization: the one whose deals you export.
Format: UUID
Query Parameters
Format of the exported file.
csv, xlsx How an xlsx file is encoded in the response body: always base64, the default. A csv file is always sent as plain text.
base64 Only deals in these statuses.
Example (comma-separated list): ?status=OPEN,TERMINATED
OPEN, CANCELED, TERMINATED, EXPIRED, REVOKED Only deals whose debit party has one of these documents (exact match).
Example (comma-separated list): ?debitPartyDocuments=11144477735,39053344705
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
Only deals with this charge type.
SINGLE, RECURRENT, SUBSCRIPTION Only deals with exactly this number of installments.
x >= 1Only deals whose description contains this text (case-insensitive).
250Only deals that start on or after this date (ISO 8601 date or date-time).
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.
Only deals that end on or after this date, inclusive (ISO 8601 date or date-time). Send endAtTo as well for a closed range.
Only deals that end on or before this date, inclusive (ISO 8601 date or date-time). Send endAtFrom as well for a closed range.
Only deals created on or after this date, inclusive (ISO 8601 date or date-time). Send endDate as well for a closed window.
Only deals created on or before this date, inclusive (ISO 8601 date or date-time). Send startDate as well for a closed window.
Sort direction. Case-insensitive.
ASC, DESC Field to sort the deals by.
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.