POST
/api/invoice/received/get_sync_statusGet sync status
Required headers
tokenstring | string | Company token |
signstring | string | MD5 signature: MD5(token + path + body + timestamp) |
timestampstring | string | Unix timestamp in seconds (5-minute window) |
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| cnpj | string | Yes | Recipient company CNPJ — 14 digits, unformatted |
Response fields
cnpjstring | string | CNPJ queried |
ufstring | string | Recipient state used in the last sync (absent if never synced) |
ult_long | long | Last NSU processed.0 = never synced |
max_long | long | Largest NSU available in the tax authority at the last sync |
pendinglong | long | Pending documents (max_nsu - ult_nsu).If > 0, there are new documents in the tax authority |
last_string | string | Time (UTC) at which documents were last obtained from the tax authority.null if never synced |
Typical use: call this endpoint before
/received/sync to decide whether to call the tax authority. This endpoint does not consume the tax authority rate limit — it only reads the synchronization state stored by the platform.
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/received/get_sync_status" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"cnpj": "26638419000167"
}
{
"success": true,
"message": "成功",
"data": {
"cnpj": "26638419000167",
"uf": "SP",
"ult_nsu": 2323,
"max_nsu": 2323,
"pending": 0,
"last_sync": "2026-05-13 16:30:05"
}
}
{
"success": true,
"message": "成功",
"data": {
"cnpj": "26638419000167",
"ult_nsu": 0,
"max_nsu": 0,
"pending": 0,
"last_sync": null
}
}