Through this endpoint, it’s possible to carry out the Cancellation event of an authorized Delivery Receipt.
URL
POST https://cte.ns.eti.br/cte/compentregacanc
Input data
Field | Description | Occurrence | Data Type | Notes |
---|---|---|---|---|
X-AUTH-TOKEN | CT-e access token | 0-1 | String | Can be sent in the request header |
chCTe | CT-e access key | 1-1 | Int | |
tpAmb | CT-e authorization environment type | 1-1 | Int | |
dhEvento | Date and time of the cancellation | 1-1 | Date | Sefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC E.g.: 2016-06-13T15:04:10-02:00 |
nProt | CT-e authorization protocol number | 1-1 | Int | |
nProtCE | Event authorization protocol number of the Delivery Receipt to be cancelled | 1-1 | Int |
Request example
Delivery receipt cancellation request
curl -X POST
\-H "Content-Type: application/json"
\-d '{
"X-AUTH-TOKEN": "YOUR_TOKEN",
"chCTe": "99999999999999999999999999999999999999999999",
"tpAmb": 2,
"dhEvento": "2019-08-12T13:28:30-03:00",
"nProt": "999999999999999",
"nProtCE": "999999999999999"
}' \
https://cte.ns.eti.br/cte/compentregacanc
Returned data
Field | Description | Notes |
---|---|---|
status | Processing status code | |
motivo | Processing status literal description | |
retEvento | Object containing the cancellation processing data at Sefaz | Only when stauts = 200 |
retEvento.cStat | Event situation code at Sefaz | |
retEvento.xMotivo | Evento situation literal description 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 | Event authorization protocol number by Sefaz | |
xml | Event XML | Only when tpDown = "X" (or "XP") and status = 200 |
json | Event XML json | Only when tpDown = "J" (or "JP") and status = 200 |
Event graphical representation in PDF | PDF in Base 64. Only when tpDown = "P" (or "XP" or "JP") and status = 200 | |
erro | Object containing the information error in case the cancellation was not successful | Only when status is different from 200 |
erro.cStat | Error code | |
erro.xMotivo | Error literal description |
Return example
Successful return
{
"status": 200,
"motivo": "Comprovação de Entrega vinculada ao CT-e com sucesso",
"retEvento": {
"cStat": 135,
"xMotivo": "Evento registrado e vinculado a CT-e",
"chCTe": "99999999999999999999999999999999999999999999",
"dhRegEvento": "2019-08-09T19:41:09-03:00",
"nProt": "999999999999999"
},
"xml": "<?xml version=\"1.0\" encoding=\"utf-8\"?><procEventoCTe versao...."
}
Return codes
Code | Description |
---|---|
200 | Cancellation of Delivery Receipt linked to CT-e successfully |
-2 | Mandatory fields of request not informed |
-3 | Invalid access key |
-4 | Error information according to the data type |
-5 | Error or rejection when carrying out the cancellation of delivery receipt. Verify the "codigo" and "descricao" fields for more information |