webmania®
  • Contact

Region and language

Brazil

  • PTPortuguês (Brasil)
  • ENEnglish
  • ESEspañol
Sign in Book a demo
Solutions
Fiscal IssuerFiscal MonitorTax ReconciliationArtificial Intelligence

Document guide

NF‑e (electronic invoice)NFS‑e (service invoice)CT‑e and CT‑e OS (freight bills)NFC‑e (consumer receipt)DC‑e (content declaration)MDF‑e (cargo manifest)NFCom (telecom invoice)CIOT (road freight code)Tax payment slips

Tax intelligence and security

ByPass®Webmania® TaxesTax reformSecurityWebmania® Trust Center
Brazil tax guide

Start here

Brazil tax guideComplete guide

Popular chapters

NF‑e · Electronic invoiceNFS‑e · Service invoiceCT‑e · Freight billTax reformGlossary
Industries
Technology & SaaSRetail & CommerceLogistics & TransportationEnterprise

By company size

Mid-sized Companies

Other industries

ManufacturingBanks & FintechsServices & Subscriptions
Developers
See all documentation →

Tax & Invoicing

Goods invoice (NF‑e)Service invoice (NFS‑e)Telecom invoice (NFCom)Fiscal Monitor

Logistics & Transport

Freight bill (CT‑e)Cargo manifest (MDF‑e)Content declaration (DC‑e)CIOT / PEF (ANTT)

Payments & Management

GNREDARE‑ICMS SPDUA‑ESB2B Management

Resources

Docs for LLMs (llms.txt)Webmania® Status (in Portuguese)SEFAZ Monitor (in Portuguese)City Hall Monitor (in Portuguese)
Company

Webmania

About WebmaniaCustomers
ContactPortuguês (Brasil)
Sign in →Book a demo
Fiscal IssuerIssue NF‑e, NFS‑e, CT‑e and other documents from the panel or the API→Fiscal MonitorReceive the invoices issued to your CNPJs, straight from SEFAZ and city halls→Tax ReconciliationCheck the new CBS tax against the Federal Revenue before you pay→Artificial IntelligenceUnderstand rejections, set up taxes and update records with AI→

Document guide

NF‑eElectronic invoiceNFS‑eService invoiceCT‑e and CT‑e OSFreight billNFC‑eConsumer receiptDC‑eElectronic content declarationMDF‑eCargo manifestNFComTelecom invoice

Document guide

CIOTRoad freight registration codeTax payment slipsGNRE, DARE‑ICMS SP and DUA‑ES from the NF‑e

Tax intelligence and security

ByPass®ERP values without recalculationWebmania® TaxesSet up your Tax ClassesTax reformIBS, CBS and the Selective TaxSecurityCertificate, data and Trust CenterWebmania® Trust CenterSecurity, privacy and subprocessors

Not sure where to start?

Book a demo →

Tax & Invoicing

Goods invoiceNF‑e, NFC‑e, CC‑e and MDeService invoiceNFS‑eTelecom invoiceNFComFiscal MonitorXML download

Logistics & Transport

Freight billCT‑e and CT‑e OSCargo manifestMDF‑eContent declarationDC‑eCIOT / PEF (ANTT)Freight payment

Payments & Management

GNREState tax payment slipDARE‑ICMS SPSão Paulo state ICMSDUA‑ESEspírito Santo payment slipB2B ManagementManage your companies
Ready for LLMs and SDKsAI-ready documentation, with official SDKsllms.txt# Webmania® documentation- NF‑e - NFS‑e Open llms.txt

Live status (in Portuguese): Webmania® Status · SEFAZ Monitor · City Hall Monitor

See all documentation →
Technology & SaaSThe tax layer of your software, through REST APIs.Learn more →Technology team
Retail & CommerceNFC‑e and NF‑e at the checkout and online, by API.Learn more →Retail operation
Logistics & TransportationCT‑e and MDF‑e built into your transportation system.Learn more →Logistics operation
EnterpriseHigh volumes, with VIP Support and governance.Learn more →Enterprise operation

By company size

Mid-sized CompaniesOperations that are scaling up

Other industries

ManufacturingNF‑e at the volume of your operationBanks & FintechsNFS‑e for fees and servicesServices & SubscriptionsNFS‑e at large scale

Not sure where to start?

Book a demo →

Webmania

About WebmaniaThe tax infrastructure and intelligence behind 100,000+ active company IDs (CNPJs).Meet Webmania →CustomersHow companies in different industries issue and monitor their tax documents.See our customers →ContactQuestions about operating in Brazil? Our team replies in your language.Talk to our team →

In numbers

15 million+tax documents per month
1.2 billion+API requests per year
100,000+active company IDs (CNPJs)
99.95%availability

Not sure where to start?

Book a demo →

Start here

Brazil tax guideNew to Brazil? The invoices, taxes and approvals of a sale, explained on one page.Start reading →

Go deeper

Complete guideEvery tax document in detail: when you need it, how to issue, cancel and correct it.Open the complete guide →

Goods and services

NF‑eElectronic invoiceNFC‑eConsumer receiptNFS‑eService invoiceNFComTelecom invoice

Transport

CT‑eFreight billMDF‑eCargo manifestCIOTRoad freight codeDC‑eContent declaration

Taxes and reform

Tax payment slipsGNRE, DARE and DUATax reformCBS and IBS, 2026–2033Tax ClassTax rules, set onceGlossaryTax terms, explained

Not sure which documents your operation needs?

Book a demo →
  • DC-e REST API
  • Quick guide
    • DC-e lifecycle
  • SDKs & LLMs
    • LLM-ready
    • Webmania SDKs
    • Examples
  • Authentication
  • Response format
  • Notifications
    • Notification fields
    • Notification example
  • Issuing a DC-e
    • Batch issuing by CSV
    • General information
    • Issuer
    • Customer
    • Items
    • Transport
    • Additional information
  • Functions
    • Download XML and PDF
      • Access credentials
      • Token
    • Look up a DC-e
    • Cancel a DC-e
  • Contingency mode
  • Infrastructure
  • Request limits
  • Changelog
