POST
/api/dce/cancelCancel DC-e
Cancels an authorized DC-e (event 110111). Requires that the DC-e has been authorized (has a protocol) and is not yet canceled. Each DC-e allows a single cancellation.
Required headers
tokenstring | string | Token of the issuing company |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body
chDCe*string | string | DC-e access key (44 digits) |
xJust*string | string | Cancellation justification (minimum 15 characters as required by the tax authority) |
nProtstring | string | Authorization protocol. Optional: when omitted, uses the protocol registered at issuance |
* Required field.
In case of rejection, the response returns success=false, and the cStat/xMotivo of the refusal.
Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/dce/cancel" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"chDCe": "41250612345678000199990010000000011201234564",
"xJust": "Cancelamento por erro no preenchimento dos dados da declaracao"
}
{
"success": true,
"message": "DC-e cancelada",
"chDCe": "41250612345678000199990010000000011201234564",
"cStat": "135",
"xMotivo": "Evento registrado e vinculado a DC-e",
"nProtCancel": "141250000123457",
"xmlCancel": "https://storage.../dce/41250612345678000199990010000000011201234564-110111-01.xml"
}