DC-e
Issue DC-e
Accepts a Declaração de Conteúdo Eletrônica (model 99) and authorizes it asynchronously with SEFAZ.
/openapi/v2/empresas/{empresaId}/dc-eRequires the token, timestamp and sign signature headers, see Authentication.
Acceptance returns HTTP 200 with no body. Resubmitting the same id: an identical message fingerprint reuses the original task (idempotent), a different fingerprint returns 10019030, and a previous terminal failure reopens the task with the new message. Results are obtained through the query or the dce.authorized / dce.rejected webhooks (see DC-e). The company must be approved with a usable certificate and emissaoDCe configured; ambiente must match the company's current environment (note the field name is ambiente, not NF-e's ambienteEmissao). Enum strings are case-insensitive.
Parameters
Path parameters
empresaIdstringrequiredIdentifier returned by Register company.
Example:1934811222334455
Request body
idstringrequiredIntegrator document id (≤64), used as the
dceIdpath variable in query / cancellation; idempotency key.Example:DCe-000012333ambientestringrequiredProducao/Homologacao, must match the company's environment (note the field name isambiente, not NF-e'sambienteEmissao). A mismatch returnsDCe00004.dataEmissaostringoptionalIssue time in ISO-8601; defaults to the acceptance time. With an offset or
Z(2026-09-08T10:00:00-03:00) it is converted as given; a local time without offset (2026-09-08T10:00:00) is interpreted in the company's state time zone. Allowed window: at most 5 minutes ahead of now and at most 30 days back (server-configurable); outside it the request fails with10019048(SEFAZ rejects a futuredhEmiand the number would be wasted; a far-past date drags the chave AAMM into an old period). Written to XMLdhEmiwith the company's state offset.Example:2026-09-06T12:00:00Zremetenteobjectrequired for Marketplace / Carrier companiesSender (
DCe00005when missing for a Marketplace / Carrier company); anOwnIssuercompany may omit it (the company itself); when sent,cpfCnpjmust equal the company's CNPJ.destinatarioobjectrequiredRecipient;
cpfCnpjrequired (DCe00009).itensarrayrequiredDeclared goods, 1-999 items.
transporteobjectrequiredTransport data.
autorizacaoDownloadXmlarrayoptionalCPF / CNPJ authorized to download the XML, up to 10 (
10019022). Do not include the issuer's own CNPJ (already authorized by default; the authorizer replies "CNPJ do Marketplace ja autorizado para download") and do not repeat a document: both are rejected at acceptance.informacoesAdicionaisstringoptionalMarketplace additional information (≤5000) →
infAdic/infAdMarketplace.informacoesAdicionaisFiscostringoptionalAdditional information for the tax authority (≤2000) →
infAdic/infAdFisco.informacoesAdicionaisEmitentestringoptionalIssuer complementary information (≤5000) →
infAdic/infCpl.observacoesMarketplacearrayoptionalUp to 10 remarks →
infAdic/obsMarketplace(xCampoattribute +xTexto).
Responses
Accepted; no response body. The document enters Pendente and is numbered and sent to SEFAZ asynchronously. Follow up through the query or the webhook.
No response body
Errors
| Code | HTTP | |
|---|---|---|
| 10003000 | 404 |
|
| DCe00004 | 400 | Company not configured for DC-e (missing |
| DCe00005 | 400 | Marketplace / Carrier company without |
| DCe00006 | 400 |
|
| DCe00007 | 400 | Brazilian sender without |
| DCe00008 | 400 | Company cannot issue (not approved / certificate not ready). Wait for approval / link the certificate. |
| DCe00009 | 400 | Brazilian recipient without |
| GW001 | 400 | Municipality IBGE code not found or inconsistent with |
| 10019005 | 400 | Concurrent duplicate request. Retry later. |
| 10019006 | 400 | Too many pending tasks for the CNPJ. Retry later. |
| 10019007 | 400 | Number series unresolved (several enabled series). Ask operations to consolidate the series. |
| 10019013 | 400 | Issuer type |
| 10019018 | 400 | Invalid item (NCM length, quantity ≤ 0, negative unit price). Fix per |
| 10019019 | 400 | Invalid enum or format ( |
| 10019020 | 400 | Invalid carrier CNPJ. Fix |
| 10019021 | 400 | Additional information too long. Shorten the text. |
| 10019022 | 400 | Invalid |
| 10019030 | 400 | Same |
| 10019031 | 400 | Production: an active / authorized document already exists for the |
| 10019048 | 400 |
|
| 10001001 | 400 | Request field validation failed (one entry per field). Fix per |
Computed values and sanitization
vProd = quantidade × valorUnitario (HALF_UP, 2 decimals) and vDC = Σ vProd are computed by the platform and written to the XML. Text fields are sanitized (accents stripped, control characters replaced by spaces, whitespace collapsed) before length validation.
Acceptance-side validation
Checks performed at acceptance (no numbering, no SEFAZ call, direct 400): company issuable with a usable certificate and DC-e configured; ambiente matches the company; document lengths and check digits; municipality IBGE code consistent with the UF; 8-digit cep; non-empty itens with valid quantity / unit price / NCM; list size limits; text length.
SEFAZ rejections during issuance are not HTTP errors: they surface as query status Negada and the dce.rejected webhook. The full state machine is in DC-e.
