List a city's special tax regimes
curl --request GET \
--url https://api.accounting.v2.portao3.com.br/taxCode/{specialTaxCode}import requests
url = "https://api.accounting.v2.portao3.com.br/taxCode/{specialTaxCode}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.accounting.v2.portao3.com.br/taxCode/{specialTaxCode}', 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/taxCode/{specialTaxCode}",
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/taxCode/{specialTaxCode}"
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/taxCode/{specialTaxCode}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.accounting.v2.portao3.com.br/taxCode/{specialTaxCode}")
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[
{
"id": "1",
"name": "Microempresa municipal"
}
]{
"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": "id",
"message": "Invalid input: expected string, received undefined",
"code": "ID_REQUIRED"
}
]
}List a city's special tax regimes
Lists the special taxation regimes a city hall supports for service invoice (NFSe) issuance.
GET
/
taxCode
/
{specialTaxCode}
List a city's special tax regimes
curl --request GET \
--url https://api.accounting.v2.portao3.com.br/taxCode/{specialTaxCode}import requests
url = "https://api.accounting.v2.portao3.com.br/taxCode/{specialTaxCode}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.accounting.v2.portao3.com.br/taxCode/{specialTaxCode}', 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/taxCode/{specialTaxCode}",
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/taxCode/{specialTaxCode}"
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/taxCode/{specialTaxCode}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.accounting.v2.portao3.com.br/taxCode/{specialTaxCode}")
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[
{
"id": "1",
"name": "Microempresa municipal"
}
]{
"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": "id",
"message": "Invalid input: expected string, received undefined",
"code": "ID_REQUIRED"
}
]
}Send the 7-digit IBGE code of the city as
specialTaxCode. Use the id of the regime that applies to your organization as specialTaxCode when you create your tax issuer. A city with no special regimes answers an empty list.
The regimes come from the tax provider. If the tax provider rejects the request, the error is returned with the provider’s error code and a status of 400, 409, 422 or 502.Path Parameters
IBGE code of the city (7 digits). The path parameter keeps its historical name.
Pattern:
^\d{7}$