⚡ Follow in real time (in Portuguese): Status | SEFAZ Monitor | City Hall Monitor

Last updated: November 17, 2026 · v2.0.2

Region and language

Brazil

  • PTPortuguês (Brasil)
  • ENEnglish
  • ESEspañol
View Markdown index (in Portuguese)
View Markdown indexLists the sections with links (in Portuguese)Open in ChatGPTReads the index and fetches only the sections it needsOpen in ClaudeReads the index and fetches only the sections it needs

Electronic Content Declaration (DC-e) REST API

Documentation for issuing the electronic content declaration (DC-e)

DC-e for shipments without an invoice DC-e for shipments without an invoice

The Webmania® REST API issues the DC-e at SEFAZ, the state tax authority. It creates the XML file and the DACE (the printed summary of the DC-e) that travels with the goods. It sends you the result by notification, and it lets you look up and cancel each declaration. To start, read the Quick guide. To issue other document types, see all the APIs.

What is the DC-e? The electronic content declaration (Declaração de Conteúdo Eletrônica) replaces the paper content declaration. It goes with goods in transport when the sender is not required to issue a tax document, such as an NF-e (electronic invoice) or an NFC-e (consumer receipt). When an invoice is required, the DC-e does not replace it:

Who sends it

Individuals or companies that do not pay ICMS (the state sales tax). The sender's data goes in the emitente object, and the receiver's data goes in cliente.

What travels with the goods

After SEFAZ authorizes the declaration, Webmania creates the DACE (Declaração Auxiliar de Conteúdo Eletrônica), the printed summary of the DC-e. It must travel with the goods during transport.

Brazilian tax terms you will see. They keep their Brazilian names in the payload and on the DC-e:
SEFAZ: the state tax authority. It authorizes each DC-e and answers with a status code; 100 = authorized.
ICMS: the state sales tax on goods. The DC-e is for senders that do not pay it, such as individuals.
NCM: the 8-digit product classification code of Mercosur. Field ncm of each item in itens.
CNPJ / CPF: the company ID (14 digits) and the individual taxpayer ID (11 digits) of the issuer and of the customer.
Every term in plain English: glossary of Brazilian tax terms.

Availability and security
High availability, scalable and redundant servers at the highest PCI DSS security level, on Amazon Web Services, the global cloud computing leader.
Storage
Secure, encrypted and unlimited storage of your tax documents on Amazon S3.
REST API integration
Works with every programming language through JSON, with low latency on a global infrastructure.
Automatic numbering
Issue DC-e through the API and the Webmania® Panel at the same time. Numbering is managed automatically.
DACE and email delivery
The DACE is created automatically, prints on common printers and is sent securely by email.
Expert support
Expert help with tax integration and programming.

Quick guide

Send every API request over encrypted HTTPS to the URL https://api.webmania.com.br. The /2/ prefix means that you are using version 2.0 of the API.

URL HTTP Verb Function
/2/dce/emissao POST Issue a DC-e
/2/dce/emissao/csv POST Batch issuing by CSV
/2/dce/consulta/{identifier} GET Look up a DC-e by UUID (36 characters) or by access key (44 characters)
/2/dce/cancelar PUT Cancel a DC-e

Responses are in JSON. Send Authorization: Bearer YOUR_ACCESS_TOKEN in every call, and Content-Type: application/json in calls that have a body. See Authentication.

How to integrate the DC-e:

  1. Get the Access Token Copy the company's Access Token in the Webmania® Panel and send it in the Authorization header.
  2. Issue the DC-e Send a POST to /2/dce/emissao, with ambiente = 2 (sandbox) for tests. The response returns the uuid of the DC-e. Store it in your system.
  3. Receive the result Webmania notifies your url_notificacao when the DC-e is authorized, rejected or canceled.
  4. Deliver the DACE When the DC-e is authorized, download the XML and the DACE. The DACE travels with the goods during transport.
  5. Look up the DC-eif needed Use the UUID or the access key to check the status at any time.
  6. Cancel the DC-eif needed If the shipment does not happen, cancel the authorized DC-e with a reason.

Quick guide
DC-e lifecycle

Every DC-e gets a uuid as soon as the API accepts the request. From then on, it goes through the statuses below. They appear in the response, in the lookup and in the notifications:

DC-e lifecycle The DC-e starts in processando while SEFAZ reviews the declaration. If SEFAZ is offline, the DC-e stays in contingencia and Webmania resends it automatically. Before resending, Webmania checks with SEFAZ so the same DC-e is not issued twice. The result is aprovado, with the XML and the DACE, or reprovado, with the reason. An authorized DC-e can be canceled with PUT /2/dce/cancelar and then becomes cancelado. POST /2/dce/emissao Processing processando waiting for SEFAZ Authorized aprovado XML and DACE available Rejected reprovado read the reason and fix it Contingency mode contingencia SEFAZ offline Canceled cancelado PUT /2/dce/cancelar SEFAZ down resend
After authorization Authorized Waiting for the result: not a final status Rejected Automatic retry
The processando and contingencia statuses are not notified and do not prove authorization. Follow the DC-e through the lookup, without issuing it again.
StatusWhat it meansWhat to do
processandoSEFAZ has not returned the result of the DC-e yet.Wait for the notification or look up the DC-e. Do not issue it again.
contingenciaSEFAZ is offline. Webmania resends the DC-e automatically when SEFAZ is back, after checking with SEFAZ first.Follow the same uuid, without issuing it again. See Contingency mode.
aprovadoSEFAZ authorized the DC-e. The XML and the DACE are available.Print the DACE so it travels with the goods. If the shipment does not happen, cancel it.
reprovadoSEFAZ rejected the DC-e. motivo has the response.Fix the data shown in motivo and issue a new DC-e.
canceladoSEFAZ accepted the cancellation.Do not use this DC-e for transport.

