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}Requires the 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.
Parameters
Path parameters
empresaIdstringrequiredIdentifier returned by Register company.
Example:1934811222334455dceIdstringrequiredThe
idsent at issuance.Example:DCe-000012333
Responses
Document found. Document fact fields (numero, chaveAcesso, protocolo, links) are filled in as the status advances.
idstringIntegrator document id.
ambientestringProducao/Homologacao, as sent at issuance.Values:ProducaoHomologacaostatusstringDocument status; see the status table below.
Values:PendenteAutorizadaNegadaCancelamentoPendenteCanceladaFalhamotivoStatusstringStatus reason:
cStat - xMotivoforNegada, the failure reason forFalha, the latest cancellation rejection reason forAutorizada; otherwisenull.dataCriacaostringAcceptance time (ISO-8601, UTC).
dataUltimaAlteracaostringLast status change (ISO-8601, UTC).
numerointegerDC-e number (nDC); present once numbered.
seriestringDC-e series.
dataEmissaostringIssue time (ISO-8601).
chaveAcessostring44-digit access key; present once numbered. Positions 7-20 always carry the platform company CNPJ.
dataAutorizacaostringSEFAZ authorization time (ISO-8601).
linkDacestringDACE PDF link, lazily rendered by chave (the link exists before the file; the first download renders and archives it; while the rendering service is unavailable the download returns 503, retry later). After cancellation it points to the re-rendered version with the
CANCELADAwatermark.linkDownloadXmlstringLink of the
dceProcXML (legal original).protocoloobjectAuthorization protocol.
emitidaEmContingenciabooleanAlways
falsein phase one.remetenteobjectEcho of the sender sent at issuance (same shape as Issue DC-e).
destinatarioobjectEcho of the recipient (same shape as issuance). In the certification environment the echo keeps the original name although the XML and DACE carry the fixed text.
itensarrayEcho of the declared goods.
transporteobjectEcho of the transport data.
autorizacaoDownloadXmlarrayEcho of the documents authorized to download the XML.
informacoesAdicionaisstringEcho of the marketplace additional information.
informacoesAdicionaisFiscostringEcho of the additional information for the tax authority.
informacoesAdicionaisEmitentestringEcho of the issuer complementary information.
observacoesMarketplacearrayEcho of the marketplace remarks.
Errors
| Code | HTTP | |
|---|---|---|
| DCe0001 | 404 |
|
| 10003000 | 404 |
|
`status` values
status | Meaning |
|---|---|
Pendente | Accepted, queued or being sent (numero / chaveAcesso appear once numbered) |
Autorizada | Authorized by SEFAZ (cStat 100); linkDownloadXml is the dceProc legal original, linkDace the DACE PDF lazily rendered by chave, protocolo carries the protocol number and digest. If the latest cancellation was rejected by SEFAZ, motivoStatus carries that rejection as cStat - xMotivo (same value as dceMotivoStatus in the dce.cancel_rejected webhook); otherwise it is null |
Negada | Rejected by SEFAZ; motivoStatus is cStat - xMotivo |
CancelamentoPendente | Cancellation accepted, waiting for the SEFAZ verdict |
Cancelada | Cancelled (110111); linkDace points to the re-rendered version with the CANCELADA watermark |
CancelamentoNegado | Webhook only: SEFAZ rejected the cancellation and the document is back to Autorizada; the query API reports Autorizada with the rejection reason in motivoStatus; a corrected DELETE may be sent again |
Falha | Terminal task failure (unparseable parameters, retry budget exhausted, ...); motivoStatus explains; the same id may be resubmitted |
