Consultar Prestador
curl --request GET \
--url https://notasx-api.fly.dev/v1/prestadores/{prestador_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://notasx-api.fly.dev/v1/prestadores/{prestador_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://notasx-api.fly.dev/v1/prestadores/{prestador_id}', 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://notasx-api.fly.dev/v1/prestadores/{prestador_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://notasx-api.fly.dev/v1/prestadores/{prestador_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://notasx-api.fly.dev/v1/prestadores/{prestador_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://notasx-api.fly.dev/v1/prestadores/{prestador_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ambiente": "homologacao",
"ativo": true,
"certificado_valido_ate": "2027-04-28T12:00:00Z",
"cnpj": "12345678000195",
"codigo_municipio": "2408102",
"id": "3891f091-65d6-4a88-ac60-72dbe3e98319",
"inscricao_municipal": "1234567",
"op_simp_nac": 3,
"razao_social": "Exemplo Serviços LTDA"
}{
"erro": {
"codigo": "nao_autenticado",
"mensagem": "Credencial ausente, inválida ou revogada."
}
}{
"erro": {
"codigo": "nao_encontrado",
"mensagem": "Prestador não encontrado."
}
}{
"erro": {
"codigo": "requisicao_invalida",
"mensagem": "corpo.cnpj: String should match pattern '^\\d{14}$'"
}
}{
"erro": {
"codigo": "limite_de_requisicoes",
"mensagem": "Muitas requisições; tente de novo em instantes."
}
}Prestadores
Consultar Prestador
Um Prestador vinculado à sua Conta.
GET
/
v1
/
prestadores
/
{prestador_id}
Consultar Prestador
curl --request GET \
--url https://notasx-api.fly.dev/v1/prestadores/{prestador_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://notasx-api.fly.dev/v1/prestadores/{prestador_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://notasx-api.fly.dev/v1/prestadores/{prestador_id}', 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://notasx-api.fly.dev/v1/prestadores/{prestador_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://notasx-api.fly.dev/v1/prestadores/{prestador_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://notasx-api.fly.dev/v1/prestadores/{prestador_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://notasx-api.fly.dev/v1/prestadores/{prestador_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ambiente": "homologacao",
"ativo": true,
"certificado_valido_ate": "2027-04-28T12:00:00Z",
"cnpj": "12345678000195",
"codigo_municipio": "2408102",
"id": "3891f091-65d6-4a88-ac60-72dbe3e98319",
"inscricao_municipal": "1234567",
"op_simp_nac": 3,
"razao_social": "Exemplo Serviços LTDA"
}{
"erro": {
"codigo": "nao_autenticado",
"mensagem": "Credencial ausente, inválida ou revogada."
}
}{
"erro": {
"codigo": "nao_encontrado",
"mensagem": "Prestador não encontrado."
}
}{
"erro": {
"codigo": "requisicao_invalida",
"mensagem": "corpo.cnpj: String should match pattern '^\\d{14}$'"
}
}{
"erro": {
"codigo": "limite_de_requisicoes",
"mensagem": "Muitas requisições; tente de novo em instantes."
}
}Authorizations
Authorization: Bearer nx_... com uma Chave de API, ou o JWT de sessão do painel (Supabase Auth). As duas credenciais representam a mesma Conta.
Path Parameters
Id do Prestador, devolvido no cadastro.
Response
Successful Response
Id do Prestador no NotasX.
CNPJ, só dígitos.
Razão social informada no cadastro.
Código IBGE do município.
Inscrição municipal, se informada.
1 não optante, 2 MEI, 3 ME/EPP do Simples Nacional.
Ambiente das próximas Notas. Começa em homologacao; muda com ativar-producao.
Available options:
homologacao, producao true quando há Certificado ativo do próprio CNPJ.
Validade do Certificado ativo; null sem Certificado.