SDKs & LLMs

Take this reference to your AI assistant, integrate the API with an official SDK, or start from the ready-made modules and examples.

LLM-ready

Send an AI the section index of this reference: it reads the index and fetches only the sections it needs, in Markdown. The Markdown is in Portuguese; the assistant can answer in English.

  • Section index Start here Every section of this reference with its URL and size, so the AI reads only what it needs. View Markdown index
  • Page in Markdown The full reference in plain text, with the same tables and examples. View as Markdown
  • Open in ChatGPT Reads the index and fetches only the sections it needs. Open in ChatGPT
  • Open in Claude Reads the index and fetches only the sections it needs. Open in Claude
  • llms.txt Starting point for agents, with every public reference. Open llms.txt

Webmania SDKs

Official open-source SDKs on GitHub to integrate the Webmania APIs in the language of your project. Each repository includes installation, examples and the operations it covers.

  • Node.js / TypeScript Available

    Node.js >= 22 README

    git clone https://github.com/webmaniabr/webmania-node.git

  • Python Available

    Python >= 3.11 README

    git clone https://github.com/webmaniabr/webmania-python.git

  • PHP Available

    PHP >= 8.3 README

    git clone https://github.com/webmaniabr/webmania-php.git

  • Perl Available

    Perl 5.36 README

    git clone https://github.com/webmaniabr/webmania-perl.git

  • Go Available

    Go 1.26 README

    git clone https://github.com/webmaniabr/webmania-go.git

  • C Available

    C11, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-c.git

  • C++ Available

    C++, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-cpp.git

  • Lua Available

    Lua 5.4, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-lua.git

  • Dart Available

    Dart >= 3.8.3, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-dart.git

  • R Available

    R >= 4.6.2, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-r.git

  • Java Available

    Java 17+ README

    git clone https://github.com/webmaniabr/webmania-java.git

  • Kotlin Available

    Kotlin 2.4 / JVM 17+ README

    git clone https://github.com/webmaniabr/webmania-kotlin.git

  • Scala Available

    Scala 3.3 / JVM 17+ README

    git clone https://github.com/webmaniabr/webmania-scala.git

  • Clojure Available

    Clojure 1.12 / JVM 17+ README

    git clone https://github.com/webmaniabr/webmania-clojure.git

  • Ruby Available

    Ruby 3.3, Ruby 3.4 README

    git clone https://github.com/webmaniabr/webmania-ruby.git

  • .NET (C#) Available

    .NET 10 README

    git clone https://github.com/webmaniabr/webmania-dotnet.git

  • PowerShell Available

    PowerShell 7.6 README

    git clone https://github.com/webmaniabr/webmania-powershell.git

  • Elixir Available

    Elixir ~> 1.18, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-elixir.git

  • Rust Available

    Rust >= 1.85 README

    git clone https://github.com/webmaniabr/webmania-rust.git

  • Haskell Available

    GHC 9.6.7, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-haskell.git

  • Swift Available

    macOS 13+, iOS 16+ README

    git clone https://github.com/webmaniabr/webmania-swift.git

Examples

Test the DC-e REST API without writing a line of code, and speed up your integration with the official Webmania® tools.

  • Postman collection Instant tests Ready-made requests to test the API without writing code. Open in Postman
  • Video Test the REST API without a line of code (in Portuguese). Watch on YouTube

Authentication

To use the API, authenticate every request with an HTTP header. Use the Authorization header in this format:

Authorization: Bearer {Access-Token}

You find the Access-Token of API 2.0 in the Webmania® Panel. Include it in every request.

Keep your credentials safe. Never publish the Access Token in the source code of a website, app or system where third parties can easily read it.

For mobile apps (iOS and Android), we recommend that you call the API from your server (back end). The app only sends the request to your server, and your server does the processing.

Response format

The responses of issuing, lookup and cancellation are in JSON, without a data wrapper. Fields with a null value are left out. The XML and DACE download returns the file itself, as described in Download XML and PDF.

Code Meaning Success Description
200 OK
Response of issuing, lookup or cancellation (POST, GET and PUT). It is also the status of validation and business errors, which return error.
401 Unauthorized
Authentication failed. Check the access token you sent.
403 Forbidden
Access denied. You do not have permission for this operation.
404 Not Found
Route or resource not found. A lookup of a DC-e that does not exist can also return HTTP 200 with error.
429 Too Many Requests
Request limit exceeded. Wait the interval given in the Retry-After header, when it is present. See Request limits.

HTTP 200 does not confirm tax authorization. How to identify each result:

SituationHTTPBody
Missing or invalid field in the request200{"error": "…"}, without uuid
DC-e accepted, no result from SEFAZ yet200status equal to processando or contingencia
DC-e authorized200status equal to aprovado, with xml and dace
DC-e rejected by SEFAZ200status equal to reprovado, with the response in motivo

Example of an HTTP 200 response to a request with a validation error (the message says that the ambiente parameter is required):

{
  "error": "Parâmetro obrigatório: ambiente."
}

Notifications

To keep your platform up to date, Webmania® sends an automatic notification for each result of the DC-e. With them, you do not need a routine that polls the API. Wait for the webhook and update the DC-e in your system when it arrives.

The notification is sent by POST, in JSON, to the URL given in url_notificacao when you issue the DC-e. Without this parameter, it goes to the notification URL registered for the company.

Notified statusWhen it is sent
aprovadoSEFAZ authorized the DC-e. The body has the chave, the xml and the dace.
reprovadoSEFAZ rejected the DC-e. The body has the motivo (reason).
canceladoSEFAZ accepted the cancellation. The body has the xml_cancelamento.
When there is no notification. The processando and contingencia statuses are not notified. In these cases, do not issue the DC-e again. Wait for the next notification or check the result in the lookup.

What is the UUID? The UUID (Universally Unique Identifier) is a unique 36-character identifier, in the 8-4-4-4-12 format, that Webmania assigns to each DC-e.

It is created as soon as our API accepts the request, that is, after our validations and before anything is sent to SEFAZ. So the UUID exists whatever the status of the DC-e at SEFAZ, even when the DC-e is rejected or canceled.

Once created, the UUID is permanent. It does not change on retries, contingency mode or resending. The access key is a different field and can change. So use the UUID, not the access key, as your reference in your database.

Notifications
Notification fields

The notification body has the same format as the DC-e lookup:

Parameter Type Description
ID string Control ID you sent when issuing (when you sent one).
uuid string Unique identifier of the DC-e.
chave string Access key of the DC-e at SEFAZ.
serie number Series of the DC-e.
numero number Number of the DC-e.
status string Current status of the DC-e: aprovado, reprovado or cancelado. See the lifecycle.
motivo string Reason for the returned status.
modelo string Fixed value dce.
xml string URL of the authorized XML.
xml_cancelamento string URL of the cancellation XML (only when the status is cancelado).
dace string URL of the DACE.
log object or empty array Data of the operation (sending or cancellation). With named fields, it is an object. When empty, it is []. Its structure depends on the SEFAZ response.

Notifications
Notification example

The notification is sent with the POST method, in the application/json format:

-X POST \
-header "Content-type: application/json" \

Example of a notification for an authorized DC-e:

{
  "ID": "PED-123",
  "uuid": "00000000-0000-0000-0000-000000000000",
  "chave": "00000000000000000000000000000000000000000000",
  "serie": 1,
  "numero": 123,
  "status": "aprovado",
  "motivo": "Autorizado o uso do DC-e",
  "modelo": "dce",
  "xml": "https://api.webmania.com.br/xmldce/[chave]",
  "dace": "https://api.webmania.com.br/dace/[chave]",
  "log": {
    "cStat": 100,
    "xMotivo": "Autorizado o uso do DC-e"
  }
}

Issuing a DC-e

Issuing sends the declaration to SEFAZ. When SEFAZ authorizes it, Webmania creates the XML and the DACE, which travels with the goods during transport. One request issues one DC-e. To issue many at once, use batch issuing by CSV.

To issue a DC-e, send a POST request to the URL /2/dce/emissao, with a JSON body.

How to build the request:

  1. Fill in the general data The ambiente (2 for tests in the sandbox), the url_notificacao and, if you want, your own control ID.
  2. Identify the sender In the emitente object: one single ID (cnpj, cpf or identificacao_alternativa), the name and the address.
  3. Identify the receiver In the cliente object, with the same ID rule as the sender.
  4. List the goods In itens, from 1 to 999 items, with description, NCM (the Mercosur product classification code), quantity and unit value.
  5. Describe the transport In transporte.modalidade: Correios (Brazilian postal service), own transport or a carrier company.
  6. Add notesif needed Free text and structured notes of the document or of the sender.

Request example:

curl -X POST https://api.webmania.com.br/2/dce/emissao \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "ID": "PED-123",
  "ambiente": 2,
  "url_notificacao": "https://suaaplicacao.com.br/webhook/dce",
  "emitente": {
    "cnpj": "12345678000195",
    "razao_social": "EMPRESA EMISSORA LTDA",
    "logradouro": "Rua A",
    "numero": "100",
    "bairro": "Centro",
    "codigo_municipio": "4106902",
    "municipio": "Curitiba",
    "uf": "PR",
    "cep": "80000000"
  },
  "cliente": {
    "cnpj": "12345678000195",
    "razao_social": "CLIENTE LTDA",
    "logradouro": "Rua B",
    "numero": "200",
    "bairro": "Centro",
    "codigo_municipio": "3550308",
    "municipio": "São Paulo",
    "uf": "SP",
    "cep": "01001000"
  },
  "itens": [
    {
      "descricao": "Frete",
      "ncm": "99000000",
      "quantidade": 1,
      "valor_unitario": 100.00
    }
  ],
  "transporte": {
    "modalidade": "0"
  },
  "informacoes_adicionais": "Observações gerais"
}'

