TF Fiscal

NF-e Invoices

POST/api/invoice/invalid

Invalidate 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

tokenstringstringIssuing company token
signstringstringMD5 signature
timestampstringstringUnix timestamp in seconds

Body

modelo*stringstringDocument model: "55"=NF-e, "65"=NFC-e.
ambiente*stringstring"1"=production, "2"=homologation
serie*intintSeries of the numbering to invalidate
start_number*intintStarting number of the range
end_number*intintEnding number of the range
motivo*stringstringJustification for the invalidation (minimum 15 characters, tax authority requirement)

 * Required field.

Response fields (data)

uuidstringstringInternal identifier of the invalidation record
xmlstringstringURL 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