Verificar NFe
curl --request POST \
--url https://api.validanfe.com/GuardaNFe/Checar \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"chavesNFe": [
{}
]
}
'import requests
url = "https://api.validanfe.com/GuardaNFe/Checar"
payload = { "chavesNFe": [{}] }
headers = {
"X-API-KEY": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chavesNFe: [{}]})
};
fetch('https://api.validanfe.com/GuardaNFe/Checar', 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.validanfe.com/GuardaNFe/Checar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chavesNFe' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.validanfe.com/GuardaNFe/Checar"
payload := strings.NewReader("{\n \"chavesNFe\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.validanfe.com/GuardaNFe/Checar")
.header("X-API-KEY", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chavesNFe\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.validanfe.com/GuardaNFe/Checar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chavesNFe\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"200": {},
"400": {},
"401": {},
"500": {}
}API Guarda
Verificar NFe
Verifique se uma NFe está armazenada no GuardaNFe
POST
/
GuardaNFe
/
Checar
Verificar NFe
curl --request POST \
--url https://api.validanfe.com/GuardaNFe/Checar \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"chavesNFe": [
{}
]
}
'import requests
url = "https://api.validanfe.com/GuardaNFe/Checar"
payload = { "chavesNFe": [{}] }
headers = {
"X-API-KEY": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chavesNFe: [{}]})
};
fetch('https://api.validanfe.com/GuardaNFe/Checar', 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.validanfe.com/GuardaNFe/Checar",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chavesNFe' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.validanfe.com/GuardaNFe/Checar"
payload := strings.NewReader("{\n \"chavesNFe\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.validanfe.com/GuardaNFe/Checar")
.header("X-API-KEY", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chavesNFe\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.validanfe.com/GuardaNFe/Checar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chavesNFe\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"200": {},
"400": {},
"401": {},
"500": {}
}Objetivo
Este endpoint permite validar se chaves de acesso estão disponíveis nos servidores do GuardaNFe, indicando que as respectivas NF-e foram previamente armazenadas com sucesso.Segurança GarantidaA verificação é restrita às NF-e associadas à sua conta, garantindo confidencialidade dos documentos.
Endpoint
Headers
string
default:"application/json"
Tipo de conteúdo da requisição
string
required
Token de autenticação da API
Body Parameters
array
required
Lista de chaves de acesso das NF-e para verificação (44 caracteres cada)Exemplo:
["11220108333830000304550010000000881000001108"]Exemplos de Requisição
curl -X POST "https://api.validanfe.com/GuardaNFe/Checar" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-KEY: SEU_TOKEN_AQUI" \
-d '{
"chavesNFe": [
"11220108333830000304550010000000881000001108",
"43210312345678000123450010000000201234567890"
]
}'
const response = await fetch('https://api.validanfe.com/GuardaNFe/Checar', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-API-KEY': 'SEU_TOKEN_AQUI'
},
body: JSON.stringify({
chavesNFe: [
"11220108333830000304550010000000881000001108",
"43210312345678000123450010000000201234567890"
]
})
});
const resultado = await response.json();
import requests
import json
url = "https://api.validanfe.com/GuardaNFe/Checar"
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-API-KEY": "SEU_TOKEN_AQUI"
}
data = {
"chavesNFe": [
"11220108333830000304550010000000881000001108",
"43210312345678000123450010000000201234567890"
]
}
response = requests.post(url, headers=headers, data=json.dumps(data))
resultado = response.json()
<?php
$ch = curl_init();
$data = [
"chavesNFe" => [
"11220108333830000304550010000000881000001108",
"43210312345678000123450010000000201234567890"
]
];
curl_setopt($ch, CURLOPT_URL, 'https://api.validanfe.com/GuardaNFe/Checar');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Accept: application/json',
'X-API-KEY: SEU_TOKEN_AQUI'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
$resultado = json_decode($response, true);
curl_close($ch);
?>
Códigos de Resposta
Success
Verificação realizada com sucesso
Bad Request
Lista de chaves NF-e está vazia
Unauthorized
Token de autenticação ausente ou inválido
Internal Server Error
Erro ao verificar a existência dos arquivos
Exemplos de Resposta
{
"11220108333830000304550010000000881000001108": { "exists": true },
"43210312345678000123450010000000201234567890": { "exists": false }
}
{
"message": "A lista de chaves NF-e está vazia."
}
{
"message": "Erro ao verificar a existência dos arquivos.",
"error": "Descrição detalhada do erro."
}
Interpretando os Resultados
exists: true
NFe EncontradaO arquivo XML está presente no GuardaNFe e pode ser acessado
exists: false
NFe Não EncontradaO arquivo não foi encontrado ou não pertence à sua conta
Casos de Uso
Verificação em Lote
Verificação em Lote
Ideal para verificar o status de armazenamento de múltiplas NFe de uma só vez, otimizando o número de requisições.
Auditoria
Auditoria
Utilize para auditar quais NFe estão efetivamente armazenadas no GuardaNFe antes de gerar relatórios.
Integração de Sistemas
Integração de Sistemas
Integre com seus sistemas internos para verificar disponibilidade antes de solicitar downloads.
Limitações
- Máximo de 100 chaves por requisição
- Apenas NFe associadas à sua conta são verificadas
PerformancePara melhor performance, agrupe múltiplas chaves em uma única requisição ao invés de fazer múltiplas chamadas individuais.