Example of an HTTP 200 response for an authorized DC-e. The fields are described in Notification fields. The content of log depends on the SEFAZ response:

{
  "ID": "PED-123",
  "uuid": "00000000-0000-0000-0000-000000000000",
  "chave": "00000000000000000000000000000000000000000000",
  "serie": 1,
  "numero": 123,
  "status": "aprovado",
  "motivo": "Autorizado o uso do DC-e",
  "modelo": "dce",
  "xml": "https://api.webmania.com.br/xmldce/[chave]",
  "dace": "https://api.webmania.com.br/dace/[chave]",
  "log": {
    "cStat": 100,
    "xMotivo": "Autorizado o uso do DC-e"
  }
}

If the response returns processando or contingencia, the DC-e has no final result yet. Wait for the notification, without issuing it again. The statuses are listed in DC-e lifecycle.

Issuing a DC-e
Batch issuing by CSV

Batch issuing takes a CSV file with up to 5,000 DC-e. It issues each line with the same rules as a single DC-e. Do not send dces: the API reads the list from the CSV.

To issue a batch, send a POST request to the URL /2/dce/emissao/csv, with the same Authorization header and a JSON body.

ParameterRequiredTypeDescription
ambienteYesnumber1 = Production; 2 = Sandbox. Applies to every line.
csvYesstringContent of the CSV file, encoded in valid Base64, with at least one valid document.
file_nameYesstringFile name. The API normalizes it to lowercase and replaces each run of non-alphanumeric characters (including the dot of the extension) with a hyphen.

The response describes the batch, not each DC-e:

FieldWhat it contains
uuidID of the import. It is not the UUID of a DC-e.
modeloFixed value dce_csv.
statusStatus of the batch.
qtd_rpsNumber of documents in the file.
processadoNumber already processed.
valor_totalSum of the documents, as text with two decimal places.

Processing is asynchronous: an accepted batch does not mean that the DC-e were authorized. Each DC-e issued follows the lifecycle of a single DC-e.

