POST
/api/audit/runRun tax audit
Runs the digital tax audit over the invoices already stored for the authenticated company — without generating a file or relying on an external validator. Scope: NF-e (model 55), production invoices only (homologation is ignored). It runs two rules: numbering gaps/omissions (numbers missing between the lowest and highest authorized number, per series) and duplicates (the same key stored more than once, or the same order authorized more than once). The period is optional; without a period, it audits all of the company's invoices.
Required headers
tokenstring | string | Company token |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body — parameters (all optional)
monthnumber | number | Month (1–12). Has top priority: audits the whole month. Combine with year. |
yearnumber | number | Year of month (default: current year).Ignored without month. |
start_string | string | Start of the period, in dd/MM/yyyy or dd/MM/yyyy HH:mm:ss format.Without the time, it assumes 00:00:00. São Paulo time zone. Used when month is not sent. |
end_string | string | End of the period (same format). The end is exclusive — for a full month, use the 1st day of the following month (e.g., 01/07/2026). If either start_date or end_date is sent, both must be sent in a valid format, and the start must be earlier than the end. |
start_number | number | Start of the period as a Unix timestamp (milliseconds). Used when month and start_date/end_date are not sent. |
end_number | number | End of the period as a Unix timestamp (milliseconds, exclusive). |
All fields are optional. Precedence: month (+year) › start_date/end_date › start_create_time/end_create_time › none (audits all invoices).
Response — fields
company_number | number | ID of the audited company |
periodoobject | object | Period actually audited (São Paulo time zone, format dd/MM/yyyy HH:mm:ss), with de and ate; an end that was not specified is null. |
notas_array | array | Numbering rule. Each item = { serie, quantidade, notas }, where notas are the missing numbers joined by comma. A missing number is a number between the lowest and highest authorized, cancelled or voided numbers of the series for which the platform has no record at all. |
notas_array | array | Duplicate rule. Each item carries quantidade + registros[] and is identified by chave (same document stored more than once) or by pedido (same order authorized more than once). Each record = { serie, numero, chave, status, emitida_em }; emitida_em is the issuance time (São Paulo timezone, format dd/MM/yyyy HH:mm:ss, same as periodo), and status is Success (authorized), Canceled (cancelled) or Voided (voided). Only invoices in these three statuses are counted. |
Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/audit/run" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"month": 6,
"year": 2026
}
{
"success": true,
"message": "成功",
"data": {
"company_id": 4512,
"periodo": {
"de": "01/06/2026 00:00:00",
"ate": "01/07/2026 00:00:00"
},
"notas_puladas": [
{
"serie": 2,
"quantidade": 2,
"notas": "1050, 1051"
}
],
"notas_duplicadas": [
{
"chave": "35260640355318000140550020000010421000010428",
"quantidade": 2,
"registros": [
{
"serie": 2,
"numero": 1042,
"chave": "35260640355318000140550020000010421000010428",
"status": "Success",
"emitida_em": "15/06/2026 14:22:31"
},
{
"serie": 2,
"numero": 1042,
"chave": "35260640355318000140550020000010421000010428",
"status": "Canceled",
"emitida_em": "15/06/2026 14:23:05"
}
]
}
]
}
}