TF Fiscal

Received documents & filing

Received Documents & DistDFe

9 endpoints

Recipient Manifestation

Recipient Manifestation allows the NF-e recipient to formally position themselves regarding an invoice issued against their CNPJ. There are 4 event types defined by the tax authority, each with its own legal meaning.

Event Types

CodeNameMeaningJustification
210210 Operation Awareness The recipient acknowledges the NF-e exists but has neither confirmed nor rejected it yet. Usually the first event, and a requirement to download the full XML via DistDFe. Not required
210200 Operation Confirmation The recipient confirms the operation took place and the goods/services were received. Final event, proves receipt. Not required
210220 Operation Unawareness The recipient declares they do NOT recognize the operation (suspected fraud, misuse of CNPJ, etc.). Required (15-255 chars)
210240 Operation Not Performed The recipient acknowledges the operation but declares it did NOT take place (return, refusal of delivery, etc.). Required (15-255 chars)
Sequence rule: After Awareness (210210) is sent, the recipient may send Confirmation (210200) OR Unawareness (210220) OR Not Performed (210240). Confirmation/Unawareness/Not Performed are final states — they cannot be overwritten.
Attention: The CNPJ sent in the cnpj field must be a company registered under the token; otherwise the endpoint returns empresa com CNPJ ... não encontrada para este token. The CNPJ must also be the recipient of the NF-e (the one manifesting); otherwise the tax authority rejects the event. Recipient manifestation always runs in the production environment.

Return cStat Codes

cStatMeaning
135Event successfully registered
573Event duplicity — already registered (treated as success)
236Access key with invalid check digit
491Invalid event type (tpEvento)
594Event sequence number greater than allowed. This endpoint always uses sequence 1 and does not resend an event that is already registered, so this code does not occur under normal conditions
596Event submitted after the deadline
656Improper consumption (rate limit)

DistDFe Capture — Received NFes

Allows querying and downloading NFes and events in which the company CNPJ is the recipient, via the NFeDistribuicaoDFe service from the tax authority (National Environment). Capture is incremental by NSU (Unique Sequential Number) — each call only downloads what has not been captured yet.

Returned Document Types

doc_typeWhat it isContent
resNFe NFe summary Basic metadata (key, value, issuer, status). Comes BEFORE the Awareness event is sent — does not contain products/taxes
procNFe Full authorized NFe Complete NF-e XML (with products, taxes, transport, etc.). Only available AFTER the recipient sends Awareness (210210) for the key
resEvento Event summary Event metadata (key, type, sequence, reason)
procEvento Full event Complete event XML (CC-e, cancellation, manifestations from other recipients on the company's invoices)
Recommended flow:
  1. Call /received/sync — downloads all new documents
  2. List with /received/list filtering by doc_type: "resNFe" to see invoices without Awareness
  3. For each key of interest, call /invoice/manifest with tipo_evento: 210210
  4. Call /received/sync again — now tax authority returns the procNFe (full XML) of the manifested keys
  5. Use /received/get_xml to fetch the XML URL and process
tax authority rate limit: tax authority allows at most 1 DistDFe call per hour per CNPJ. Exceeding this returns cStat: 656 (Improper Consumption). Synchronization always runs in the production environment.

DistDFe Return cStat Codes

cStatMeaning
137No documents found (normal end of loop)
138Documents found — loop continues
656Improper consumption — wait 1h and retry
252Environment differs from informed (production vs homologation)
280Invalid transmitter certificate (for example, expired)