Issuing a DC-e
General information

Top-level fields of the issuing body. Fields with a link open the section of each object.

Parameter Required Type Size Description
ID
Optional
string up to 100 Control ID of your application, up to 100 characters. It is also accepted as id. The response and the notification use ID.
ambiente
Required
number 1 Issuing environment.
1 = Production
2 = Sandbox (homologação)
url_notificacao
Optional
url up to 500 URL that receives automatic status notifications.
origem
Optional
string - - - Source of the integration. Accepted values: api, webmaniabr, woocommerce, prestashop, opencart and magento.
solicitacao
Optional
JSON string up to 2000 String of valid JSON with the issuing request data of the Fisco (tax authority), up to 2,000 characters. It is optional and can be null.
Used only for companies set up as Fisco. For other issuer types, the field is ignored.
emitente
Required
object - - - Object with the issuer's data.
For companies set up with issuer type 2, the company's registered data fills the missing fields before validation. See the Issuer section for the other rules.
cliente
Required
object - - - Object with the data of the customer (recipient).
See the Customer section for the conditional rules.
itens
Required
array 1-n List of goods transported (from 1 to 999 items).
API validation limits the total of the items to R$ 100,000,000.00. This technical limit does not replace the rules of SEFAZ.
transporte
Required
object - - - Object with the transport data.
The modalidade field defines how the goods are transported.
informacoes_adicionais
Optional
string 1-5000 General additional information of the DC-e.
See also the note parameters in the Additional information section.

Issuing a DC-e
Issuer

The issuer is the individual or company that sends the goods to the recipient. Send its data in the emitente object.

To identify the issuer, send only one of these options: cnpj (CNPJ, the 14-digit company ID), cpf (CPF, the 11-digit individual taxpayer ID) or identificacao_alternativa. The name field depends on the type of ID:

  • CNPJ: send razao_social
  • CPF or alternative ID: send nome_completo
Parameter Required Type Size Description
cnpj
Conditionally required
string 14 CNPJ (company ID) of the issuer.
Send only one: cnpj, cpf or identificacao_alternativa.
cpf
Conditionally required
string 11 CPF (individual taxpayer ID) of the issuer, digits only.
Send only one: cnpj, cpf or identificacao_alternativa.
identificacao_alternativa
Conditionally required
string 2-20 ID for issuers without a CPF or CNPJ (foreigners, Indigenous people, quilombolas, members of traditional Afro-Brazilian communities).
razao_social
Required with CNPJ
string 2-60 Legal company name (company).
Required when cnpj is sent.
nome_completo
Required with CPF/alternative ID
string 2-60 Full name (individual).
Required when cpf or identificacao_alternativa is sent.
logradouro
Required, auto-filled from the CEP
string 2-60 Street of the address.
numero
Required
string 1-60 Street number of the address.
Send S/N when there is no number.
complemento
Optional
string 1-60 Address complement (suite, floor, unit).
bairro
Required, auto-filled from the CEP
string 2-60 Neighborhood of the address.
codigo_municipio
Required, auto-filled from the CEP
string 7 IBGE city code (7 digits).
municipio
Required, auto-filled from the CEP
string 2-60 City name.
uf
Required, auto-filled from the CEP
string 2 State abbreviation (for example SP, RJ, MG).
cep
Required
string 8 CEP (postal code) with 8 digits, without a mask.
telefone
Optional
string 7-12 Phone number with area code, digits only.

Auto-fill from the CEP: the API fills in logradouro, bairro, codigo_municipio, municipio and uf automatically when the cep you send is valid and can be found.

Example of a company issuer:

{
  "emitente": {
    "cnpj": "00000000000000",
    "razao_social": "Empresa Logistica Ltda",
    "logradouro": "Avenida Paulista",
    "numero": "1000",
    "bairro": "Bela Vista",
    "codigo_municipio": "3550308",
    "municipio": "Sao Paulo",
    "uf": "SP",
    "cep": "01310100",
    "telefone": "1130000000"
  }
}

Issuing a DC-e
Customer

The customer is the recipient of the goods. Send its data in the cliente object.

The ID rule is the same as for the issuer: send only one of the options (cnpj, cpf or identificacao_alternativa), with the matching name field.

Customer outside Brazil: send a codigo_pais other than 1058 and the country name in pais. The API then sets codigo_municipio = 9999999, cep = 99999999 and uf = EX automatically. For Brazil, EX and the city code 9999999 are rejected.

Parameter Required Type Size Description
cnpj
Conditionally required
string 14 CNPJ (company ID) of the customer.
Send only one: cnpj, cpf or identificacao_alternativa.
cpf
Conditionally required
string 11 CPF (individual taxpayer ID) of the customer, digits only.
Send only one: cnpj, cpf or identificacao_alternativa.
identificacao_alternativa
Conditionally required
string 2-20 ID for recipients without a CPF or CNPJ (foreigners, Indigenous people, quilombolas).
razao_social
Required with CNPJ
string 2-60 Legal company name (company).
Required when cnpj is sent.
nome_completo
Required with CPF/alternative ID
string 2-60 Full name (individual).
Required when cpf or identificacao_alternativa is sent.
email
Optional
email up to 80 Email of the recipient, to receive the document.
logradouro
Required, auto-filled from the CEP
string 2-60 Street of the address.
numero
Required
string 1-60 Street number of the address.
Send S/N when there is no number.
complemento
Optional
string 1-60 Address complement (suite, floor, unit).
bairro
Required, auto-filled from the CEP
string 2-60 Neighborhood of the address.
codigo_municipio
Required, auto-filled from the CEP
string 7 IBGE city code (7 digits).
municipio
Required, auto-filled from the CEP
string 2-60 City name.
uf
Required, auto-filled from the CEP
string 2 State abbreviation. For transactions with other countries, send EX.
cep
Required
string 8 CEP (postal code) with 8 digits, without a mask.
telefone
Optional
string 7-12 Phone number with area code, digits only.
codigo_pais
Optional, with an automatic default
string 1-4 Country code. Default: 1058 (Brazil).
pais
Optional, with an automatic default
string 2-60 Country name. Default: Brasil.

