POST
/api/mdfe/closeClose MDF-e
Closes the MDF-e at the end of the trip (event 110112). After closing, it can no longer be cancelled. Only MDF-e documents issued through this platform can be closed. The fields dtEnc, cUF and cMun are optional; when omitted, the current date, the trip's final state (ide.UFFim) and the first unloading municipality (the first entry of infDoc.infMunDescarga) are used.
Required headers
tokenstring | string | Token of the issuing company |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body
chMDFe*string | string | Access key of the MDF-e (44 digits) |
dtEncstring | string | Closing date (YYYY-MM-DD). Default: current date |
cUFint | int | IBGE code of the state where the closing takes place. Default: the trip's final state ( ide.UFFim) |
cMunstring | string | IBGE code (7 digits) of the municipality where the closing takes place. Default: the first unloading municipality |
* Required field.
Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/mdfe/close" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"chMDFe": "35260512345678000199580010000000011000000018",
"dtEnc": "2026-05-22",
"cUF": 32,
"cMun": "3205200"
}
{
"success": true,
"message": "Evento registrado e vinculado a MDF-e",
"cStat": "135",
"chMDFe": "35260512345678000199580010000000011000000018",
"nProt": "135260000123458",
"xml": "https://storage.../mdfe/35260512345678000199580010000000011000000018.xml"
}