curl --request GET \
--url https://api.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/downloadimport requests
url = "https://api.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download', 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.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download",
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.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download"
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.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download")
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{
"fileName": "NFSe-2874.xml",
"url": "https://files.example.com/nfse/xml/3d6f9a2b-1c4e-4f8a-9b7d-5e2c1a0f8b63.xml?X-Signature=abc123"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "TAX_DOCUMENT_NOT_FOUND",
"origin": "ACCOUNTING",
"message": "Tax document not found"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "ACCOUNTING",
"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 \"PDF\"|\"XML\"",
"code": "TYPE_ONE_OF",
"values": [
"PDF",
"XML"
]
}
]
}Download a tax document
Gets a temporary link to download the PDF or the XML of a tax document.
curl --request GET \
--url https://api.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/downloadimport requests
url = "https://api.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download', 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.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download",
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.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download"
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.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.accounting.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/tax-document/{taxDocumentId}/download")
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{
"fileName": "NFSe-2874.xml",
"url": "https://files.example.com/nfse/xml/3d6f9a2b-1c4e-4f8a-9b7d-5e2c1a0f8b63.xml?X-Signature=abc123"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "TAX_DOCUMENT_NOT_FOUND",
"origin": "ACCOUNTING",
"message": "Tax document not found"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "ACCOUNTING",
"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 \"PDF\"|\"XML\"",
"code": "TYPE_ONE_OF",
"values": [
"PDF",
"XML"
]
}
]
}type. The files exist only once the document is AUTHORIZED: before that, the request answers 404. Open the returned url within 1 hour, and the browser saves the file under the returned fileName.Path Parameters
ID of your realm.
Format: UUID
ID of the organization that owns the tax document.
Format: UUID
ID of the tax document to download.
Format: UUID
Query Parameters
Which file to download: the PDF of the document or its XML.
PDF, XML Response
Successful response
A temporary link to one file of a tax document.
Name of the file: NFSe-<number> once the document has its NFSe number, else RPS-<series>-<number>, else the ID of the document, followed by the extension (.pdf or .xml). Files of TEST documents are prefixed with HOMOLOGACAO-.
"NFSe-2874.xml"
Temporary download link, valid for 1 hour. Opening it makes the browser save the file.
"https://files.example.com/nfse/xml/3d6f9a2b-1c4e-4f8a-9b7d-5e2c1a0f8b63.xml?X-Signature=abc123"