TF Fiscal

Received Documents & DistDFe

POST/api/invoice/received/get_sync_status

Get sync status

Required headers

tokenstringstringCompany token
signstringstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringstringUnix timestamp in seconds (5-minute window)

Fields

FieldTypeRequiredDescription
cnpjstringYesRecipient company CNPJ — 14 digits, unformatted

Response fields

cnpjstringstringCNPJ queried
ufstringstringRecipient state used in the last sync (absent if never synced)
ult_nsulonglongLast NSU processed.
max_nsulonglongLargest NSU available in the tax authority at the last sync
pendinglonglongPending documents (max_nsu - ult_nsu).
last_syncstringstringTime (UTC) at which documents were last obtained from the tax authority.
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