CT-e
取消 CT-e
对已授权 CT-e 登记取消事件 110111,须在授权后 168 小时内。
/openapi/v2/empresas/{empresaId}/cte/{cteId}需要 token、timestamp、sign 三个签名头,参见认证与签名。
请求体可选。同步登记事件 110111 并返回事件对象。限制:单据须为 Autorizada(10017040),授权后 168 小时内(10017041),已登记过信函更正的 CT-e 不可取消(10017048,MOC CT-e 规则),SEFAZ 拒绝返回 10017043。该 DELETE 可带请求体,签名时按 JSON 原文去 CR/LF 参与;无请求体时取空串。
参数
路径参数
empresaIdstring必填注册时返回的主体(承运人)标识。
示例:1934811222334455cteIdstring必填发行 CT-e 时传入的
id。示例:CTE-ORD-1
请求体
motivostring可选取消理由(xJust),15 到 255 字符;缺省使用固定文案。
示例:Erro de digitacao no documento
响应
事件已在 SEFAZ 登记,同步返回事件对象。
chaveAcessostring事件所关联 CT-e 的 44 位访问密钥。
tipostring事件类型。
取值:CancelamentoCartaCorrecaoComprovanteEntregaCancelamentoComprovanteEntregaInsucessoEntregaCancelamentoInsucessoEntregaPrestacaoDesacordoCancelamentoPrestacaoDesacordoEpeccodigostringSEFAZ 事件码(tpEvento):
110111、110110、110113、110180、110181、110190、110191、610110、610111。sequenciainteger同类事件内的序号(信函更正自动递增)。
statusstringSEFAZ 返回的 cStat;
135表示事件已登记并关联。motivostringSEFAZ 返回的 xMotivo。
protocolostring事件协议号;撤销事件时作为
protocoloEvento传入。datastring事件登记时间,ISO-8601 UTC。
linkXmlstring事件 XML(procEvento)下载链接。参见 文件下载。
错误
| 错误码 | HTTP | |
|---|---|---|
| CTe0001 | 404 |
|
| 10003000 | 404 |
|
| 10017040 | 400 | 单据状态不允许该事件;CT-e 须为 |
| 10017041 | 400 | 超出取消窗口(授权后 168 小时)。 |
| 10017042 | 400 | 事件文本非法(净化后长度超出范围)。 |
| 10017043 | 400 | SEFAZ 拒绝了该事件; |
| 10017048 | 400 | 不可取消:该 CT-e 已登记过信函更正。 |
| 10001001 | 400 | 请求字段校验失败(每字段一条);按 |