Auto-fill from the CEP: the API fills in logradouro, bairro, codigo_municipio, municipio and uf automatically when the cep you send is valid and can be found.

Example of a company customer:

{
  "cliente": {
    "cnpj": "00000000000000",
    "razao_social": "Empresa Comercial Ltda",
    "email": "fiscal@empresacomercial.com.br",
    "logradouro": "Rua da Bahia",
    "numero": "550",
    "bairro": "Centro",
    "codigo_municipio": "3106200",
    "municipio": "Belo Horizonte",
    "uf": "MG",
    "cep": "30160011",
    "telefone": "3130000000"
  }
}

Issuing a DC-e
Items

The items are the goods transported. Send them as an array in the itens parameter, with at least 1 and at most 999 items.

Parameter Required Type Size Description
descricao
Required
string 1-120 Description of the product or goods.
ncm
Required
string 2 or 8 NCM code (Nomenclatura Comum do Mercosul), the product code based on the international HS code.
Send the 2-digit chapter or the full 8-digit code, digits only.
quantidade
Required
number 11v4 Item quantity, from 0 to 99999999999.9999, with up to 4 decimal places.
valor_unitario
Required
number 13v8 Unit value of the item, from 0 to 9999999999999.99999999, with up to 8 decimal places.
informacoes_adicionais
Optional
string 1-500 Extra information about the item (for example batch or expiry date).

The API calculates the totals, with two limits:

LimitMaximum
Value of each item (quantity × unit value)R$ 10,000,000.00
Sum of all itemsR$ 100,000,000.00

These limits come from API validation. Staying within them does not guarantee authorization, which also depends on the rules of SEFAZ.

Example with two items:

{
  "itens": [
    {
      "descricao": "Cafe torrado e moido 500g",
      "ncm": "09012100",
      "quantidade": 120,
      "valor_unitario": 18.9,
      "informacoes_adicionais": "Lote 202603A"
    },
    {
      "descricao": "Filtro de papel tamanho 103 com 30 unidades",
      "ncm": "48232099",
      "quantidade": 80,
      "valor_unitario": 6.5
    }
  ]
}

Issuing a DC-e
Transport

Describe how the goods are transported in the transporte object.

Parameter Required Type Size Description
modalidade
Required
string 1 Transport method.
0 = Correios (Brazilian postal service)
1 = Own transport
2 = Carrier company
cnpj_transportadora
Optional
string 14 CNPJ (company ID) of the carrier, digits only.
API validation also accepts an 11-digit CPF, but the document expects the carrier's CNPJ: always send the CNPJ.

Example of transport by a carrier company:

{
  "transporte": {
    "modalidade": "2",
    "cnpj_transportadora": "19131243000197"
  }
}

Issuing a DC-e
Additional information

All fields in this section are optional. They let you add extra notes to the document. For companies set up with issuer type 2, the API moves informacoes_adicionais and observacoes to the matching fields with the _emitente suffix, when those fields are empty. The DC-e has two levels of additional information:

  • General (informacoes_adicionais and observacoes): visible to the recipient and to the tax authority.
  • Issuer (informacoes_adicionais_emitente and observacoes_emitente): for the issuer's own use.
Parameter Required Type Size Description
informacoes_adicionais
Optional
string 1-5000 Free text with general notes on the document.
observacoes
Optional
array 1-10 List of structured notes (field/text).
See the item structure.
informacoes_adicionais_emitente
Optional
string 1-5000 Free text with notes for the issuer's own use.
observacoes_emitente
Optional
array 1-10 List of structured notes of the issuer (field/text).
See the item structure.

Issuing a DC-e > Additional information
Notes

Each item of the observacoes and observacoes_emitente arrays must have the campo and texto fields:

Parameter Required Type Size Description
campo
Required when you send observacoes or observacoes_emitente
string 1-20 Name of the field.
Example: PEDIDO, ROTA, REFERENCIA.
texto
Required when you send observacoes or observacoes_emitente
string 1-60 Content of the note.

Example with every additional information field:

{
  "informacoes_adicionais": "Entrega agendada para o periodo da manha.",
  "observacoes": [
    {
      "campo": "PEDIDO",
      "texto": "Pedido interno 78954"
    },
    {
      "campo": "CONTATO",
      "texto": "Recebimento com Joao"
    }
  ],
  "informacoes_adicionais_emitente": "Documento emitido para controle logistico.",
  "observacoes_emitente": [
    {
      "campo": "ORDEM",
      "texto": "Ordem de coleta 45678"
    }
  ]
}

Functions
Download the XML and PDF

The XML and the PDF of each document are at the URLs returned in the response, in the lookup and in the notification. For security, Webmania restricts access to these files.

The tax document is protected with a password. It opens only after you confirm the CPF/CNPJ (tax ID) of the document recipient, or with one of the access methods below: Access credentials, Token, Issuing IP or Webmania® Panel.

Tax documents in your system. When you make the XML and the PDF available in your system, use access restrictions like the ones Webmania uses. Do not allow public access to tax documents that are not protected with a password.

Ways to access the files:

Authentication Access allowed Password required? Description
Access credentials ✅ No Send the company's access credentials in the request HEADER to access every tax document issued by the company.
Authorization: Bearer YOUR_ACCESS_TOKEN
Token ✅ No Send the encrypted token in the URL to open the tax document for 24 hours without a password. Ideal for sharing a link.
?token=[TOKEN]
The token is not available for tax documents without a recipient.
Issuing IP ✅ No When you issue an invoice, the IP address of the computer or server is permanently registered as authorized. That IP can access every tax document issued by the companies it has access to.
IPs authorized automatically
Webmania® Panel ✅ No When you log in to the Webmania® Panel, you can access every tax document issued by the companies of your account. Access lasts while you are logged in to the Webmania® Panel.
Access while you are logged in
No authentication ❌ Yes When the URL is opened publicly, without authentication, the tax documents are protected with a password. To open them, enter the CPF/CNPJ of the document recipient (numbers only, no punctuation).
PDF = password-protected PDF file
XML = password-protected ZIP file

