Issues a DC-e from the submitted body. The client sends only the business data; the technical access-key identification fields are calculated by the server (see the note below the ide table). Credit is debited only in production (tpAmb=1) and when the DC-e is authorized.
Required headers
| Header | Type | Description |
| token | string | Token of the issuing company |
| sign | string | MD5 signature: MD5(token + path + body + timestamp) |
| timestamp | string | Unix timestamp in seconds (5-minute window) |
Body — root
| Field | Type | Description |
| ide * | object | DC-e identification |
| emit * | object | Issuer/sender data (CNPJ; or CPF via Marketplace — see below) |
| dest * | object | Recipient data |
| det * | array | Declared items/goods — minimum 1 |
| total * | object | Declaration totalizer |
| transp | object | Transport data |
| marketplace | object | Marketplace data (only when ide.tpEmit=1) |
| fisco | object | Tax authority body data (only when ide.tpEmit=0) |
| autXML | array | CNPJs/CPFs authorized to access the XML |
| infAdic | object | Additional information |
Required fields in the request: ide.tpAmb; emit.CNPJ (14 digits) or emit.CPF (11 digits, individual sender via Marketplace — see the note under emit), emit.xNome and emit.enderEmit (xLgr, nro, xBairro, cMun, xMun, CEP with 8 digits, UF); dest with CNPJ or CPF, dest.xNome and dest.enderDest (same address fields); at least 1 item in det with xProd, NCM (2 or 8 digits), qCom > 0 and vProd > 0; and total.vDC > 0. All other fields are optional.
ide — Identification
| Field | Type | Description |
| tpAmb * | int | Environment: 1=production, 2=staging. The only truly required field of ide. |
| tpEmit | int | Issuer type: 0=Tax Authority Application, 1=Marketplace, 2=Own issuer. Optional — default: 2 |
| cUF | int | IBGE code of the issuer's UF (2 digits). Optional — derived from emit.enderEmit.UF when omitted. If sent, it must be consistent with that UF (tax authority rejects with cStat=220 in case of divergence) |
| serie | int | Fiscal document series (3 digits of the access key) — identifies the DC-e numbering set. Optional — default: DC-e series registered for the company |
| nDC | long | Sequential DC-e number (part of the access key). Optional — auto-incremented by the server when omitted or 0 |
| nSiteAutoriz | int | Identification of the authorizer site that processed the DC-e (1 digit of the access key). Usually 0 (primary site). Optional — default: 0 |
| tpEmis | int | Issuance method: 1=Normal, 9=Contingency. Optional — default: 1 |
Filled in automatically by the server — you do not need to send them: mod (fixed at 99) and cDV (key check digit) are always set by the server; cDC (6-digit numeric code), dhEmi (issuance date/time) and verProc (process version) are generated when omitted. The serie, nDC and cUF fields in the table above are also filled in automatically when omitted.
emit — Issuer / Sender
| Field | Type | Description |
| CNPJ ⚠ | string | Issuer's CNPJ (14 digits). Filled in with the CNPJ of the token's company when omitted |
| CPF ⚠ | string | CPF of the individual sender (11 digits). Only allowed for issuance via Marketplace — see note below |
| xNome * | string | Issuer's/sender's name or company name |
| enderEmit * | object | Issuer's address (see structure below) |
Individual sender (CPF): by the tax authority rules, a CPF cannot be its own issuer (tpEmit=2 requires a CNPJ). To issue with a CPF as the sender, just send emit.CPF (without emit.CNPJ): the server automatically sets tpEmit=1 (Marketplace), uses your company's CNPJ (from the token) as the authorized issuer in the access key, and fills the marketplace block with the company's data. The CPF you provide appears as the sender in emit.
dest — Recipient
| Field | Type | Description |
| CNPJ ⚠ | string | Recipient's CNPJ (14 digits) |
| CPF ⚠ | string | Recipient's CPF (11 digits) |
| xNome * | string | Recipient's name or company name |
| enderDest * | object | Recipient's address (see structure below) |
enderEmit / enderDest — Address
| Field | Type | Description |
| xLgr * | string | Street |
| nro * | string | Number |
| xCpl | string | Complement |
| xBairro * | string | Neighborhood |
| cMun * | long | IBGE municipality code (7 digits) |
| xMun * | string | Municipality name |
| CEP * | string | Postal code (8 digits) |
| UF * | string | State abbreviation (2 letters) |
| cPais | int | Country code. Default: 1058 (Brazil) |
| xPais | string | Country name. Default: BRASIL |
| fone | string | Phone |
| email | string | E-mail |
det[] — Declared items
| Field | Type | Description |
| nItem | int | Sequential item number |
| xProd * | string | Description of the declared good/merchandise |
| NCM * | string | NCM code (2 or 8 digits) |
| qCom * | decimal | Quantity (> 0) |
| vUnCom | decimal | Unit value |
| vProd * | decimal | Total item value (> 0) |
| infAdProd | string | Additional item information |
total — Totalizer
| Field | Type | Description |
| vDC * | decimal | Total declared value (> 0) |
transp — Transport
| Field | Type | Description |
| modTrans | int | Transport mode: 0=Postal service, 1=own, 2=carrier. Default: 2 |
| CNPJTransp | string | Carrier's CNPJ |
marketplace — Marketplace (only tpEmit=1)
| Field | Type | Description |
| CNPJ | string | Marketplace's CNPJ |
| xNome | string | Marketplace name |
| Site | string | Marketplace website |
fisco — Tax authority body (only tpEmit=0)
| Field | Type | Description |
| CNPJ | string | Body's CNPJ |
| xOrgao | string | Body name |
| UF | string | Body's UF |
autXML[] — Authorized for XML
| Field | Type | Description |
| CNPJ | string | CNPJ authorized to consult/download the XML |
| CPF | string | CPF authorized to consult/download the XML |
infAdic — Additional information
| Field | Type | Description |
| infAdFisco | string | Information of interest to the tax authority |
| infCpl | string | Supplementary information of interest to the taxpayer |
| infAdMarketPlace | string | Additional marketplace information |
* Required field. ⚠ In the issuer and in the recipient, at least one of CNPJ or CPF is required.