POST
/api/mdfe/consultQuery the status of the MDF-e
Consults the MDF-e status at the tax authority using the access key. When the access key does not belong to an MDF-e issued through this platform, the query is made in the environment given by tpAmb in the request, or in the production environment when it is omitted. When the MDF-e is cancelled, message is MDF-e Cancelado and cStat is 101; when it is closed, message is MDF-e Encerrado and cStat is 132. In both cases nProt is the protocol of the corresponding event.
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) |
tpAmbint | int | Query environment: 1=Production (default), 2=Test.Applies only to access keys not issued through this platform; keys issued through this platform are queried in the environment in which they were issued |
* 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/consult" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"chMDFe": "35260512345678000199580010000000011000000018"
}
{
"success": true,
"message": "Autorizado o uso do MDF-e",
"cStat": "100",
"chMDFe": "35260512345678000199580010000000011000000018",
"nProt": "135260000123456",
"xml": "https://storage.../mdfe/35260512345678000199580010000000011000000018.xml",
"damdfe": "https://storage.../mdfe/35260512345678000199580010000000011000000018.pdf"
}