Access without authentication is not available for tax documents without a recipient.

To download the files to your server, use the Access credentials. To give your customer a link without a password, use the Token.

Functions > Download the XML and PDF
Access credentials

With the company's access credentials in the request header, you can download every tax document issued by the company.

To download a file, send a GET request to the URL of the XML or the PDF, with the credentials in the header. Example with the PDF:

curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://api.webmania.com.br/dace/00000000000000000000000000000000000000000000

The response is the file itself, as application/pdf or text/xml.

Functions > Download the XML and PDF
Token

The token opens the XML and the PDF without a password for 24 hours, so you can share the link with your customer safely.

Note. This feature is not available for tax documents without a recipient. For these documents, use the Access credentials.

To share the file, generate the token encrypted with AES-256-CBC and send it in the token parameter of the file URL:

https://api.webmania.com.br/dace/00000000000000000000000000000000000000000000?token=[TOKEN]

The step-by-step guide to generate the token, with functions in PHP, Python, Java, C# and Ruby, is on the Webmania GitHub (in Portuguese): https://github.com/webmaniabr/DFeToken.

Functions
Look up a DC-e

The lookup returns the current status of a DC-e of the authenticated company, even while it is in processando or contingencia. Use the notifications for day-to-day tracking. Use the lookup to check one DC-e when you need to.

To look up a DC-e, send a GET request to the URL /2/dce/consulta/{identifier}. Replace {identifier} with the uuid (36 characters) or the chave (access key, 44 characters) of the DC-e.

curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
https://api.webmania.com.br/2/dce/consulta/00000000000000000000000000000000000000000000

Example of an HTTP 200 response. The fields are described in Notification fields:

{
  "ID": "PED-123",
  "uuid": "00000000-0000-0000-0000-000000000000",
  "chave": "00000000000000000000000000000000000000000000",
  "serie": 1,
  "numero": 123,
  "status": "aprovado",
  "motivo": "Autorizado o uso do DC-e",
  "modelo": "dce",
  "xml": "https://api.webmania.com.br/xmldce/[chave]",
  "dace": "https://api.webmania.com.br/dace/[chave]",
  "log": {
    "cStat": 100,
    "xMotivo": "Autorizado o uso do DC-e"
  }
}

Functions
Cancel a DC-e

Cancellation registers an event at SEFAZ that voids an authorized DC-e, for example when the goods are not shipped. After cancellation, the DC-e cannot be used for transport.

To cancel a DC-e, send a PUT request to the URL /2/dce/cancelar, with the uuid or the chave of the DC-e and the justificativa (reason) for the cancellation.

Parameter Required Type Size Description
uuid
Required without chave
string 36 UUID of the DC-e. Do not send it together with chave.
chave
Required without uuid
string 44 Access key of the DC-e. Do not send it together with uuid.
justificativa
Required
string 15-255 Reason for the cancellation.
curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "chave": "00000000000000000000000000000000000000000000",
  "justificativa": "Cancelamento por erro operacional no lançamento"
}' \
https://api.webmania.com.br/2/dce/cancelar

The response has status, motivo, xml, xml_cancelamento and log:

SituationResponseWhat to do
Cancellation accepted by SEFAZstatus = canceladoStore the xml_cancelamento. Webmania also sends the cancelado notification.
Cancellation not acceptedstatus = reprovadoThe DC-e stays authorized. Read the motivo before you try again.

Example of an HTTP 200 response for an accepted cancellation:

{
  "status": "cancelado",
  "motivo": "Evento registrado e vinculado",
  "xml": "https://api.webmania.com.br/xmldce/[chave]",
  "xml_cancelamento": "https://api.webmania.com.br/xmldce/[chave]/cancelamento",
  "log": {}
}

Example of an HTTP 200 response when SEFAZ does not accept the cancellation:

{
  "status": "reprovado",
  "motivo": "Falha no cancelamento",
  "log": {}
}

Contingency mode and processing

Webmania® detects automatically when SEFAZ is down or has not returned a result yet. It completes the DC-e without your application having to resend anything:

SituationStatusWhat Webmania does
SEFAZ received the DC-e but has not answered yetprocessandoChecks with SEFAZ automatically until it gets the result.
SEFAZ is offlinecontingenciaKeeps the DC-e in a queue and resends it when communication is back. Before resending, it checks with SEFAZ so the same DC-e is not issued twice.
From request to final result: DC-e When it receives the POST /2/dce/emissao, Webmania checks whether SEFAZ (the state tax authority) is available. When the authorizer is available, the DC-e is sent in the same request: the response returns aprovado or reprovado, or processando when SEFAZ has not given the result yet; in that case Webmania checks SEFAZ automatically. When no authorizer is available, the DC-e gets the contingencia status: Webmania checks SEFAZ, looks up the DC-e and resends it only if SEFAZ did not receive it. The final result, aprovado or reprovado, arrives through the url_notificacao and the lookup. POST /2/dce/emissao Is SEFAZ available? Sent to SEFAZ in the same request Immediate response aprovado reprovado Processing processando Webmania checks SEFAZ automatically Contingency contingencia Webmania checks SEFAZ and looks up the DC-e before resending Automatic resend only if SEFAZ did not receive the DC-e Final result in your application aprovado or reprovado, in the url_notificacao and the lookup Yes No
Webmania® step Check Final result Waiting for the result: not a final status Your application
The processando and contingencia statuses are not notified and do not prove authorization. The url_notificacao receives the final result; until then, follow the DC-e through the lookup, without issuing it again.

