TF Fiscal

Received Documents & DistDFe

POST/api/invoice/received/check

Check received invoice

Compares the received invoice with the purchase order and with what the engine expects (interstate rate, TIPI, ICMS-ST, CST × CRT, CFOP × operation, cClassTrib) and returns the discrepancies. The invoice must have been synchronized with the full XML; the route reads the stored XML and does not query the tax authority.

The route does not send any event. The decision is the customer's, who uses /api/invoice/manifest.

Required headers

tokenstringstringCompany token; CNPJ, state and tax regime are read from the company's registration
signstringstringMD5 signature: md5(token + "/api/invoice/received/check" + body without line breaks + timestamp)
timestampstringstringUnix timestamp in seconds, 5-minute tolerance

Body

chave*stringstring44-digit key
finalidadestringstringDefault purpose of the items (defines whether ST is expected)
itens[]arrayarray
itens[].quantidade/valor_unitario/ncmnumber / stringnumber / stringPurchase order data

 * Required field.

Checks

CodeCheck
destinatario_divergenteRecipient CNPJ or IE differs from the token company
nota_canceladaInvoice cancelled or denied
ncm_divergenteNCM differs from the order
quantidade_divergente / valor_divergenteDifference above the tolerance (default BRL 0.05 per item and 0.01% on the total; configurable in /api/company/edit)
cfop_incompativelIntrastate CFOP in an interstate operation, or the opposite
cst_incompativelCST/CSOSN incompatible with the issuer's CRT
aliquota_icms_divergenteInterstate rate differs from the expected one (4%, 7% or 12%, by origin)
ipi_divergenteItemized IPI differs from TIPI
st_divergenteST expected and not withheld, or withheld without being expected. Expected ST below the per-item tolerance is not reported
ibscbs_divergenteInvalid IBS/CBS classification, or missing group in a regular-regime invoice issued from 08/03/2026 (Ato Conjunto RFB/CGIBS 4/2026); Simples Nacional only from 2027. Regular regime = CRT 3; CRT 2 (above the sub-limit) follows the Simples rule

Result: aprovada, aprovada_com_avisos, divergente or pendente (check not performed; reason in pendencias). Each discrepancy has codigo, nItem, esperado, encontrado and mensagem.

What to do with a discrepancy

In the Brazilian system the recipient cannot reject the invoice or ask the tax authority to have it reissued. It can register a recipient event:

  • 210220 — Unknown operation: when it does not recognize the purchase;
  • 210240 — Operation not carried out: when the purchase existed but the goods were not received or were refused.

The event does not cancel the invoice. Afterwards, regularization is done by the supplier (cancellation, while within the deadline, or an entry NF-e when the goods return) or by the customer itself (return NF-e, when the goods already entered inventory, for example a product rejected at inspection).

Deadline: 90 days from the invoice authorization for 210200, 210220 and 210240, for invoices authorized from 06/01/2026 (Ajuste SINIEF 14/2026; NT 2020.001 v1.60); before that, 180 days. The response returns prazo_manifestacao with the deadline; when there is a discrepancy, the warnings prazo_manifestacao_proximo (up to 10 days) and prazo_manifestacao_expirado show the urgency.

Common errors

MessageCause
empresa não encontrada para este token / 该token未找到企业The token is not linked to a registered company
Corpo da requisição inválido: envie um objeto JSON / 请求体无效,请传入 JSON 对象The body is not a valid JSON object
Falha na conferência da nota. Tente novamente mais tarde. / 发票核对失败,请稍后重试Internal calculation failure; the request can be retried later

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/check" \
  -H "Content-Type: application/json" \
  -H "token: $TOKEN" \
  -H "timestamp: $TIMESTAMP" \
  -H "sign: $SIGN" \
  -d @body.json