DC-e
Query DC-e
Returns status, protocol, XML / DACE download links and the echo of the issuance request.
/openapi/v2/empresas/{empresaId}/dc-e/{dceId}token, timestamp and sign signature headers, see Authentication.Queries the document by the id sent at issuance. The echo section (remetente … observacoesMarketplace) comes from the normalized request snapshot taken at acceptance and stays available after the task reaches a terminal state. Download links look like {public base}/openapi/files/{kind}/{ref}?token=… (kind is xml or dace); the token carries the credential so no signature headers are needed, the lifetime comes from the tenant-level setting (default 7 days), and links are re-signed on every query. See File download.
Path parameters
empresaId* | string | Issuing company identifier |
dceId* | string | Document identifier |
* Required field
numero, chaveAcesso, protocolo, links) are filled in as the status advances.id | string | Request identifier |
ambiente | string | Environment |
status | string | Document status |
motivoStatus | string | Status reason |
dataCriacao | string | Acceptance time |
dataUltimaAlteracao | string | Last change |
numero | int | Document number |
serie | string | Series |
dataEmissao | string | Issue time |
chaveAcesso | string | Access key |
dataAutorizacao | string | Authorization time |
linkDace | string | DACE link |
linkDownloadXml | string | XML link |
| object | Authorization protocol |
emitidaEmContingencia | bool | Issued in contingency |
remetente | object | Sender |
destinatario | object | Recipient |
itens | array | Declared items |
transporte | object | Transport |
autorizacaoDownloadXml | array | XML download authorizations |
informacoesAdicionais | string | Marketplace remark |
informacoesAdicionaisFisco | string | Tax authority remark |
informacoesAdicionaisEmitente | string | Issuer remark |
observacoesMarketplace | array | Marketplace custom entries |
ambienteIssue environment
| Values | Meaning |
|---|---|
| Homologacao | SEFAZ test environment; the document has no legal effect |
| Producao | Official environment |
statusDocument status
The webhook also has CancelamentoNegado: SEFAZ rejected the cancellation and the document went back to Autorizada; the query returns Autorizada with the reason in motivoStatus, and a corrected cancellation may be sent again.
| Values | Meaning |
|---|---|
| Pendente | Accepted, queued or being sent; numero and chaveAcesso appear once numbered |
| Autorizada | Authorized by SEFAZ; linkDownloadXml, linkDace and protocolo available; if the last cancellation was rejected, motivoStatus carries the reason |
| Negada | Rejected by SEFAZ; motivoStatus is the rejection code and description |
| CancelamentoPendente | Cancellation accepted, waiting for the SEFAZ verdict |
| Cancelada | Cancelled; linkDace points to the version with the CANCELADA watermark |
| Falha | Terminal task failure (unparseable parameters, retries exhausted); motivoStatus explains; the same id may be resubmitted |
| Code | HTTP | |
|---|---|---|
| 10019002 | 404 | dceId not found or not owned by the company. Check the id and empresaId. |
| 10019003 | 404 | dceId not found or not owned by the company. Check the id and empresaId. |
| 10003000 | 404 | empresaId not found. |
