Listar eventos da NFS-e
curl --request GET \
--url https://api.spedy.com.br/v1/service-invoices/{id}/events \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.spedy.com.br/v1/service-invoices/{id}/events"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.spedy.com.br/v1/service-invoices/{id}/events', 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.spedy.com.br/v1/service-invoices/{id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.spedy.com.br/v1/service-invoices/{id}/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.spedy.com.br/v1/service-invoices/{id}/events")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spedy.com.br/v1/service-invoices/{id}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "authorization",
"date": "2023-11-07T05:31:56Z",
"protocol": "<string>",
"code": "<string>",
"message": "<string>",
"hasXml": true
}
]NFS-e
Listar eventos da NFS-e
Lista os eventos da nota (criação, autorização, cancelamento, carta de correção…), dos mais recentes
para os mais antigos. Traz só os metadados — o XML de cada evento é baixado em /events/{eventId}/xml
quando hasXml é true.
GET
/
v1
/
service-invoices
/
{id}
/
events
Listar eventos da NFS-e
curl --request GET \
--url https://api.spedy.com.br/v1/service-invoices/{id}/events \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.spedy.com.br/v1/service-invoices/{id}/events"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.spedy.com.br/v1/service-invoices/{id}/events', 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.spedy.com.br/v1/service-invoices/{id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.spedy.com.br/v1/service-invoices/{id}/events"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.spedy.com.br/v1/service-invoices/{id}/events")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spedy.com.br/v1/service-invoices/{id}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "authorization",
"date": "2023-11-07T05:31:56Z",
"protocol": "<string>",
"code": "<string>",
"message": "<string>",
"hasXml": true
}
]Authorizations
Authorization By X-Api-Key inside request's header
Path Parameters
Response
OK
Id do evento (usado em /events/{eventId}/xml).
Tipo do evento (ex.: authorization, cancellation, correctionLetter).
Valores possíveis:
- authorization: Autorização
- rejection: Rejeição
- cancellation: Cancelamento
- denegation: Denegação
- contingency: Contingência
- received: Recebimento
- error: Falha
- correctionLetter: Carta de correção
- creation: Criado
- confirmOperation: Confirmação da operação
- awareOperation: Ciência da operação
- unawareOperation: Desconhecimento da operação
- operationNotPerformed: Operação não realizada
- disablement: Inutilização
- accessKeyChanged: Chave de acesso alterada
- enqueued: Enfileirado
- emailSent: Email enviado
Available options:
authorization, rejection, cancellation, denegation, contingency, received, error, correctionLetter, creation, confirmOperation, awareOperation, unawareOperation, operationNotPerformed, disablement, accessKeyChanged, enqueued, emailSent Data do evento.
Protocolo devolvido pela autoridade fiscal, quando houver.
Código devolvido pela autoridade fiscal.
Mensagem devolvida pela autoridade fiscal.
Indica se o evento tem XML disponível em /events/{eventId}/xml.