CT-e
Query CT-e
Returns status, document data, XML / DACTE download links and the event list.
GET
/openapi/v2/empresas/{empresaId}/cte/{cteId}Requires the
token, timestamp and sign signature headers, see Authentication.This is how you follow what happened to the document after it was submitted. Queries by the id sent at issuance. Download links are short-lived tokens, valid for 10 minutes and re-issued on every query.
Path parameters
empresaId* | string | Company identifier |
cteId* | string | Document identifier |
* Required field
200
Document found.
id | string | Document identifier |
status | string | Document status |
motivoStatus | string | Status reason |
numero | int | Document number |
serie | int | Series |
chaveAcesso | string | Access key |
numeroProtocolo | string | Authorization protocol |
dataEmissao | string | Issuance time |
dataAutorizacao | string | Authorization time |
tipoEmissao | string | Issuance path |
protocoloEpec | string | EPEC protocol |
linkXml | string | Authorized XML link |
linkDacte | string | DACTE link |
cte | object | Request echo |
| array | Registered events |
statusDocument status
| Values | Meaning |
|---|---|
| Pendente | Accepted, queued or being sent |
| Autorizada | Authorized by SEFAZ; linkXml is the legal original and linkDacte the DACTE PDF |
| Negada | Rejected by SEFAZ; motivoStatus carries the code and reason |
| Cancelada | Cancelled by event 110111 |
| Contingencia | SEFAZ unavailable; document pending resubmission |
| Falha | Terminal task failure; motivoStatus explains and the same id may be resubmitted |
tipoEmissaoIssuance path
The platform switches path on its own when the state authorizer is down.
| Values | Meaning |
|---|---|
| Normal | Authorizer of the state itself |
| Epec | EPEC contingency: prior event authorization |
| Fsda | FS-DA contingency: security form |
| SvcRs | SVC-RS contingency: virtual authorizer of Rio Grande do Sul |
| SvcSp | SVC-SP contingency: virtual authorizer of São Paulo |
eventos[].tipoEvent type
| Values | Meaning |
|---|---|
| Cancelamento | CT-e cancellation; code 110111 |
| CartaCorrecao | Correction letter; code 110110 |
| Epec | EPEC contingency prior authorization, registered by the platform; code 110113 |
| ComprovanteEntrega | Delivery receipt; code 110180 |
| CancelamentoComprovanteEntrega | Delivery receipt cancellation; code 110181 |
| InsucessoEntrega | Delivery failure; code 110190 |
| CancelamentoInsucessoEntrega | Delivery failure cancellation; code 110191 |
| PrestacaoDesacordo | Service disagreement; code 610110 |
| CancelamentoPrestacaoDesacordo | Service disagreement cancellation; code 610111 |
eventos[].codigoEvent code
| Values | Meaning |
|---|---|
| 110111 | CT-e cancellation (Cancelamento) |
| 110110 | Correction letter (CartaCorrecao) |
| 110113 | EPEC contingency prior authorization, registered by the platform (Epec) |
| 110180 | Delivery receipt (ComprovanteEntrega) |
| 110181 | Delivery receipt cancellation (CancelamentoComprovanteEntrega) |
| 110190 | Delivery failure (InsucessoEntrega) |
| 110191 | Delivery failure cancellation (CancelamentoInsucessoEntrega) |
| 610110 | Service disagreement (PrestacaoDesacordo) |
| 610111 | Service disagreement cancellation (CancelamentoPrestacaoDesacordo) |
eventos[].statusRegistration return code
The platform only returns 200 with one of these codes; any other SEFAZ return becomes 10017043.
| Values | Meaning |
|---|---|
| 134 | Event registered; SEFAZ treats it as success |
| 135 | Event registered and linked to the CT-e |
| 136 | Event registered but not linked to the CT-e |
| Code | HTTP | |
|---|---|---|
| 10017003 | 404 | cteId not found or not owned by the company. Check the id and the empresaId. |
| 10003000 | 404 | empresaId not found. |
