curl --request POST \
--url https://api.spedy.com.br/v1/service-invoices/{id}/check-status \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.spedy.com.br/v1/service-invoices/{id}/check-status"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.spedy.com.br/v1/service-invoices/{id}/check-status', 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}/check-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/check-status"
req, _ := http.NewRequest("POST", 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.post("https://api.spedy.com.br/v1/service-invoices/{id}/check-status")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spedy.com.br/v1/service-invoices/{id}/check-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"integrationId": "<string>",
"status": "created",
"model": "productInvoice",
"environmentType": "production",
"issuedOn": "2023-11-07T05:31:56Z",
"effectiveDate": "2023-11-07T05:31:56Z",
"receiver": {
"name": "<string>",
"federalTaxNumber": "<string>",
"stateTaxNumber": "<string>",
"suframaTaxNumber": "<string>",
"cityTaxNumber": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"address": {
"street": "<string>",
"district": "<string>",
"postalCode": "<string>",
"number": "<string>",
"additionalInformation": "<string>",
"city": {
"name": "<string>",
"state": "<string>",
"code": 123
},
"country": "<string>"
}
},
"company": {
"name": "<string>",
"legalName": "<string>",
"federalTaxNumber": "<string>",
"stateTaxNumber": "<string>",
"cityTaxNumber": "<string>"
},
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-11-07T05:31:56Z",
"transactionId": "<string>"
},
"authorization": {
"date": "2023-11-07T05:31:56Z",
"protocol": "<string>",
"digestValue": "<string>"
},
"cancellation": {
"date": "2023-11-07T05:31:56Z",
"protocol": "<string>",
"justification": "<string>"
},
"amount": 123,
"number": 123,
"processingDetail": {
"status": "processing",
"message": "<string>",
"code": "<string>",
"on": "2023-11-07T05:31:56Z"
},
"isFromApi": true,
"description": "<string>",
"totals": {
"invoiceAmount": 123,
"netAmount": 123,
"issBaseTax": 123,
"irRate": 123,
"csllRate": 123,
"pisRate": 123,
"cofinsRate": 123,
"inssRate": 123,
"issRate": 123,
"issAmount": 123,
"discountUnconditionedAmount": 123,
"discountConditionedAmount": 123,
"irAmount": 123,
"pisCofinsBaseTax": 123,
"pisAmount": 123,
"cofinsAmount": 123,
"inssAmount": 123,
"csllAmount": 123,
"othersAmount": 123,
"deductionsAmount": 123,
"irWithheld": true,
"issWithheld": true,
"cofinsWithheld": true,
"inssWithheld": true,
"csllWithheld": true,
"pisWithheld": true,
"ibsStateRate": 123,
"ibsStateRedRate": 123,
"ibsCityRate": 123,
"ibsCityRedRate": 123,
"cbsRate": 123,
"cbsRedRate": 123,
"ibsCbsBaseTax": 123,
"ibsStateAmount": 123,
"ibsCityAmount": 123,
"ibsAmount": 123,
"cbsAmount": 123,
"receivedAmount": 123
},
"rps": {
"number": 123,
"series": "<string>"
},
"location": {
"code": 123,
"name": "<string>",
"state": "ro"
},
"ibsCbs": {
"cst": 123,
"classification": 123,
"operationIndicatorCode": "<string>",
"isPersonalUse": true,
"operationType": "supplyWithSubsequentPayment",
"governmentEntityType": "union",
"property": {
"fiscalPropertyTaxNumber": "<string>",
"cibCode": "<string>",
"address": {
"street": "<string>",
"district": "<string>",
"postalCode": "<string>",
"number": "<string>",
"additionalInformation": "<string>",
"city": {
"name": "<string>",
"state": "<string>",
"code": 123
},
"country": "<string>"
}
}
},
"nbsCode": "<string>",
"nationalTaxationCode": "<string>",
"batchNumber": 123,
"approximateTaxes": {
"federalAmount": 123,
"federalRate": 123,
"municipalRate": 123,
"municipalAmount": 123,
"stateAmount": 123,
"stateRate": 123,
"amount": 123,
"rate": 123,
"version": "<string>",
"source": "<string>",
"mode": "disabled"
}
}Consultar nota fiscal
Consulta o status da NFS-e diretamente na prefeitura e reconcilia o resultado no Spedy.
Use esta consulta para reconciliar uma nota cujo status no Spedy pode estar desatualizado em relação à prefeitura:
- Nota marcada como Rejeitada no Spedy mas que consta autorizada na prefeitura.
- Nota cujo acompanhamento automático pós-envio esgotou as tentativas (a prefeitura demorou a processar) e ficou travada — a consulta destrava o processamento.
Para apenas acompanhar o status (polling): se você não usa webhooks e precisa verificar o status periodicamente,
use Obter NFS-e (GET /v1/service-invoices/{id}) — retorna o status atual da nota sem acionar a prefeitura.
Reserve este check-status para os casos de reconciliação/destrave acima.
Quando NÃO usar: não serve para “furar a fila” e forçar a emissão na hora. Enquanto a nota está enfileirada para emissão (ainda não enviada à prefeitura), o endpoint responde HTTP 400 — aguarde o processamento. Só há status a consultar depois que a nota foi enviada à autoridade.
curl --request POST \
--url https://api.spedy.com.br/v1/service-invoices/{id}/check-status \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.spedy.com.br/v1/service-invoices/{id}/check-status"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.spedy.com.br/v1/service-invoices/{id}/check-status', 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}/check-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/check-status"
req, _ := http.NewRequest("POST", 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.post("https://api.spedy.com.br/v1/service-invoices/{id}/check-status")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spedy.com.br/v1/service-invoices/{id}/check-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"integrationId": "<string>",
"status": "created",
"model": "productInvoice",
"environmentType": "production",
"issuedOn": "2023-11-07T05:31:56Z",
"effectiveDate": "2023-11-07T05:31:56Z",
"receiver": {
"name": "<string>",
"federalTaxNumber": "<string>",
"stateTaxNumber": "<string>",
"suframaTaxNumber": "<string>",
"cityTaxNumber": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"address": {
"street": "<string>",
"district": "<string>",
"postalCode": "<string>",
"number": "<string>",
"additionalInformation": "<string>",
"city": {
"name": "<string>",
"state": "<string>",
"code": 123
},
"country": "<string>"
}
},
"company": {
"name": "<string>",
"legalName": "<string>",
"federalTaxNumber": "<string>",
"stateTaxNumber": "<string>",
"cityTaxNumber": "<string>"
},
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"date": "2023-11-07T05:31:56Z",
"transactionId": "<string>"
},
"authorization": {
"date": "2023-11-07T05:31:56Z",
"protocol": "<string>",
"digestValue": "<string>"
},
"cancellation": {
"date": "2023-11-07T05:31:56Z",
"protocol": "<string>",
"justification": "<string>"
},
"amount": 123,
"number": 123,
"processingDetail": {
"status": "processing",
"message": "<string>",
"code": "<string>",
"on": "2023-11-07T05:31:56Z"
},
"isFromApi": true,
"description": "<string>",
"totals": {
"invoiceAmount": 123,
"netAmount": 123,
"issBaseTax": 123,
"irRate": 123,
"csllRate": 123,
"pisRate": 123,
"cofinsRate": 123,
"inssRate": 123,
"issRate": 123,
"issAmount": 123,
"discountUnconditionedAmount": 123,
"discountConditionedAmount": 123,
"irAmount": 123,
"pisCofinsBaseTax": 123,
"pisAmount": 123,
"cofinsAmount": 123,
"inssAmount": 123,
"csllAmount": 123,
"othersAmount": 123,
"deductionsAmount": 123,
"irWithheld": true,
"issWithheld": true,
"cofinsWithheld": true,
"inssWithheld": true,
"csllWithheld": true,
"pisWithheld": true,
"ibsStateRate": 123,
"ibsStateRedRate": 123,
"ibsCityRate": 123,
"ibsCityRedRate": 123,
"cbsRate": 123,
"cbsRedRate": 123,
"ibsCbsBaseTax": 123,
"ibsStateAmount": 123,
"ibsCityAmount": 123,
"ibsAmount": 123,
"cbsAmount": 123,
"receivedAmount": 123
},
"rps": {
"number": 123,
"series": "<string>"
},
"location": {
"code": 123,
"name": "<string>",
"state": "ro"
},
"ibsCbs": {
"cst": 123,
"classification": 123,
"operationIndicatorCode": "<string>",
"isPersonalUse": true,
"operationType": "supplyWithSubsequentPayment",
"governmentEntityType": "union",
"property": {
"fiscalPropertyTaxNumber": "<string>",
"cibCode": "<string>",
"address": {
"street": "<string>",
"district": "<string>",
"postalCode": "<string>",
"number": "<string>",
"additionalInformation": "<string>",
"city": {
"name": "<string>",
"state": "<string>",
"code": 123
},
"country": "<string>"
}
}
},
"nbsCode": "<string>",
"nationalTaxationCode": "<string>",
"batchNumber": 123,
"approximateTaxes": {
"federalAmount": 123,
"federalRate": 123,
"municipalRate": 123,
"municipalAmount": 123,
"stateAmount": 123,
"stateRate": 123,
"amount": 123,
"rate": 123,
"version": "<string>",
"source": "<string>",
"mode": "disabled"
}
}Authorizations
Authorization By X-Api-Key inside request's header
Path Parameters
Response
OK
ID da NF
ID de integração
Status
Valores possíveis:
- created: Criada — aguarda emissão explícita via issue ou gatilho automático (ex: afterPayment)
- enqueued: Enfileirada para processamento junto à SEFAZ ou Prefeitura
- received: Recebido
- authorized: Autorizado
- inContingent: Em contingência
- rejected: Rejeitado
- canceled: Cancelado
- denied: Denegado
- removed: Removido
- disabled: Inutilizado
created, enqueued, received, authorized, inContingent, rejected, canceled, denied, removed, disabled Modelo
Valores possíveis:
- productInvoice: NF-e
- consumerInvoice: NFC-e
- serviceInvoice: NFS-e
productInvoice, consumerInvoice, serviceInvoice Ambiente
Valores possíveis:
- production: Produção
- development: Homologação
- simulation:
production, development, simulation Data e hora em que a emissão foi solicitada
Data de competência
Cliente
Show child attributes
Show child attributes
Empresa
Show child attributes
Show child attributes
Dados da venda
Show child attributes
Show child attributes
Dados da autorização
Show child attributes
Show child attributes
Dados do cancelamento
Show child attributes
Show child attributes
Valor total da NF
Número
Detalhes do processamento
Show child attributes
Show child attributes
Emitida via API pública
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes