Export products
curl --request GET \
--url https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/reportimport requests
url = "https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report', 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.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report",
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.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report"
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.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report")
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": "INVALID_TYPE",
"origin": "REGISTRY",
"message": "Invalid type"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "REGISTRY",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "type",
"message": "Invalid option: expected one of \"csv\"|\"xlsx\"",
"code": "TYPE_ONE_OF",
"values": [
"csv",
"xlsx"
]
}
]
}Export products
Exports the organization’s products as a CSV or XLSX file.
GET
/
realms
/
{realmId}
/
organizations
/
{organizationId}
/
products
/
report
Export products
curl --request GET \
--url https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/reportimport requests
url = "https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report', 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.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report",
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.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report"
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.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.registry.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/products/report")
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": "INVALID_TYPE",
"origin": "REGISTRY",
"message": "Invalid type"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "REGISTRY",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "type",
"message": "Invalid option: expected one of \"csv\"|\"xlsx\"",
"code": "TYPE_ONE_OF",
"values": [
"csv",
"xlsx"
]
}
]
}Any member of the organization can export. Choose the file format with the required
type query parameter: ?type=csv answers a UTF-8 CSV file, ?type=xlsx an Excel workbook returned base64-encoded. The file lists every product of the organization, with no filters, and has one row per product with its name, description, value, SKU code, type, status and creation and last update dates. The headers and the type and status values are in Portuguese (Produto or Serviço, Ativo or Desativado). The Valor column is the price in reais, not in centavos like the value of the API, written the Brazilian way as text: a product whose value is 2500 shows 25,00 and one whose value is 150000 shows 1.500,00. The dates are DD/MM/YYYY HH:mm in Brasília time. An organization with no products gets a file with the header row and one blank row, whose Valor reads 0,00.
The file is sent as an attachment named products-report-<timestamp>.csv or .xlsx. A file of more than 50,000 rows or 4 MiB is refused.Path Parameters
ID of your realm.
Format: UUID
ID of the organization whose products you want to export.
Format: UUID
Query Parameters
The file format: csv for a UTF-8 CSV file, xlsx for an Excel workbook returned base64-encoded.
Available options:
csv, xlsx Response
application/csv — The products as a UTF-8 CSV file, when ?type=csv.
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet — The Excel workbook, base64-encoded, when ?type=xlsx. It is always base64: this export has no switch for raw bytes.
The products as a UTF-8 CSV file, when ?type=csv.