POST
/api/invoice/invalidInvalidate numbering range
Invalidates a contiguous range of NF-e numbers that were never authorized (not to be confused with cancellation — cancellation applies to already-authorized invoices). The operation is registered at the tax authority and is irreversible. The range is declared for the current year.
Required headers
tokenstring | string | Issuing company token |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body
modelo*string | string | Document model: "55"=NF-e, "65"=NFC-e.(Note: the field is modelo, not model) |
ambiente*string | string | "1"=production, "2"=homologation |
serie*int | int | Series of the numbering to invalidate |
start_*int | int | Starting number of the range |
end_*int | int | Ending number of the range |
motivo*string | string | Justification for the invalidation (minimum 15 characters, tax authority requirement) |
* Required field.
Response fields (data)
uuidstring | string | Internal identifier of the invalidation record |
xmlstring | string | URL of the invalidation XML authorized by the tax authority |
Response — error
Failures return
success: false with the tax authority message in message and no data object. Happens when a required field is missing, the certificate is invalid, or tax authority rejects the invalidation (e.g. range already invalidated).
{
"success": false,
"message": "Rejeição: Faixa de numeração já inutilizada",
"code": "TAX_AUTHORITY_REJECTED"
}Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/invoice/invalid" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"modelo": "55",
"ambiente": "2",
"serie": 1,
"start_number": 100,
"end_number": 105,
"motivo": "Falha no sistema durante a emissao do lote"
}
{
"success": true,
"data": {
"uuid": "9b1e4c7a-3f2d-4e8b-a6c5-1d0f7e2b8a94",
"xml": "https://oss.example.com/.../chave-inutilizacao.xml"
}
}