Through the Electronic Correction Letter service, it’s possible to change information in some fields of an already authorized CT-e.
Obs.: For a list of fields that can be changed through this method, click here and verify the most updated version of the Sefaz Contributors’s Guidance Manual.
URL
3.00 version
Production: POST https://cte.ns.eti.br/cte/cce/300
Input data
Field | Description | Notes |
---|---|---|
X-AUTH-TOKEN | User access token | |
chCTe | CT-e access key | |
tpAmb | CT-e authorization environment type: 1 - Production, 2 - Homologation | |
dhEvento | Date and time of the event | Sefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC E.g.: 2016-06-13T15:04:10-02:00 |
nSeqEvento | Event sequential number | In most cases it will be 1. However, when more than one event of the same type is generated for the same CT-e, this number must be sequentially incremented. |
infCorrecao | Object or Array of objects containing data to be changed | This field can contain one object ({...}) or several objects within an array ([{...}, {...}, ...]), thus enabling the modification of several CT-e fields at the same time |
infCorrecao.grupoAlterado | Name of the parent group of the field to be changed | Example: "veic" |
infCorrecao.campoAlterado | Name of the field to be changed | Example: "placa" |
infCorrecao.valorAlterado | New value that the field will receive | |
infCorrecao.nroItemAlterado | Index of the changed item, if the change occurs in a list | For example: If you correct one of the sender's NF-es, this tag should indicate the position of the changed NF-e in the list. Note: the index always starts at 1 |
Request example
CT-e CC-e request
curl -X POST
\-H "Content-Type: application/json"
\-d '{
"X-AUTH-TOKEN": "...",
"chCTe": "43160734593612900019557000000010891022310638",
"tpAmb": "2",
"dhEvento": "2016-07-04T18:34:10-03:00",
"nSeqEvento": "1",
"infCorrecao": [
{ "grupoAlterado": "veic",
"campoAlterado": "placa",
"valorAlterado": "IQU9949",
"nroItemAlterado": "1"
}
]
}' \
https://cte.ns.eti.br/cte/cce
Returned data
Field | Description | Notes |
---|---|---|
status | Processing status code | |
motivo | Processing status literal description | |
retEvento | Object containing CT-e processing data at Sefaz | Only when status = 200 |
retEvento.cStat | Processing situation code at Sefaz | |
retEvento.xMotivo | Literal description of the processing situation at Sefaz | |
retEvento.chCTe | CT-e access key | |
retEvento.dhRegEvento | Date and time of the event registration at Sefaz | Sefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC E.g.: 2016-06-13T15:04:10-02:00 |
retEvento.nProt | Document receipt number at Sefaz | |
xml | Distribution XML of the Electronic Correction Letter event | Only when status = 200 |
erros | Array containin a list of errors during the information validation of the correction letter informed in the request according to the data type | Only when status = -4 |
codigo | Occurred error code | Only when status = -5 |
descricao | Occurred error literal description | Only when status = -5 |
Return example
Successful return
{
"status": 200,
"motivo": "CC-e vinculada ao CT-e com sucesso",
"retEvento": {
"cStat": 135,
"xMotivo": "Evento registrado e vinculado a CT-e",
"chCTe": "43160734593612900019557000000010891022310638",
"dhRegEvento": "2016-07-04T20:00:46-03:00",
"nProt": "143160000362732"
},
"xml": "<?xml version=\"1.0\" encoding=\"utf-8\"?><procEventoCTe versao=\"2.00\" xmlns=\"http://www.portalfiscal.inf.br/cte\">...</procEventoCTe>"
}
Return codes
Code | Description |
---|---|
200 | CC-e linked successfully |
-2 | Mandatory fields in the request not informed |
-3 | Invalid access key |
-4 | Information error according to the data type |
-5 | Error sending the Electronic Correction Letter to Sefaz. Verify the "codigo" and "descricao" fields for more information |