TF Fiscal

MDF-e Manifest

POST/api/mdfe/close

Close 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

tokenstringstringToken of the issuing company
signstringstringMD5 signature
timestampstringstringUnix timestamp in seconds

Body

chMDFe*stringstringAccess key of the MDF-e (44 digits)
dtEncstringstringClosing date (YYYY-MM-DD).
cUFintintIBGE code of the state where the closing takes place.
cMunstringstringIBGE code (7 digits) of the municipality where the closing takes place.

 * 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