POST
/api/invoice/received/get_xmlGet received document XML
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 |
|---|---|---|---|
| id | string | Yes | Document ObjectId — returned by /received/list |
Response fields
idstring | string | Document ObjectId |
nsunumber | number | Document NSU in DistDFe |
doc_string | string | resNFe, procNFe, resEvento or procEvento |
chavestring | string | NF-e access key |
xml_string | string | URL of the document XML |
danfestring | string | URL of the full DANFE PDF (A4 format). Empty for anything other than procNFe |
danfe_string | string | URL of the 100×150 mm label PDF (simplified DANFE). Empty for anything other than procNFe |
About the returned XML:
resNFe— XML is the summary only, does NOT contain products/taxes. Use for auditing/triage before sending AwarenessprocNFe— Full signed XML, equivalent to the one generated at issuance. Ready to import into the client's ERPprocEvento— Full event XML with signature and protocol
About the PDFs:
- Only the full NF-e (
procNFe) has a DANFE. ForresNFe,resEventoandprocEvento,danfeanddanfe_etiquetacome back empty - They are the same two PDFs sent in the issuance webhook: A4 DANFE and 100×150 mm label
- On the first call for each invoice the PDFs are generated on the spot, so it may take a few seconds; later calls return the same link
- The PDFs stay available for 6 days. After that, call the endpoint again to get a new link — do not store the link as permanent
- If generation fails, the response is still successful and includes
xml_url; only the PDF field comes back empty
Common errors
| Message | Cause |
|---|---|
| id inválido | Value is not a valid ObjectId |
| documento recebido não encontrado | ObjectId exists but does not belong to the token's user |
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_xml" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"id": "6a04a70d3201b5a62f3ac2f8"
}
{
"success": true,
"message": "成功",
"data": {
"id": "6a04a70d3201b5a62f3ac2f8",
"nsu": 2318,
"doc_type": "procNFe",
"chave": "35260563845920000120550020000085471156822656",
"xml_url": "https://storage.../received/13-05-2026/...procNFe_2318.xml",
"danfe": "https://storage.../received/dd-MM-yyyy/<chave>_danfe.pdf",
"danfe_etiqueta": "https://storage.../received/dd-MM-yyyy/<chave>_100x150_simplie.pdf"
}
}