CT-e
Cancel CT-e
Registers cancellation event 110111 on an authorized CT-e, within 168 hours after authorization.
/openapi/v2/empresas/{empresaId}/cte/{cteId}Requires the token, timestamp and sign signature headers, see Authentication.
The body is optional. Event 110111 is registered synchronously and the event object is returned. Constraints: the document must be Autorizada (10017040), within 168 hours after authorization (10017041), and a CT-e with a registered correction letter cannot be cancelled (10017048, MOC CT-e rule); a SEFAZ rejection returns 10017043. Because this DELETE may carry a body, sign the raw JSON with CR/LF removed; with no body, sign with the empty string.
Parameters
Path parameters
empresaIdstringrequiredCompany (carrier) identifier returned at registration.
Example:1934811222334455cteIdstringrequiredThe
idsent at CT-e issuance.Example:CTE-ORD-1
Request body
motivostringoptionalCancellation reason (xJust), 15 to 255 characters; a fixed default text is used when omitted.
Example:Erro de digitacao no documento
Responses
Event registered with SEFAZ. The event object is returned synchronously.
chaveAcessostring44-digit access key of the CT-e the event was linked to.
tipostringEvent type.
Values:CancelamentoCartaCorrecaoComprovanteEntregaCancelamentoComprovanteEntregaInsucessoEntregaCancelamentoInsucessoEntregaPrestacaoDesacordoCancelamentoPrestacaoDesacordoEpeccodigostringSEFAZ event code (tpEvento):
110111,110110,110113,110180,110181,110190,110191,610110,610111.sequenciaintegerSequence number of the event within its type (the correction letter auto-increments).
statusstringcStat returned by SEFAZ;
135means the event was registered and linked.motivostringxMotivo returned by SEFAZ.
protocolostringEvent protocol number; use it as
protocoloEventoto cancel the event.datastringEvent registration date and time, ISO-8601 in UTC.
linkXmlstringDownload link of the event XML (procEvento). See File download.
Errors
| Code | HTTP | |
|---|---|---|
| CTe0001 | 404 |
|
| 10003000 | 404 |
|
| 10017040 | 400 | The document status does not allow the event; the CT-e must be |
| 10017041 | 400 | Cancellation window exceeded (168 hours after authorization). |
| 10017042 | 400 | Invalid event text (length out of range after sanitization). |
| 10017043 | 400 | SEFAZ rejected the event; |
| 10017048 | 400 | Cancellation blocked: the CT-e already has a registered correction letter. |
| 10001001 | 400 | Request field validation failed (one entry per field); fix per |
