CT-e
信函更正
对已授权 CT-e 登记事件 110110(信函更正)。
POST
/openapi/v2/empresas/{empresaId}/cte/{cteId}/carta-correcao需要 token、timestamp、sign 三个签名头,参见认证与签名。
同步出站,成功返回事件对象。须在授权后 720 小时内(10017049);序号自增,上限 20 条(10017044)。登记信函更正后该单据不可再取消(取消时返回 10017048)。
参数
路径参数
empresaIdstring必填注册时返回的主体(承运人)标识。
示例:1934811222334455cteIdstring必填发行 CT-e 时传入的
id。示例:CTE-ORD-1
请求体
correcoesarray必填更正项,1 到 100 条。
响应
200
事件已在 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 须为 |
| 10017042 | 400 | 事件文本非法(净化后长度超出范围)。 |
| 10017043 | 400 | SEFAZ 拒绝了该事件; |
| 10017044 | 400 | 信函更正序号超限(每单 20 条)。 |
| 10017049 | 400 | 信函更正超出授权后 720 小时窗口。 |
| 10001001 | 400 | 请求字段校验失败(每字段一条);按 |
文本净化与坐标
文本字段会先被净化(去变音、折叠空白),再校验长度;净化后长度超出范围返回 10017042。坐标按六位小数登记。
