TF Fiscal
Documentation

DC-e

Query DC-e

Returns status, protocol, XML / DACE download links and the echo of the issuance request.

GET/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 (remetenteobservacoesMarketplace) 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

  • empresaIdstringrequired

    Identifier returned by Register company.

    Example: 1934811222334455
  • dceIdstringrequired

    The id sent at issuance.

    Example: DCe-000012333

Responses

200

Document found. Document fact fields (numero, chaveAcesso, protocolo, links) are filled in as the status advances.

  • idstring

    Integrator document id.

  • ambientestring

    Producao / Homologacao, as sent at issuance.

    Values:ProducaoHomologacao
  • statusstring

    Document status; see the status table below.

    Values:PendenteAutorizadaNegadaCancelamentoPendenteCanceladaFalha
  • motivoStatusstring

    Status reason: cStat - xMotivo for Negada, the failure reason for Falha, the latest cancellation rejection reason for Autorizada; otherwise null.

  • dataCriacaostring

    Acceptance time (ISO-8601, UTC).

  • dataUltimaAlteracaostring

    Last status change (ISO-8601, UTC).

  • numerointeger

    DC-e number (nDC); present once numbered.

  • seriestring

    DC-e series.

  • dataEmissaostring

    Issue time (ISO-8601).

  • chaveAcessostring

    44-digit access key; present once numbered. Positions 7-20 always carry the platform company CNPJ.

  • dataAutorizacaostring

    SEFAZ authorization time (ISO-8601).

  • linkDacestring

    DACE 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 CANCELADA watermark.

  • linkDownloadXmlstring

    Link of the dceProc XML (legal original).

  • protocoloobject

    Authorization protocol.

  • emitidaEmContingenciaboolean

    Always false in phase one.

  • remetenteobject

    Echo of the sender sent at issuance (same shape as Issue DC-e).

  • destinatarioobject

    Echo 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.

  • itensarray

    Echo of the declared goods.

  • transporteobject

    Echo of the transport data.

  • autorizacaoDownloadXmlarray

    Echo of the documents authorized to download the XML.

  • informacoesAdicionaisstring

    Echo of the marketplace additional information.

  • informacoesAdicionaisFiscostring

    Echo of the additional information for the tax authority.

  • informacoesAdicionaisEmitentestring

    Echo of the issuer complementary information.

  • observacoesMarketplacearray

    Echo of the marketplace remarks.

Errors

CodeHTTP
DCe0001404

dceId not found or not owned by the company. Check the id and empresaId.

10003000404

empresaId not found.

`status` values

statusMeaning
PendenteAccepted, queued or being sent (numero / chaveAcesso appear once numbered)
AutorizadaAuthorized 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
NegadaRejected by SEFAZ; motivoStatus is cStat - xMotivo
CancelamentoPendenteCancellation accepted, waiting for the SEFAZ verdict
CanceladaCancelled (110111); linkDace points to the re-rendered version with the CANCELADA watermark
CancelamentoNegadoWebhook 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
FalhaTerminal task failure (unparseable parameters, retry budget exhausted, ...); motivoStatus explains; the same id may be resubmitted