POST
/api/mdfe/consult查询 MDF-e 状态
使用访问密钥在税务局查询 MDF-e 状态。访问密钥不属于通过本平台开具的 MDF-e 时,按请求中的 tpAmb 查询,未传时按生产环境查询。MDF-e 已取消时,message 为 MDF-e Cancelado、cStat 为 101;已关闭时,message 为 MDF-e Encerrado、cStat 为 132;这两种情况下 nProt 为相应事件的协议号。
必需请求头
tokenstring | string | 发行企业 token |
signstring | string | MD5 签名 |
timestampstring | string | Unix 时间戳(秒) |
Body
chMDFe*string | string | MDF-e 访问密钥(44 位) |
tpAmbint | int | 查询环境:1=生产(默认),2=测试。仅对非本平台开具的访问密钥生效;本平台开具的按开具时的环境查询 |
* 必填字段。
示例
# sign = md5(token + path + body + timestamp) # 按接口路径生成的调用模板,占位符替换为实际值 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"
}