DC-e
Cancel DC-e
Requests the cancellation of an authorized DC-e (within 24 hours after authorization); asynchronous, result via webhook.
/openapi/v2/empresas/{empresaId}/dc-e/{dceId}/cancelartoken, timestamp and sign signature headers, see Authentication.Acceptance returns HTTP 200 with no body, the document moves to CancelamentoPendente, and the platform registers cancellation event 110111 with SEFAZ asynchronously. The result arrives through the webhook dce.canceled (Cancelada) or dce.cancel_rejected (CancelamentoNegado), and can also be polled through the query. The official DC-e has cancellation only: no correction letter, no number invalidation.
Path parameters
empresaId* | string | Issuing company identifier |
dceId* | string | Document identifier |
* Required field
Request body
motivo | string | Cancellation reason |
* Required field
CancelamentoPendente; the SEFAZ verdict arrives through the webhook.No response body
A POST without a body signs with the empty string as body; a POST with a body (cancellation with a reason) signs the raw JSON with CR/LF removed, exactly like the JSON endpoints. If you send { "motivo": ... }, include that same text in the signature. See Authentication.
The document must be Autorizada (10019040) and within 24 hours after authorization (10019041); only one cancellation is accepted per document (10019042). The SEFAZ verdict arrives through one of the two webhooks below; full payloads are in DC-e.
Cancellation registered: dce.canceled
dceStatus is Cancelada; dceDataAutorizacao is the cancellation registration time and dceNumeroProtocolo the event protocol. The DACE then carries the CANCELADA watermark.
{ "tipo": "DC-e", "empresaId": "1934811222334455", "dceId": "DCe-000012333", "dceStatus": "Cancelada", "dceMotivoStatus": null,"dceChaveAcesso": "4126...", "dceDataAutorizacao": "2026-09-06T15:00:00Z", "dceNumeroProtocolo": "141260000000099" }
Cancellation rejected: dce.cancel_rejected
dceStatus is CancelamentoNegado and dceMotivoStatus carries the SEFAZ code and description. The document stays Autorizada, the query shows the reason in motivoStatus, and a corrected cancellation may be sent again.
{ "tipo": "DC-e", "empresaId": "1934811222334455", "dceId": "DCe-000012333", "dceStatus": "CancelamentoNegado","dceMotivoStatus": "594 - Rejeicao: O numero de sequencia do evento informado e maior que o permitido","dceChaveAcesso": "4126...", "dceDataAutorizacao": null, "dceNumeroProtocolo": "141260000000001" }
| Code | HTTP | |
|---|---|---|
| 10019002 | 404 | dceId not found, not owned by the company, or the document was not numbered yet (still Pendente without a key). Cancel Pendente documents only after authorization. |
| 10019003 | 404 | dceId not found, not owned by the company, or the document was not numbered yet (still Pendente without a key). Cancel Pendente documents only after authorization. |
| 10003000 | 404 | empresaId not found. |
| 10019040 | 400 | Status does not allow cancellation: the document must be Autorizada (already cancelled documents also return this code). |
| 10019041 | 400 | 24-hour window after authorization exceeded. The document can only be kept. |
| 10019042 | 400 | Cancellation already accepted for this document (in progress). Only one cancellation is accepted per document. |
| 10019043 | 400 | Invalid motivo: shorter than 15 characters after sanitization. |
