Cancelar NFS-e
curl --request DELETE \
--url https://api.spedy.com.br/v1/service-invoices/{id} \
--header 'Content-Type: application/json-patch+json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.spedy.com.br/v1/service-invoices/{id}"
payload = { "reason": "<string>" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.spedy.com.br/v1/service-invoices/{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://api.spedy.com.br/v1/service-invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spedy.com.br/v1/service-invoices/{id}"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.spedy.com.br/v1/service-invoices/{id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spedy.com.br/v1/service-invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"integrationId": "<string>",
"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>"
},
"amount": 123,
"number": 123,
"processingDetail": {
"message": "<string>",
"code": "<string>",
"on": "2023-11-07T05:31:56Z"
},
"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,
"ibsCityRate": 123,
"cbsRate": 123,
"ibsCbsBaseTax": 123,
"ibsStateAmount": 123,
"ibsCityAmount": 123,
"ibsAmount": 123,
"cbsAmount": 123,
"receivedAmount": 123
},
"rps": {
"number": 123,
"series": "<string>"
},
"location": {
"code": 123,
"name": "<string>"
},
"ibsCbs": {
"cst": 123,
"classification": 123,
"operationIndicatorCode": "<string>",
"isPersonalUse": true,
"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>"
}
}NFS-e
Cancelar NFS-e
Cancela uma nota autorizada, dentro do prazo legal, informando a justificativa (reason).
O cancelamento é processado de forma assíncrona até o status canceled — acompanhe por webhook ou consulta.
Prazos e regras variam por UF (NF-e/NFC-e) e por município (NFS-e).
DELETE
/
v1
/
service-invoices
/
{id}
Cancelar NFS-e
curl --request DELETE \
--url https://api.spedy.com.br/v1/service-invoices/{id} \
--header 'Content-Type: application/json-patch+json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://api.spedy.com.br/v1/service-invoices/{id}"
payload = { "reason": "<string>" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://api.spedy.com.br/v1/service-invoices/{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://api.spedy.com.br/v1/service-invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spedy.com.br/v1/service-invoices/{id}"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.spedy.com.br/v1/service-invoices/{id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spedy.com.br/v1/service-invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"integrationId": "<string>",
"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>"
},
"amount": 123,
"number": 123,
"processingDetail": {
"message": "<string>",
"code": "<string>",
"on": "2023-11-07T05:31:56Z"
},
"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,
"ibsCityRate": 123,
"cbsRate": 123,
"ibsCbsBaseTax": 123,
"ibsStateAmount": 123,
"ibsCityAmount": 123,
"ibsAmount": 123,
"cbsAmount": 123,
"receivedAmount": 123
},
"rps": {
"number": 123,
"series": "<string>"
},
"location": {
"code": 123,
"name": "<string>"
},
"ibsCbs": {
"cst": 123,
"classification": 123,
"operationIndicatorCode": "<string>",
"isPersonalUse": true,
"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>"
}
}Authorizations
Authorization By X-Api-Key inside request's header
Path Parameters
Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
Minimum string length:
1Response
Success
ID da NF
ID de integração
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
Available options:
created, enqueued, received, authorized, inContingent, rejected, canceled, denied, removed, disabled Valores possíveis:
- productInvoice: NF-e
- consumerInvoice: NFC-e
- serviceInvoice: NFS-e
Available options:
productInvoice, consumerInvoice, serviceInvoice Valores possíveis:
- production: Produção
- development: Homologação
- simulation:
Available options:
production, development, simulation Data de emissão
Data de competência
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Dados de autorização da nota fiscal
Show child attributes
Show child attributes
Valor total da NF
Número
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
Show child attributes
Show child attributes
⌘I