POST
/api/cte/consultConsult the status of the CT-e
Consults the status of the CT-e at the tax authority from the access key. When the CT-e is cancelled (local record), the response reflects the cancellation. When the access key does not belong to a CT-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 CT-e is cancelled, message is CT-e Cancelado, cStat is 101 and nProt is the cancellation protocol.
Required headers
tokenstring | string | Token of the issuing company |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body
chCTe*string | string | Access key of the CT-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/cte/consult" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"chCTe": "35260626638419000167570010000000011123456780"
}
{
"success": true,
"message": "Autorizado o uso do CT-e",
"cStat": "100",
"chCTe": "35260626638419000167570010000000011123456780",
"nProt": "135260000123456",
"xml": "https://storage.../cte/35260626638419000167570010000000011123456780.xml",
"dacte": "https://storage.../cte/35260626638419000167570010000000011123456780.pdf"
}