The final result, aprovado or reprovado, arrives by notification and is available in the lookup. Until then, do not issue the same DC-e again.

Infrastructure

The Webmania® API runs on Amazon AWS, the global leader in cloud computing, in the us-east-1 region (US East), with a point of presence in sa-east-1 (São Paulo). The entry point is anycast and highly available: from anywhere in the world, your request goes to the server closest to you.

Anycast entry of the Webmania API around the world World map with the us-east-1 region, in the eastern United States, and the sa-east-1 point of presence, in São Paulo. Requests from many parts of the world enter through the anycast network and go to the nearest server: North America, Europe and Asia to us-east-1, and South America, Africa and Oceania to sa-east-1. us-east-1 US East sa-east-1 São Paulo
Webmania AWS region Your application Anycast route to the nearest server
Illustration. The dots stand for applications in different regions of the world, not for real server addresses.

Global anycast

The same entry IPs serve the whole world. Your request goes to the server closest to you, with no setup on your side.

Two AWS locations

us-east-1 (US East) and sa-east-1 (São Paulo). Keep your infrastructure close to one of them for a shorter response time.

Static IPs

Fixed IPs for inbound and outbound traffic: allow them in your firewall and check the source of the notifications you receive.

Static inbound IPs Requests from your application to the API.
  • 13.248.145.90
  • 76.223.17.240
Static outbound IPs Notifications sent by Webmania® to your URL.
  • 34.196.69.38
  • 44.219.142.86

Request limits

The Webmania® API limits the number of requests per second to keep every integration stable and fast. Each limit is counted per second, separately for each HTTP method and each endpoint.

GET 15per second

Reading: lookups and lists.

POST No limit

Creating: issuing and other submissions. See the specific limits below.

PUT / DELETE 5per second

Changing and removing resources.

Specific limits

Some endpoints have a lower limit, which applies instead of the method's limit:

Request Limit Reason
Issuing in the sandbox (homologação) 1 request per second Test environment for your integration.

Need a higher request volume? Contact us and we will review it.

When the limit is exceeded

A request over the limit is refused with HTTP 429 (Too Many Requests) before it is processed. Nothing is issued, changed or canceled, and you can safely resend the same request.

Header Example Description
Retry-After 1 Seconds to wait before you resend the request. If the response does not include this header, wait 1 second.

Example of an HTTP 429 response. The API sends the message in Portuguese; it means “Request limit reached. Try again in a few seconds.”:

{
  "error": "Limite de requisições atingido. Tente novamente em alguns segundos."
}
Detect the limit by the HTTP status 429, not by the text of the error field: the message can change from one endpoint to another.

How to handle HTTP 429

  1. Pause sendingStop sending new requests to the same endpoint.
  2. Wait the time shownWait the number of seconds in the Retry-After header, or 1 second if the header is missing.
  3. Resend the same requestThe refused request was not processed. Resend it with the same content.
  4. Wait longer if the 429 repeatsFor each new 429 in a row, double the wait time (1, 2, 4, 8 seconds) and set a maximum number of retries.

Best practices

Use the notification URL

Receive the API results at your notification URL instead of polling in a loop. When a result arrives, update your database and download the PDF and the XML.

Send through a queue

Spread your requests through a queue that respects the per-second limit of each method, instead of sending everything at once.

Send valid credentials

The endpoints require valid access credentials in the request header. Sending them incorrectly is treated as misuse of the API.

Allow your server IP

By default, the firewall blocks servers in regions with a high rate of attacks or a poor reputation. If a GET to https://webmania.com.br/api/ or https://api.webmania.com.br returns 403 Forbidden by mistake, contact us and we will allow your IP.

Changelog

  1. v2.0.2 · November 17, 2026 · Documentation · Changed

    The contingency section now has a flowchart from the request to the final result, with the contingency queue and the automatic resend.

    Changed section: contingencia

  2. v2.0.1 · November 9, 2026 · Documentation · Added

    The documentation is now LLM-ready: copy the page or each section as Markdown, a section index and llms.txt.

Solutions

Fiscal IssuerFiscal MonitorTax ReconciliationArtificial Intelligence

Industries

Logistics & TransportationTechnology & SaaSManufacturingBanks & FintechsServices & SubscriptionsRetail & CommerceMid-sized CompaniesEnterprise

Brazil tax guide

Start hereComplete guideGlossaryNF‑e (electronic invoice)NFS‑e (service invoice)CT‑e (freight bill)Tax reform

Company

AboutCustomersContactBook a demoPolicies and termsTrust Center

Developers

API documentationNF‑e and NFC‑e APINFS‑e APICT‑e and CT‑e OS APIDC‑e APIMDF‑e APINFCom APICIOT / PEF APITax payment slips APIFiscal Monitor APIB2B Management APISDKs on GitHubDocs for LLMs (llms.txt)

Offices

United States

Webmania Inc8 The Green, STE R, Dover, DE 19901

São Paulo, Brazil

Cubo Itaú innovation hubAlameda Vicente Pinzon, 54 - 10th floor, Vila Olímpia, São Paulo - SP

Curitiba, Brazil

HeadquartersAv. Água Verde, 1413 - 5th floor, Água Verde, Curitiba - PR

HOTMILK innovation hubR. Imac. Conceição, 1430, Prado Velho, Curitiba - PR

Talk to our team

Quick access

Customer panelContact
Webmania® Status SEFAZ Monitor City Hall Monitor
Cubo Itaú Startup 2025
webmania®

Copyright © 2009-2026 Webmania®.Webmania® is a registered trademark used exclusively by WMBR SERVICOS EMPRESARIAIS LTDA
CNPJ 11.290.027/0001-82, headquartered at Av. Água Verde, 1413, 5th floor - Curitiba, PR, Brazil - ZIP 80620-200

Region and language

Brazil

  • PTPortuguês (Brasil)
  • ENEnglish
  • ESEspañol
We use cookies to improve your experience on Webmania®. Learn more in our Privacy Policy and Cookie Policy.