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 →
  • MDF-e REST API
  • Quick guide
    • Which transport mode to use
    • MDF-e lifecycle
  • SDKs & LLMs
    • LLM-ready
    • Webmania SDKs
    • Examples
  • Authentication
  • Response format
  • Notifications
    • Notification fields
    • Notification example
  • Issuing an MDF-e
    • General information
    • Loading
    • Unloading
      • Tax documents
        • Transport units
        • Cargo units
        • Dangerous goods
    • Predominant product
      • Full load
    • Insurance
      • Responsible party
      • Insurer
    • Road
      • Tractor/trailer vehicle
        • Owner
      • Drivers
      • CIOT
      • Toll voucher
      • Hiring parties
      • Freight payment
        • Components
        • Bank details
        • Installment payment
    • Air
    • Water
      • Loading/unloading terminals
      • Convoy vessels
      • Empty cargo units
      • Empty transport units
    • Rail
      • Train
      • Wagons
  • Functions
    • Download XML and PDF
      • Access credentials
      • Token
    • Look up an MDF-e
    • Close an MDF-e
    • Cancel an MDF-e
    • Add a driver to an MDF-e
  • Contingency mode
    • MDF-e in processing
  • Infrastructure
  • Request limits
  • Changelog
⚡ Follow in real time (in Portuguese): Status | SEFAZ Monitor | City Hall Monitor

Last updated: November 17, 2026 · v1.4.4

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

Cargo Manifest REST API

Documentation for issuing the electronic cargo manifest (MDF-e)

MDF-e from issuing to closing MDF-e from issuing to closing

The Webmania® REST API issues the MDF-e at SEFAZ, the state tax authority. It creates the XML file and the DAMDFE (the printed summary of the manifest) and sends the result by notification. You can also look up, close and cancel each manifest, and add a driver to it. To start, read the Quick guide. To issue other document types, see all the APIs.

What is the MDF-e? The MDF-e (Manifesto Eletrônico de Documentos Fiscais) is the electronic cargo manifest. It lists the invoices (NF-e) or freight bills (CT-e) of the cargo that one vehicle carries on one trip. SEFAZ must authorize it before the trip starts, and you close it when the trip ends. It also records the transport mode, the cities of loading and unloading, and the route:

Who issues it

The company that carries the cargo: a carrier that sells the transport service, or a company that carries its own goods. Set it in emitente.

What it groups

The tax documents of the cargo (NF-e, CT-e or MDF-e), grouped by city of unloading in descarregamento.

How it ends

After authorization, the DAMDFE travels with the vehicle. When the trip ends and the cargo is delivered, you close the MDF-e.

Brazilian tax terms you will see. They keep their Brazilian names in the payload and on the MDF-e:
SEFAZ: the state tax authority. It authorizes each MDF-e and answers with a status code; 100 = authorized.
DAMDFE: the printable summary of the MDF-e that travels with the vehicle; the legal document is the XML.
Chave de acesso: the 44-digit access key of each NF-e, CT-e or MDF-e in the cargo. Sent in descarregamento, in documentos_fiscais.
CIOT: the code ANTT generates for a paid road freight operation. Array ciot of the road mode.
RNTRC / ANTT: the carrier's registration with ANTT, the national land transport agency. Field rntrc of the road mode.
NCM: the 8-digit product classification code of Mercosur. Field ncm of the predominant product.
CNPJ / CPF / IE: the company ID (14 digits), the individual taxpayer ID (11 digits) and the state registration.
Every term in plain English: glossary of Brazilian tax terms.

Availability and security
High availability, scalability and redundant servers at the highest PCI DSS security level, on Amazon Web Services, the global leader in cloud computing.
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 MDF-e through the API and the Webmania® Panel at the same time. The numbering is managed automatically.
DAMDFE and email delivery
The DAMDFE is created automatically and works with regular and thermal printers. The MDF-e 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 you are using version 2.0 of the API.

URL HTTP Verb Function
/2/mdfe/emissao POST Issue an MDF-e
/2/mdfe/consulta/{key} GET Look up an MDF-e by its UUID (36 characters) or its access key (44 characters)
/2/mdfe/encerrar PUT Close an MDF-e
/2/mdfe/cancelar PUT Cancel an MDF-e
/2/mdfe/condutor PUT Add a driver to an MDF-e (road transport only)

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 and Response format.

How to integrate the MDF-e:

  1. Get the Access Token Copy the company's Access Token from the Webmania® Panel and send it in the Authorization header.
  2. Issue the MDF-e Send a POST to /2/mdfe/emissao. Use ambiente = 2 (sandbox) for tests, and send the object of the trip's transport mode. The response returns the uuid of the MDF-e; store it in your system.
  3. Receive the result Webmania notifies your url_notificacao when the MDF-e is authorized, rejected, denied, closed or canceled.
  4. Print the DAMDFE Once the MDF-e is authorized, download the XML and the DAMDFE. The DAMDFE travels with the cargo during transport.
  5. Add a driverif needed In road transport, add a driver to an authorized MDF-e without issuing a new one.
  6. Close it at the end of the route When the delivery is complete, close the MDF-e and send the city where the trip ended.
  7. Cancel it if the trip does not happenif needed Cancel the authorized MDF-e with a reason. A closed MDF-e can no longer be canceled.

Quick guide
Which transport mode to use

An MDF-e describes one trip in one of four transport modes: road, air, water or rail. Send the mode code in modalidade. Send the trip data in the object of the same mode, which then becomes required:

Transport modemodalidadeObjectWhat goes in the object
Road1rodoviarioTractor vehicle and trailers, drivers and, when they apply, CIOT, toll voucher, hiring parties and freight payment.
Air2aereoAircraft, flight number and date, and departure and destination airfields.
Water3aquaviarioVessel, voyage, ports of departure and destination and, when they apply, terminals, convoy and empty units.
Rail4ferroviarioTrain and wagons.

In road transport, produto_predominante is also required when emitente is 1 or 3. Road is also the only mode that allows you to add a driver after authorization.

Quick guide
MDF-e lifecycle

Every MDF-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:

MDF-e lifecycle When you issue the MDF-e, Webmania sends it to SEFAZ. The response returns aprovado (authorized) or reprovado (rejected) or, while there is no result yet, processando. If SEFAZ is unavailable, the MDF-e stays in contingencia and Webmania sends it again automatically. Before it does, it checks SEFAZ so the same MDF-e is not issued twice. When SEFAZ denies use of the document, the status is denegado. An authorized MDF-e accepts a new driver through PUT /2/mdfe/condutor, which keeps the status aprovado. It ends closed through PUT /2/mdfe/encerrar or canceled through PUT /2/mdfe/cancelar. POST /2/mdfe/emissao Processing processando waiting for SEFAZ Authorized aprovado XML and DAMDFE available Rejected reprovado read the reason and fix it Contingency contingencia SEFAZ unavailable Driver added stays aprovado PUT /2/mdfe/condutor Closed encerrado PUT /2/mdfe/encerrar Canceled cancelado PUT /2/mdfe/cancelar SEFAZ down resend
After authorization Authorized Waiting for the result: not a final status Rejected Automatic retry
The statuses processando and contingencia are not notified and do not prove authorization. Follow the MDF-e through the lookup and do not issue it again. Closing, canceling and adding a driver are only accepted while the MDF-e is aprovado.
StatusWhat it meansWhat to do
processandoSEFAZ has not returned the result of the MDF-e yet.Wait for the notification or look up the MDF-e. Do not issue it again.
contingenciaSEFAZ is unavailable. Webmania sends the MDF-e again automatically, after checking SEFAZ.Follow the same uuid and do not issue it again. See Contingency mode.
aprovadoSEFAZ authorized the MDF-e. The XML and the DAMDFE are available.Print the DAMDFE to travel with the cargo. At the end of the route, close it. If the trip does not happen, cancel it.
reprovadoSEFAZ rejected the MDF-e. motivo holds the reply.Fix the data shown in motivo and issue a new MDF-e.
denegadoSEFAZ denied use of the MDF-e. motivo holds the reply.Do not use this MDF-e for transport. Read the motivo before you issue another one.
encerradoThe closing was registered at SEFAZ.Nothing to do. The MDF-e no longer accepts cancellation or new drivers.
canceladoThe cancellation was registered at SEFAZ.Do not use this MDF-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 MDF-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 API 2.0 Access-Token in the Webmania® Panel. Include it in every request. Send the request body in JSON, with the Content-Type and Accept headers set to application/json.

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

For mobile apps (iOS and Android), we recommend that you issue documents on your server (back end). The app code should only send the issuing request. The processing should run on your server.

Response format

The responses for issuing, lookup, closing, cancellation and adding a driver are in JSON. Downloading the XML and the DAMDFE returns the file itself, as described in Download XML and PDF.

An HTTP 2xx status does not confirm that SEFAZ authorized the MDF-e. Also check the JSON body:

SituationHow to identify it
Business or validation errorHTTP 200 with the error field. Request validation failures can return HTTP 422 with error and errors.
Token missing or invalidHTTP 401 with the error field.
MDF-e accepted by the APIThe status field gives the tax status of the document. See the MDF-e lifecycle.

Example of an HTTP 401 response when the token is missing or invalid (the message means "Restricted access. Token missing or invalid."):

{
  "error": "Acesso restrito. Token não informado ou inválido."
}

Notifications

To keep your platform up to date, Webmania® sends automatic notifications for each result of the MDF-e. With them, you do not need a routine that polls for results: wait for the webhook and update the MDF-e in your system when it arrives.

The notification is sent by POST, in JSON, to the URL set in url_notificacao when you issue the document. If you do not send this parameter, it goes to the notification URL saved in the company's settings.

Notified statusWhen it is sent
aprovadoSEFAZ authorized the MDF-e. The body includes the chave, the xml and the damdfe.
reprovadoSEFAZ rejected the MDF-e. The body includes the motivo.
denegadoSEFAZ denied use of the MDF-e. The body includes the motivo.
encerradoThe closing was registered at SEFAZ.
canceladoThe cancellation was registered at SEFAZ.
When there is no notification. The statuses processando and contingencia are not notified. In these cases, do not issue the MDF-e again: wait for the next notification or check the result in the lookup. Adding a driver does not send a notification either: the result comes in the response to the request.

What is the UUID? The UUID (Universally Unique Identifier) is a unique 36-character ID, in the format 8-4-4-4-12, that Webmania assigns to each MDF-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 MDF-e at SEFAZ: it applies to aprovado, reprovado, cancelado, encerrado, processando, contingencia and denegado.

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 MDF-e lookup:

Parameter Type Description
uuid string Unique ID of the MDF-eUse the UUID to receive the notification and identify the MDF-e in your system.
chave string Access key that identifies the MDF-e at SEFAZ
serie integer or null Issuing series, or null when it cannot be determined.
mdfe integer MDF-e number
Managed automatically by the issuer.
status string Status of the MDF-e: aprovado, reprovado, denegado, encerrado or cancelado in the notification. The lookup can also return processando or contingencia. See the lifecycle.
motivo string or null Reason for the status, when available
E.g.: Autorizado o uso da MDF-e (use of the MDF-e authorized)
xml string URL of the MDF-e XML
damdfe string URL of the DAMDFE
log object or array Reply log from SEFAZ

Notifications
Notification example

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

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

Example of a notification for an authorized MDF-e:

{
    "uuid": "00000000-0000-0000-0000-000000000000",
    "chave": "00000000000000000000000000000000000000000000",
    "serie": 1,
    "mdfe": 123,
    "status": "aprovado",
    "motivo": "Autorizado o uso da MDF-e",
    "xml": "https://api.webmania.com.br/xmlmdfe/[chave]",
    "damdfe": "https://api.webmania.com.br/damdfe/[chave]",
    "log": { ... }
}

Issuing an MDF-e

Issuing sends the MDF-e (cargo manifest) to SEFAZ, the state tax authority. When SEFAZ authorizes it, the API generates the XML file and the DAMDFE, the printed manifest summary that travels with the cargo. Each transport mode has its own object for its fields: see Which transport mode to use.

To issue an MDF-e, send a POST request to the URL /2/mdfe/emissao, with a JSON body.

How to build the request:

  1. Fill in the general data The ambiente (environment: 2 for tests in the sandbox), the emitente (issuer) type, the modalidade (transport mode), the states, the cargo value and weight and, if you want, the url_notificacao and your own control ID.
  2. List where the cargo is loaded In carregamento, from 1 to 50 cities, each with its IBGE code (the official 7-digit city code).
  3. List where the cargo is unloaded In descarregamento, each city with its documentos_fiscais: the access key of each NF-e, CT-e or MDF-e in the cargo.
  4. Fill in the transport mode The object of the mode chosen in modalidade: rodoviario, aereo, aquaviario or ferroviario.
  5. Fill in the predominant productif needed In produto_predominante, required for road transport when emitente is 1 or 3.
  6. Fill in the cargo insuranceif needed In seguro, with the responsible party and the insurer.

Request example:

  curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ambiente": 1,
    "modalidade": 1,
    "emitente": 2,
    ...
  }' \
  https://api.webmania.com.br/2/mdfe/emissao

Example of the full body of a road MDF-e:

{
  "ambiente": 1,
  "emitente": 2,
  "transportador": 1,
  "modalidade": 1,
  "uf_carregamento": "GO",
  "uf_descarregamento": "PR",
  "valor_carga": "500.00",
  "unidade": "01",
  "peso_bruto": "50.0000",
  "carregamento": [
    {
      "codigo_municipio": "5208707",
      "nome_municipio": "Goiânia"
    },
    {
      "codigo_municipio": "5201405",
      "nome_municipio": "Aparecida de Goiânia"
    }
  ],
  "descarregamento": [
    {
      "codigo_municipio": "4106902",
      "nome_municipio": "Curitiba",
      "documentos_fiscais": [
        {
          "chave": "00000000000000000000000000000000000000000000"
        }
      ]
    }
  ],
  "percurso": ["MG", "SP"],
  "rodoviario": {
    "rntrc": "12345678",
    "veiculo_tracao": {
      "placa": "AB12E4R",
      "tara": "20",
      "uf_licenciamento": "GO",
      "tipo_rodado": "01",
      "tipo_carroceria": "00",
      "proprietario": {
        "cnpj": "00.000.000/0000-00",
        "razao_social": "Proprietário 1",
        "rntrc": "12345678",
        "ie": "00000",
        "uf": "GO",
        "tipo_proprietario": "2"
      }
    },
    "condutor": [
      {
        "cpf": "000.000.000-00",
        "nome": "Condutor 1"
      }
    ],
    "ciot": [
      {
        "codigo_ciot": "000000000000",
        "cpf_responsavel": "000.000.000-00"
      }
    ]
  },
  "seguro": [
    {
      "responsavel": {
        "tipo_responsavel": "1"
      },
      "seguradora": {
        "cnpj": "00.000.000/0000-00",
        "nome_seguradora": "Seguradora 1"
      }
    }  
  ],
  "produto_predominante": {
    "tipo_carga": "01",
    "nome": "Produto 1",
    "lotacao": {
      "carregamento": {
        "cep": "00000-000"
      },
      "descarregamento": {
        "cep": "00000-000"
      }
    }
  }
}

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

{
  "uuid": "90d30c80-d0be-4c8f-a749-a818989222ca", // Unique identification number
  "chave": "00000000000000000000000000000000000000000000", // Access key at SEFAZ
  "serie": 1, // MDF-e series
  "mdfe": 123, // MDF-e number
  "status": "aprovado", // aprovado, reprovado, cancelado, encerrado, processando, contingencia or denegado
  "motivo": "Autorizado o uso da MDF-e", // Reason for the status (SEFAZ message)
  "xml": "https://api.webmania.com.br/xmlmdfe/[chave]",
  "damdfe": "https://api.webmania.com.br/damdfe/[chave]",
  "log": { ... } // SEFAZ response log
}

If the response returns processando or contingencia, the MDF-e has no final result yet: wait for the notification and do not issue it again. The statuses are explained in MDF-e lifecycle.

Issuing an MDF-e
General information

Top-level fields of the issuing body. Fields with a link open the section of their object. The transport mode code goes in modalidade, and the mode data goes in the object with the same name; see Which transport mode to use.

Parameter Required Type Size Description
ID
string 1-15 Purchase order number or processing ID
Tracks issuing requests by order or processing ID. Learn more (in Portuguese)
ambiente
integer 1 SEFAZ environment
1 - Production
2 - Sandbox (homologação)
url_notificacao
string --- URL that receives the MDF-e notifications. Without it, Webmania uses the notification URL saved for the company.
emitente
integer 1 Issuer type of the MDF-e
1 - Transport service provider
2 - Carrier of its own cargo
3 - Transport service provider that will issue a CT-e Globalizado (consolidated freight bill)
Note: Use 2 for NF-e issuers and for carriers that transport their own cargo. Use 3 for the cargo carrier that will later issue a CT-e Globalizado that lists the NF-e.
transportador
integer 1 Carrier type of the MDF-e
1 - ETC (cargo transport company)
2 - TAC (independent truck driver)
3 - CTC (cargo transport cooperative)
modalidade
integer 1 Transport mode
1 - Road
2 - Air
3 - Water
4 - Rail
uf_carregamento
string 2 Code of the state (UF) where the cargo is loaded
uf_descarregamento
string 2 Code of the state (UF) where the cargo is unloaded
valor_carga
string 13v2 Total value of the cargo/goods carried
unidade
string 2 Unit of measure code of the gross weight of the cargo/goods carried
01 – KG
02 - TON
peso_bruto
string 11v4 Total gross weight of the cargo/goods carried
data_inicio_viagem
string 19 Planned date and time of the trip start
Format: Y-m-d H:i:s
percurso
array of strings 0-25 Codes of the states (UF) on the route, without repeating the loading and unloading states.
ind_canal_verde
integer 1 Indicates participation in the Canal Verde (green channel) program.
0 - No
1 - Yes
informacoes_fisco
string 1-2000 Additional information for the tax authorities.
informacoes_complementares
string 1-5000 Complementary information of interest to the taxpayer.
carregamento
array 1-50 Information on the loading cities
descarregamento
array 1-1000 Information on the unloading cities and their tax documents
produto_predominante
object --- Information on the predominant product of the cargo.
*Required for road transport with emitente 1 or 3.
seguro
array 0-n Cargo insurance information
rodoviario
object --- Road transport information.
*Required for road transport.
aereo
object --- Air transport information.
*Required for air transport.
aquaviario
object --- Water transport information.
*Required for water transport.
ferroviario
object --- Rail transport information.
*Required for rail transport.

Issuing an MDF-e
Loading

List the cities where the cargo is loaded in the carregamento array, one item per city, from 1 to 50.

Parameter Required Type Size Description
nome_municipio
string 2-60 Name of the loading city
codigo_municipio
string 7 IBGE code of the loading city, with 7 digits.
Required for each city, even when nome_municipio is sent.

Loading example:

{
    ...
    "carregamento": [
        {
            "nome_municipio": "Curitiba",
            "codigo_municipio": "4106902"
        },
        {
            "nome_municipio": "Maringá",
            "codigo_municipio": "4115200"
        }
    ],
    ...
}

Issuing an MDF-e
Unloading

List the cities where the cargo is unloaded in the descarregamento array, one item per city. Each city lists, in documentos_fiscais, the tax documents (NF-e, CT-e or MDF-e) of the cargo unloaded there.

Parameter Required Type Size Description
nome_municipio
string 2-60 Name of the unloading city
codigo_municipio
string 7 IBGE code of the unloading city, with 7 digits.
Required for each city, even when nome_municipio is sent.
documentos_fiscais
array 1-n Tax documents of the goods unloaded in the city
NF-e, CT-e or MDF-e. The XML layout accepts up to 20,000 documents of each type per city.

Unloading example:

{
    ...
    "descarregamento": [
        {
            "nome_municipio": "São Paulo",
            "codigo_municipio": "3550308",
            "documentos_fiscais": [...]
        }
    ],
    ...
}

Issuing an MDF-e > Unloading
Tax documents

Each item of the documentos_fiscais array is one tax document of the cargo, identified by its access key: NF-e, CT-e or MDF-e.

Parameter Required Type Size Description
chave
string 44 Access key
codigo_barra
string 36 Second barcode, with 36 digits, for NF-e or CT-e.
indicador_reentrega
integer 1 Redelivery indicator. Send 1 to flag a redelivery; otherwise, leave the field out.
unidade_transporte
array 0-n Information on the transport units (semi-trailer/trailer/wagon)
periculosidade
array 0-n Dangerous goods carried under this tax document. See the fields in Dangerous goods.
entrega_parcial
object --- Partial delivery (flight cut), for CT-e only. It belongs to the tax document, not to a dangerous goods item. When sent, it requires quantidade_total and quantidade_parcial as numbers, not empty, with up to 4 decimal places.

Tax documents example:

{
    ...
    "documentos_fiscais": [
        {
            "chave": "00000000000000000000000000000000000000000000"
        },
        {
            "chave": "00000000000000000000000000000000000000000000"
        },
        {
            "chave": "00000000000000000000000000000000000000000000"
        }
    ],
    ...
}

Issuing an MDF-e > Unloading > Tax documents
Transport units

List the transport units of the document (semi-trailer, trailer, wagon) in the unidade_transporte array, one item per unit.

Parameter Required Type Size Description
tipo
integer 1 Transport unit type
1 - Road tractor
2 - Road trailer
3 - Ship
4 - Barge
5 - Aircraft
6 - Wagon
7 - Other
identificacao
string 1-20 Transport unit identification
Send the identification that matches the transport unit type. For example, for a road tractor or trailer, send the vehicle license plate.
lacres
array (string) 0-n Seals of the transport units. Each element must be a string of 1 to 20 characters.
quantidade_rateada
string 3v2 Apportioned quantity (weight/volume), as a numeric string from 0 to 999.994, with up to 2 decimal places. Non-numeric values or values outside this range are left out.
unidade_carga
array 0-n Information on the cargo units (containers/ULD/other)

Transport unit example:

{
    ...
    "unidade_transporte": [
        {
            "tipo": 1,
            "identificacao": "Placa ABCXXXX",
            "lacres": [
                "00000000", "00000000"
            ],
            "unidade_carga": [...]
        }
    ],
    ...
}

Issuing an MDF-e > Unloading > Tax documents > Transport units
Cargo units

List the cargo units of each transport unit (container, ULD, pallet) in the unidade_carga array, one item per unit.

Parameter Required Type Size Description
tipo
integer 1 Cargo unit type
1 - Container
2 - ULD
3 - Pallet
4 - Other
identificacao
string 1-20 Cargo unit identification
Send the identification of the cargo unit, for example the container number.
lacres
array (string) 0-n Seals of the cargo units. Each element must be a string of 1 to 20 characters.
quantidade_rateada
string 3v2 Apportioned quantity (weight/volume), as a numeric string from 0 to 999.994, with up to 2 decimal places. Non-numeric values or values outside this range are left out.

Cargo unit example:

{
    ...
    "unidade_carga": [
        {
            "tipo": 1,
            "identificacao": "Container 00000",
            "lacres": [
                "00000000", "00000000"
            ]
        }
    ],
    ...
}

Issuing an MDF-e > Unloading > Tax documents
Dangerous goods

When the tax document carries products that the UN classifies as dangerous, list each product in the periculosidade array, one item per product.

Parameter Required Type Size Description
numero_onu
string 4 UN number
quantidade_total
string 1-20 Total quantity per product
nome_embarque
string 1-150 Proper shipping name of the product
classe_risco
string 1-40 Class or subclass/division, and subsidiary/secondary risk
grupo_embalagem
string 1-6 Packing group
quantidade_volumes
string 1-60 Quantity and type of packages

Dangerous goods example:

{
    ...
    "periculosidade": [
        {
            "numero_onu": "XXXX",
            "nome_embarque": "Produto Perigoso 1",
            "classe_risco": "Classe de Risco XX",
            "grupo_embalagem": "XXXXXX",
            "quantidade_total": "40000",
            "quantidade_volumes": "20 tambores"
        }
    ],
    ...
}

Issuing an MDF-e
Predominant product

Describe the product that makes up most of the cargo in the produto_predominante object. It is required for road transport when emitente is 1 or 3.

Parameter Required Type Size Description
tipo_carga
string 2 Cargo type
01-Solid bulk
02-Liquid bulk
03-Refrigerated
04-Containerized
05-General cargo
06-Neo-bulk
07-Dangerous (solid bulk)
08-Dangerous (liquid bulk)
09-Dangerous (refrigerated cargo)
10-Dangerous (containerized)
11-Dangerous (general cargo)
12-Pressurized bulk
nome
string 1-120 Name/description of the predominant product
gtin
string 8, 12-14 GTIN (Global Trade Item Number) of the product, formerly the EAN code or barcode. The layout accepts 8, 12, 13 or 14 digits, or SEM GTIN (no GTIN).
ncm
string 8 NCM of the product: the 8-digit product classification code of Mercosur, based on the international HS code. Required for road transport with only one tax document when emitente is 1 or 3, or when it is 2 and transportador is sent. In the other cases, it is validated when sent.
lotacao
object --- Full load information. Required for road transport with emitente 1 or 3 and only one tax document.

Predominant product example:

{
    ...
    "produto_predominante": {
        "tipo_carga": "02",
        "nome": "Produto X",
        "gtin": "00000000000000",
        "ncm": "00000000",
        "lotacao": {
            ...
        }
    },
    ...
}

Issuing an MDF-e > Predominant product
Full load

For a full load (lotação), send the loading and unloading places in the lotacao object, in the carregamento and descarregamento objects, each with the fields below. The CEP (postal code) is required in both. Latitude and longitude do not replace the CEP, and they do not go into the XML when the CEP is sent.

Parameter Required Type Size Description
cep
string 8 digits Postal code (CEP) of the loading/unloading place, with 8 digits, with or without mask.
latitude
string 2v6 Latitude of the loading/unloading place
longitude
string 3v6 Longitude of the loading/unloading place

Full load example:

{
    ...
    "lotacao": {
        "carregamento": {
            "cep": "00000-000",
            "latitude": "00.000",
            "longitude": "00.000"
        },
        "descarregamento": {
            "cep": "00000-000",
            "latitude": "00.000",
            "longitude": "00.000"
        }
    },
    ...
}

Issuing an MDF-e
Insurance

Send the cargo insurance in the seguro array, one item per insurance, with the responsible party and the insurer.

Parameter Required Type Size Description
responsavel
object --- Information on the party responsible for the cargo insurance
seguradora
object --- Insurer information
numero_apolice
string 1-20 Policy number
numero_averbacao
array 0-n Insurance endorsement numbers (averbação). Each element must be a string with up to 40 characters.

Cargo insurance example:

{
    ...
    "seguro": [
        {
            "responsavel": {
                "tipo_responsavel": 2,
                "cnpj": "00.000.000/0000-00"
            },
            "seguradora": {
                "nome_seguradora": "Seguradora 1",
                "cnpj": "00.000.000/0000-00"
            },
            "numero_apolice": "00000000000000",
            "numero_averbacao": ["000000", "000000"]
        },
        {
            "responsavel": {
                "tipo_responsavel": 1
            },
            "seguradora": {
                "nome_seguradora": "Seguradora 2",
                "cnpj": "00.000.000/0000-00"
            },
            "numero_apolice": "00000000000000",
            "numero_averbacao": ["000000", "000000"]
        }
    ],
    ...
}

Issuing an MDF-e > Insurance
Responsible party

Identify who took out the insurance in the responsavel object.

Parameter Required Type Size Description
tipo_responsavel
integer 1 Party responsible for the insurance
1 - Issuer of the MDF-e
2 - Party that hired the transport service (contratante, the hiring party)
cpf
Individual
string 11 CPF, the 11-digit individual taxpayer ID
Send a CPF or a CNPJ when tipo_responsavel is 2. It is not needed when it is 1 (issuer of the MDF-e).
000.000.000-00
cnpj
Company
string 14 CNPJ, the 14-digit company ID (each branch has its own)
Send a CPF or a CNPJ when tipo_responsavel is 2. It is not needed when it is 1 (issuer of the MDF-e).
00.000.000/0000-00

Issuing an MDF-e > Insurance
Insurer

Identify the insurer in the seguradora object.

Parameter Required Type Size Description
nome_seguradora
string 1-30 Insurer name
cnpj
string 14 CNPJ
00.000.000/0000-00

Issuing an MDF-e
Road

Road transport describes carriage by a cargo vehicle: the tractor vehicle and the trailers, the drivers and, when they apply, the CIOT, the toll voucher, the hiring parties and the freight payment. Send the data in the rodoviario object, required when modalidade is 1.

Parameter Required Type Size Description
rntrc
string 8 RNTRC, the carrier registration with ANTT, the national land transport agency (Registro Nacional de Transportadores Rodoviários de Carga). When sent, it has 8 digits, with or without mask.
combinacao_veicular
string 2 Vehicle combination category
*Required when vale_pedagio is set
02-Commercial vehicle, 2 axles
04-Commercial vehicle, 3 axles
06-Commercial vehicle, 4 axles
07-Commercial vehicle, 5 axles
08-Commercial vehicle, 6 axles
10-Commercial vehicle, 7 axles
11-Commercial vehicle, 8 axles
12-Commercial vehicle, 9 axles
13-Commercial vehicle, 10 axles
14-Commercial vehicle, more than 10 axles
veiculo_tracao
object --- Tractor vehicle information
veiculo_reboque
array 0-3 Trailer vehicle information
condutor
array 1-10 Drivers of the vehicle
ciot
array 0-n CIOT data (Código Identificador da Operação de Transporte, the road freight registration code)
vale_pedagio
array 0-n Toll voucher information
*Required when combinacao_veicular is set
contratante
array 0-n Information on the hiring parties of the transport service
pagamento_frete
array 0-n Freight payment information. Required for road transport with only one tax document when emitente is 1 or 3, or when it is 2 with transportador sent. Also required when the issuer or an owner has an RNTRC and one of these conditions applies: transportador equal to 2 (TAC), or an owner with tipo_proprietario 0 or 1.
lacres
array (string) 0-n Seals of the road transport. Each element must be a string with up to 20 characters.

Road transport example:

{
    ...
    "rodoviario": {
        "rntrc": "00000000",
        "veiculo_tracao": {...},
        "condutor": [...]
    }
    ...
}

Issuing an MDF-e > Road
Tractor/trailer vehicle

Send the tractor vehicle in the veiculo_tracao object and the trailers, up to 3, in the veiculo_reboque array. Both use the fields below.

Parameter Required Type Size Description
codigo_interno
string 1-10 Internal code of the vehicle
placa
string 7 License plate of the vehicle
renavam
string 9-11 RENAVAM (national vehicle registration number) of the vehicle
tara
string 1-6 Tare weight in KG
capacidade_kg
string 1-6 Capacity of the vehicle in KG
*Required for a trailer vehicle
capacidade_m3
string 1-3 Capacity of the vehicle in m3
tipo_rodado
string 2 Wheel set type
Note: send only for the tractor vehicle
01 - Truck (rigid truck, double rear axle)
02 - Toco (rigid truck, single rear axle)
03 - Cavalo Mecânico (tractor unit)
04 - VAN
05 - Utilitário (light utility vehicle)
06 - Other
tipo_carroceria
string 2 Body type
00 - not applicable
01 - Open
02 - Closed/box
03 - Bulk carrier
04 - Container carrier
05 - Sider (curtain side)
uf_licenciamento
string 2 Code of the state (UF) where the vehicle is licensed
proprietario
object --- Owner of the vehicle
Fill in only when the vehicle does not belong to the company that issues the MDF-e.

Tractor and trailer vehicle example:

{
    ...
    "veiculo_tracao": {
        "codigo_interno": "XX123",
        "placa": "ABC67H2",
        "renavam": "000000000",
        "tara": "30",
        "tipo_rodado": "01",
        "tipo_carroceria": "00",
        "uf_licenciamento": "SP",
        "proprietario": {
            "cnpj": "00.000.000/0000-00",
            "razao_social": "Proprietário 1",
            "rntrc": "00000000",
            "ie": "12345",
            "uf": "SP",
            "tipo_proprietario": "0"
        }
    },
    "veiculo_reboque": [
        {
            "codigo_interno": "XX456",
            "placa": "DEF22H1",
            "renavam": "000000000",
            "tara": "20",
            "capacidade_kg": "50",
            "tipo_carroceria": "00",
            "uf_licenciamento": "SP",
            "proprietario": {
                "cnpj": "00.000.000/0000-00",
                "razao_social": "Proprietário 2",
                "rntrc": "00000000",
                "ie": "67890",
                "uf": "SP",
                "tipo_proprietario": "0"
            }
        }
    ]
    ...
}

Issuing an MDF-e > Road > Tractor/trailer vehicle
Owner

When the vehicle does not belong to the company that issues the MDF-e, send its owner in the proprietario object. Identify the owner by CPF and name (individual) or by CNPJ and company name (company), without mixing the two. The other required fields apply when the owner is sent.

Parameter Required Type Size Description
cpf
Individual
string 11 CPF number (individual taxpayer ID)
000.000.000-00
cnpj
Company
string 14 CNPJ (company ID)
00.000.000/0000-00
nome
Individual
string 1-60 Full name. At least 2 characters for the owner of the tractor vehicle and 1 for the owner of a trailer.
razao_social
Company
string 1-60 Company name (razão social). At least 2 characters for the owner of the tractor vehicle and 1 for the owner of a trailer.
ie
string 0-14 IE (Inscrição Estadual), the state taxpayer registration of the owner
rntrc
string 8 RNTRC of the owner
uf
string 2 Code of the owner's state (UF)
tipo_proprietario
string 1 Owner type
0-TAC – Agregado (independent driver contracted to one carrier)
1-TAC Independente (independent driver)
2 – Other

Issuing an MDF-e > Road
Drivers

List the drivers of the vehicle in the condutor array, from 1 to 10. To add a driver to an MDF-e that is already authorized, use Add a driver to an MDF-e.

Parameter Required Type Size Description
cpf
string 11 CPF number
000.000.000-00
nome
string 2-60 Full name

Drivers example:

{
    ...
    "condutor": [
        {
            "cpf": "000.000.000-00",
            "nome": "Condutor 1"
        },
        {
            "cpf": "000.000.000-00",
            "nome": "Condutor 2"
        }
    ],
    ...
}

Issuing an MDF-e > Road
CIOT

Send the CIOT of the trip in the ciot array, one item per CIOT. The CIOT (Código Identificador da Operação de Transporte) is the road freight registration code of ANTT, the national land transport agency. For each item, send cpf_responsavel or cnpj_responsavel, never both.

Who can issue the CIOT? The MDF-e only reuses a CIOT that was already generated; it does not change who is allowed to generate it. In this beta phase, direct issuing through Webmania is available to an ETC not treated as a TAC (a cargo transport company without the status of an independent driver), in its own name, with an active RNTRC, using its own e-CNPJ A1 certificate whose CNPJ matches the one sent in cpf_cnpj_contratado. For a TAC (independent truck driver), a TAC-equiparado (treated as a TAC, including an ETC with up to 3 vehicles registered in the RNTRC) and a CTC (cargo transport cooperative), the code is generated by a partner Instituição de Pagamento Eletrônico de Frete (IPEF), an electronic freight payment institution. Contact Webmania to enable this channel for your company.

  • Available now: an ETC not treated as a TAC, with an active RNTRC, issuing a CIOT for an operation where it is itself the hired carrier (its own e-CNPJ A1 certificate, with a CNPJ equal to cpf_cnpj_contratado).
  • With an IPEF partner, after enablement: TAC, TAC-equiparado, CTC or a TAC-Agregado operation. Contact Webmania; the registration is made by the enabled hiring party.

To issue the CIOT directly through Webmania, see the CIOT / PEF (ANTT) API documentation.

Parameter Required Type Size Description
codigo_ciot
string 12 CIOT code
cpf_responsavel
Individual
string 11 CPF number of the party responsible for generating the CIOT
000.000.000-00
cnpj_responsavel
Company
string 14 CNPJ of the party responsible for generating the CIOT
00.000.000/0000-00

CIOT example:

{
    ...
    "ciot": [
        {
            "codigo_ciot": "000000000000",
            "cpf_responsavel": "000.000.000-00"
        },
        {
            "codigo_ciot": "000000000000",
            "cnpj_responsavel": "00.000.000/0000-00"
        }
    ],
    ...
}

Issuing an MDF-e > Road
Toll voucher

List the toll vouchers (vale-pedágio) of the trip in the vale_pedagio array, one item per receipt. For each item, send cpf_responsavel or cnpj_responsavel, never both. With a toll voucher, combinacao_veicular is also required.

Parameter Required Type Size Description
cnpj_fornecedor
string 14 CNPJ of the toll voucher supplier
00.000.000/0000-00
cpf_responsavel
Individual
string 11 CPF number of the party responsible for paying the toll voucher
000.000.000-00
cnpj_responsavel
Company
string 14 CNPJ of the party responsible for paying the toll voucher
00.000.000/0000-00
comprovante
string 1-20 Purchase receipt number
valor
string 13v2 Toll voucher value
tipo
string 2 Toll voucher type
01-TAG
04-Plate reading (by the vehicle license plate)

Toll voucher example:

{
    ...
    "vale_pedagio": [
        {
            "cnpj_fornecedor": "00.000.000/0000-00",
            "cpf_responsavel": "000.000.000-00",
            "comprovante": "00000",
            "valor": "15.00",
            "tipo": "01"
        },
        {
            "cnpj_fornecedor": "00.000.000/0000-00",
            "cnpj_responsavel": "00.000.000/0000-00",
            "comprovante": "00000",
            "valor": "12.00",
            "tipo": "01"
        }
    ],
    ...
}

Issuing an MDF-e > Road
Hiring parties

List who hired the transport service in the contratante array. For each item, send cpf or cnpj, never both.

Parameter Required Type Size Description
cpf
Individual
string 11 CPF number
000.000.000-00
cnpj
Company
string 14 CNPJ
00.000.000/0000-00

Hiring parties example:

{
    ...
    "contratante": [
        {
            "cpf": "000.000.000-00"
        },
        {
            "cnpj": "00.000.000/0000-00"
        }
    ],
    ...
}

Issuing an MDF-e > Road
Freight payment

Send the freight payment in the pagamento_frete array, one item per party responsible for the payment.

Identify the responsible party by cpf, cnpj or id_estrangeiro, only one of them. With a CNPJ, the CPF, foreign ID and name fields are discarded. With a CPF and no CNPJ, the foreign ID and the company name are discarded.

The sum of the values in componentes_pagamento_frete must match valor_contrato, with a tolerance of R$ 0.01.

Parameter Required Type Size Description
cpf
Individual
string 11 CPF number
000.000.000-00
nome
Individual
Foreign party
string 2-60 Name of the party responsible for the payment
cnpj
Company
string 14 CNPJ
00.000.000/0000-00
razao_social
Company
string 2-60 Company name (razão social) of the party responsible for the payment
id_estrangeiro
Foreign party
string 5-20 ID of the party responsible for the payment, when it is a foreign party
valor_contrato
string 13v2 Total value of the contract
forma_pagamento
string 1 Payment method indicator:
0 - Payment in full (à vista)
1 - Installment payment (a prazo)
operacao_alto_desempenho
boolean --- Transport operation that uses vehicles from dedicated or retained fleets
valor_adiantamento
string 13v2 Advance amount
Use only with installment payment
antecipar_adiantamento
boolean --- Indicator that declares agreement to bring forward the advance
Send only if bringing forward the advance is authorized
permissao_antecipacao_parcela
string 1 Permission type for bringing forward the installments:
0 - Does not allow bringing forward
1 - Allows bringing forward the installments
2 - Allows bringing forward the installments after confirmation
componentes_pagamento_frete
array 1-n Freight payment components
informacoes_bancarias
object 1 Bank details
informacoes_pagamento_prazo
array 0-n Installment payment information Required when forma_pagamento is 1 and emitente is 1 or 3, or when emitente is 2 with transportador sent. Discarded for payment in full.

Freight payment example:

{
    ...
    "pagamento_frete": [
        {
            "nome": "João Silva",
            "cpf": "000.000.000-00",
            "valor_contrato": 173.56,
            "forma_pagamento": "1",
            "valor_adiantamento": 50.45,
            "componentes_pagamento_frete": [...],
            "informacoes_bancarias": {...},
            "informacoes_pagamento_prazo": [...]
        },
        {
            "nome": "Noah Oliver",
            "id_estrangeiro": "JAU2874HBDJ",
            "valor_contrato": 1084.13,
            "forma_pagamento": "0",
            "componentes_pagamento_frete": [...],
            "informacoes_bancarias": {...}
        }
    ],
    ...
}

Issuing an MDF-e > Road > Freight payment
Freight payment components NEW

Break down the contract value in the componentes_pagamento_frete array, one item per component: toll voucher, taxes, expenses, freight or other.

Parameter Required Type Size Description
tipo_componente
string 2 Component type:
01 - Toll voucher
02 - Taxes, fees and contributions
03 - Expenses (bank, payment methods, other)
04 - Freight
99 - Other
valor_componente
string 13v2 Component value
descricao_componente
string 2-60 Component descriptionSend only if the component type is 99 – Other

Freight payment components example:

{
    ...
    "componentes_pagamento_frete": [
        {
            "tipo_componente": "01",
            "valor_componente": 976.34
        },
        {
            "tipo_componente": "99",
            "valor_componente": 80.54,
            "descricao_componente": "Taxa de estadia"
        }
    ],
    ...
}

Issuing an MDF-e > Road > Freight payment
Bank details NEW

Send how the freight will be received in the informacoes_bancarias object: bank and branch, the CNPJ of the electronic freight payment institution (IPEF) or a Pix key (Pix is Brazil's instant payment system), according to tipo_informacao_bancaria. Send only the fields of the chosen type: the fields of the other types are discarded.

Parameter Required Type Size Description
tipo_informacao_bancaria
string 1 Bank information type
1 - Bank and branch
2 - CNPJ of the electronic freight payment institution (IPEF)
3 - Pix key to receive the freight
numero_banco
string 3-5 Bank number
Required if the bank information type is 1 - Bank and branch
numero_agencia
string 1-10 Bank branch number
Required if the bank information type is 1 - Bank and branch
cnpj_ipef
string 14 CNPJ of the electronic freight payment institution (IPEF)
Required if the bank information type is 2 - CNPJ of the electronic freight payment institution
pix
string 2-60 Pix key to receive the freight: email, valid CPF/CNPJ, random key (UUID) or phone number with area code (DDD), without the +55 prefix.
Required if tipo_informacao_bancaria is 3.

Bank details examples, by bank and branch and by Pix key:

{
    ...
    "informacoes_bancarias": {
        "tipo_informacao_bancaria": "1",
        "numero_banco": "091",
        "numero_agencia": "001"
    },
    ...
}
{
    ...
    "informacoes_bancarias": {
        "tipo_informacao_bancaria": "3",
        "pix": "frete@example.com"
    },
    ...
}

Issuing an MDF-e > Road > Freight payment
Installment payment information NEW

For installment payment, list the installments in the informacoes_pagamento_prazo array. The installments are numbered automatically from 001, in the order of the array. The group is required when forma_pagamento is 1 and emitente is 1 or 3, or when emitente is 2 with transportador sent. For payment in full, it is discarded.

Parameter Required Type Size Description
data_vencimento_parcela
string 10 Installment due date
Format Y-m-d
valor_parcela
string 13v2 Installment value

Installment payment example:

{
    ...
    "informacoes_pagamento_prazo": [
        {
            "data_vencimento_parcela": "2004-01-02",
            "valor_parcela": 976.34
        }
    ],
    ...
}

Issuing an MDF-e
Air

The air mode describes transport by airplane: the aircraft, the flight and the departure and destination airfields. Send the data in the aereo object, which is required when modalidade is 2.

Parameter Required Type Size Description
nacionalidade_aeronave
string 1-4 Nationality mark of the aircraft
matricula_aeronave
string 1-6 Registration mark of the aircraft
numero_voo
string 5-9 Flight number
Format = AB1234, where AB is the airline code and 1234 is the flight number. When this is not possible, use the nationality and registration marks without a hyphen.
aerodromo_embarque
string 3-4 Departure airfield
Enter the three-letter IATA code of the departure airport first. When this is not possible, use the ICAO code.
aerodromo_destino
string 3-4 Destination airfield
Enter the three-letter IATA code of the destination airport first. When this is not possible, use the ICAO code.
data_voo
string 10 Flight date
Format Y-m-d

Example of the air mode:

{
    ...
    "aereo": {
        "nacionalidade_aeronave": "XXXX",
        "matricula_aeronave": "XXXXXX",
        "numero_voo": "AB1234",
        "aerodromo_embarque": "AB1",
        "aerodromo_destino": "AB2",
        "data_voo": "2022-07-11"
    }
    ...
}

Issuing an MDF-e
Water

The water mode describes transport by vessel: the ship, the voyage, the ports and, when they apply, the terminals, the convoy and the empty units. Send the data in the aquaviario object, which is required when modalidade is 3.

Parameter Required Type Size Description
irin
string 1-10 IRIN of the ship (its international radio identification)
tipo_embarcacao
string 2 Vessel type code
Use a code from the Vessel Type Table defined by the Brazilian Ministry of Transport
codigo_embarcacao
string 1-10 Vessel code
nome_embarcacao
string 1-60 Vessel name
numero_viagem
string 1-10 Voyage number. Send 1 to 10 digits, with no leading zero.
codigo_porto_embarque
string 1-5 Port of departure code
Use the Port Table defined by the Brazilian Ministry of Transport
codigo_porto_destino
string 1-5 Port of destination code
Use the Port Table defined by the Brazilian Ministry of Transport
porto_transbordo
string 1-60 Transshipment port
tipo_navegacao
number 1 Navigation type
0 - Inland
1 - Coastal (cabotage)
Number or numeric string.
mmsiNEW
string 9 Maritime Mobile Service Identity (MMSI). Send all 9 digits and keep leading zeros.
terminal_carregamento
array 0-5 Information about the loading terminals
terminal_descarregamento
array 0-5 Information about the unloading terminals
embarcacao_comboio
array 0-30 Information about the convoy vessels
carga_vazia
array 0-n Information about the empty cargo units
transporte_vazio
array 0-n Information about the empty transport units

Example of the water mode:

{
    ...
    "aquaviario": {
        "irin": "XXXX12345",
        "tipo_embarcacao": "01",
        "codigo_embarcacao": "AB12345",
        "nome_embarcacao": "Embarcação 1",
        "numero_viagem": "12345",
        "codigo_porto_embarque": "XXXXX",
        "codigo_porto_destino": "XXXXX",
        "terminal_carregamento": [
            {
                "codigo": "TC1",
                "nome": "Terminal Carregamento 1"
            }
        ],
        "terminal_descarregamento": [
            {
                "codigo": "TD1",
                "nome": "Terminal Descarregamento 1"
            }
        ],
        "embarcacao_comboio": [
            {
                "codigo": "EC1",
                "identificador_balsa": "Balsa 1"
            }
        ],
        "carga_vazia": [
            {
                "identificador": "UCV1",
                "tipo_unidade": 1
            }
        ],
        "transporte_vazio": [
            {
                "identificador": "UTV1",
                "tipo_unidade": 1
            }
        ]
    }
    ...
}

Issuing an MDF-e > Water
Loading/unloading terminals

Send the terminals in the terminal_carregamento and terminal_descarregamento arrays, up to 5 in each. Both use the fields below.

Parameter Required Type Size Description
codigo
string 1-8 Terminal code
Use the Loading/Unloading Terminals Table. The code of each port is defined by the Brazilian Ministry of Transport.
nome
string 1-60 Terminal name

Issuing an MDF-e > Water
Convoy vessels

Send the vessels of the convoy in the embarcacao_comboio array, up to 30.

Parameter Required Type Size Description
codigo
string 1-10 Code of the convoy vessel
identificador_balsa
string 1-60 Barge ID

Issuing an MDF-e > Water
Empty cargo units

Send the empty cargo units in the carga_vazia array, one item per unit.

Parameter Required Type Size Description
identificador
string 1-20 Unit ID
tipo_unidade
number 1 Unit type
1 - Container
2 - ULD
3 - Pallet
4 - Others

Issuing an MDF-e > Water
Empty transport units

Send the empty transport units in the transporte_vazio array, one item per unit.

Parameter Required Type Size Description
identificador
string 1-20 Unit ID
tipo_unidade
number 1 Unit type
1 - Road tractor (truck)
2 - Road trailer (semi-trailer)

Issuing an MDF-e
Rail

The rail mode describes transport by train: the train consist and the wagons. Send the data in the ferroviario object, which is required when modalidade is 4.

Parameter Required Type Size Description
trem
object --- Information about the train consist
vagoes
array 1-999 Information about the wagons. The quantity is calculated from the array.

Example of the rail mode:

{
    ...
    "ferroviario": {
        "trem": {
            "prefixo": "ABC123",
            "data_liberacao": "2022-07-11 10:00:00",
            "origem": "A12",
            "destino": "B34"
        },
        "vagoes": [
            {
                "peso_bc": "0.000",
                "peso_real": "0.000",
                "tipo_vagao": "ABC",
                "serie": "XYZ",
                "numero": "110",
                "sequencia_vagao": "1",
                "tonelada_util": "0.000"
            },
            {
                "peso_bc": "0.000",
                "peso_real": "0.000",
                "tipo_vagao": "ABC",
                "serie": "XYZ",
                "numero": "120",
                "sequencia_vagao": "2",
                "tonelada_util": "0.000"
            }
        ]
    }
    ...
}

Issuing an MDF-e > Rail
Train

Send the train consist in the trem object.

Parameter Required Type Size Description
prefixo
string 1-10 Train prefix (train ID)
data_liberacao
string 19 Date and time the train was released at the origin
Format Y-m-d H:i:s
origem
string 1-3 Code of the train's origin station
destino
string 1-3 Code of the train's destination station

Issuing an MDF-e > Rail
Wagons

Send the wagons of the train in the vagoes array, from 1 to 999 items.

Parameter Required Type Size Description
peso_bc
string 3v3 Weight used to calculate the freight, in tonnes. Accepts a number or a numeric string up to 999.999. The value is rounded to an integer when the XML is generated.
peso_real
string 3v3 Actual weight in tonnes. Accepts a number or a numeric string up to 999.999. The value is rounded to an integer when the XML is generated.
tipo_vagao
string 3 Wagon type
serie
string 3 Identification series
numero
string 1-8 Identification number
sequencia_vagao
string 1-3 Position in the train consist
tonelada_util
string 3v3 Payload in tonnes

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 recipient or, if there is none, of the issuer, 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]
For the MDF-e, the password used to generate the token is the CPF/CNPJ of the recipient or, if there is none, of the issuer.
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 recipient or, if there is none, of the issuer (numbers only, no punctuation).
PDF = password-protected PDF file
XML = password-protected ZIP file

For the MDF-e, the password is the CPF/CNPJ of the recipient or, if there is none, of the issuer, with no punctuation and with capital letters (alphanumeric CNPJ).

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/damdfe/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. For the MDF-e, use the CPF/CNPJ of the recipient or, if there is none, of the issuer to generate the token. Without this ID, 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/damdfe/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 an MDF-e

The lookup returns the current status of an MDF-e of the authenticated company, including while it is processando or contingencia. Use the notifications to follow your documents day to day. Use the lookup to check one MDF-e when you need to.

To look up an MDF-e, send a GET request to the URL /2/mdfe/consulta/{key}. Replace {key} with the UUID (36 characters) or the access key (44 characters) of the MDF-e. Do not send a request body.

Request example:

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

Example of an HTTP 200 response. The fields are described in Notification fields. serie and motivo can be null, and log is an object or array, not a JSON string. When the MDF-e is not found, the body includes error.

{
  "uuid": "90d30c80-d0be-4c8f-a749-a818989222ca", // Unique ID
  "chave": "00000000000000000000000000000000000000000000", // Access key at SEFAZ
  "status": "aprovado", // aprovado, reprovado, cancelado, encerrado, processando, contingencia or denegado
  "motivo": "Autorizado o uso da MDF-e", // Reason for the status
  "serie": 1, // MDF-e series
  "mdfe": 123, // MDF-e number
  "xml": "https://api.webmania.com.br/xmlmdfe/[chave]",
  "damdfe": "https://api.webmania.com.br/damdfe/[chave]",
  "log": {} // Sample object; reply content from SEFAZ
}

Functions
Close an MDF-e

Closing registers the end of the transport at SEFAZ. Close the MDF-e every time a delivery is complete: this is how the end of the transport service is recognized. Only an MDF-e with status aprovado can be closed. A closed MDF-e no longer accepts cancellation or new drivers.

To close an MDF-e, send a PUT request to the URL /2/mdfe/encerrar. Send the uuid or the chave of the MDF-e and the place where the trip ended: uf and municipio together, or codigo_municipio. When you send the code, it takes priority to identify the city.

Parameter Required Type Size Description
uuid | chave
string 36 | 44 Send at least one identifier: the UUID (36 characters) or the access key (44 characters). If you send both, the access key takes priority.
uf
string 2 Two-letter code of the state where the trip ended. Required when codigo_municipio is not sent.
municipio
string 2-60 City where the trip ended. Required when codigo_municipio is not sent.
codigo_municipio
string 7 7-digit IBGE code (official city code) of the city where the trip ended. Required when uf or municipio is not sent. It replaces the city name and state pair.

Request example:

curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
   "chave": "00000000000000000000000000000000000000000000",
   "uf": "PR",
   "municipio": "Curitiba"
}' \
https://api.webmania.com.br/2/mdfe/encerrar

The response includes status, motivo and log. When the closing is registered, it also includes the xml. For the other data of the document, use the lookup.

SituationResponseWhat to do
Closing registeredstatus = encerradoThe MDF-e is closed. Webmania also sends the encerrado notification.
Closing rejected by SEFAZstatus = reprovado, no xmlThe MDF-e keeps the status aprovado. Read the motivo before you try again.
Request not processed by SEFAZerrorRead the error message, fix what it points to and try again.

Example of an HTTP 200 response for a registered closing. The content of motivo comes from the SEFAZ reply; this example is for illustration only:

{
  "status": "encerrado",
  "motivo": "Evento registrado e vinculado ao MDF-e",
  "xml": "https://api.webmania.com.br/xmlmdfe/[chave]/",
  "log": {} // Sample object; reply content from SEFAZ
}

Functions
Cancel an MDF-e

Cancellation registers an event at SEFAZ that voids an authorized MDF-e, for example when the trip does not happen. Once canceled, the MDF-e cannot be used for transport. Only an MDF-e with status aprovado can be canceled: a closed MDF-e does not accept cancellation.

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

Parameter Required Type Size Description
uuid | chave
string 36 | 44 Send at least one identifier: the UUID (36 characters) or the access key (44 characters). If you send both, the access key takes priority.
justificativa
string 15-255 Reason for the cancellation

Request example:

curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
   "chave": "00000000000000000000000000000000000000000000",
   "justificativa": "Cancelado por motivos administrativos."
}' \
https://api.webmania.com.br/2/mdfe/cancelar

The response includes status, motivo and log. When the cancellation is registered, it also includes the xml. For the other data of the document, use the lookup.

SituationResponseWhat to do
Cancellation registeredstatus = canceladoDo not use this MDF-e for transport. Webmania also sends the cancelado notification.
Cancellation rejected by SEFAZstatus = reprovado, no xmlThe MDF-e keeps the status aprovado. Read the motivo before you try again.
Request not processed by SEFAZerrorRead the error message, fix what it points to and try again.

Example of an HTTP 200 response for a registered cancellation. The content of motivo comes from the SEFAZ reply, not from the reason you sent; this example is for illustration only:

{
  "status": "cancelado",
  "motivo": "Evento registrado e vinculado ao MDF-e",
  "xml": "https://api.webmania.com.br/xmlmdfe/[chave]/",
  "log": {} // Sample object; reply content from SEFAZ
}

Functions
Add a driver to an MDF-e

Adding a driver registers a new driver at SEFAZ on an authorized road transport MDF-e. The MDF-e keeps the status aprovado. A driver can only be added while the MDF-e is not closed or canceled.

To add a driver, send a PUT request to the URL /2/mdfe/condutor, with the uuid or the chave of the MDF-e and the nome (name) and cpf of the new driver.

Parameter Required Type Size Description
uuid | chave
string 36 | 44 Send at least one identifier: the UUID (36 characters) or the access key (44 characters). If you send both, the access key takes priority.
cpf
string 11 Valid CPF (individual taxpayer ID) of the driver. Send the 11 digits without punctuation: the value goes to the event as sent, and any formatting is not removed.
nome
string 1-60 Name of the driver. Required, up to 60 characters.

Request example:

curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
   "chave": "00000000000000000000000000000000000000000000",
   "cpf": "00000000000",
   "nome": "Novo Condutor"
}' \
https://api.webmania.com.br/2/mdfe/condutor

The response includes status, motivo and log. When the driver is added, it also includes the xml. Here, status is the result of the event:

SituationResponseWhat to do
Driver addedstatus = aprovadoThe driver was registered and the MDF-e is still authorized. Adding a driver does not send a notification: store this response.
Driver rejected by SEFAZstatus = reprovado, no xmlThe driver was not added. Read the motivo before you try again.
Request not processed by SEFAZerrorRead the error message, fix what it points to and try again.

Example of an HTTP 200 response for an added driver. The content of motivo comes from the SEFAZ reply; this example is for illustration only:

{
  "status": "aprovado",
  "motivo": "Evento registrado e vinculado ao MDF-e",
  "xml": "https://api.webmania.com.br/xmlmdfe/[chave]/",
  "log": {} // Sample object; reply content from SEFAZ
}

Contingency mode and processing

Webmania® detects automatically when SEFAZ is offline or has not returned a result yet. It completes the MDF-e without your application having to send anything again:

SituationStatusWhat Webmania does
SEFAZ has not returned the result yetprocessandoChecks SEFAZ automatically until it gets the result.
SEFAZ is unavailablecontingenciaKeeps the MDF-e in a queue and sends it again automatically. Before sending it again, it checks SEFAZ so the same MDF-e is not issued twice.
From request to final result: MDF-e When it receives the POST /2/mdfe/emissao, Webmania checks whether SEFAZ (the state tax authority) is available. When the authorizer is available, the MDF-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 MDF-e gets the contingencia status: Webmania checks SEFAZ, looks up the MDF-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/mdfe/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 MDF-e before resending Automatic resend only if SEFAZ did not receive the MDF-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 MDF-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 MDF-e again.

Contingency mode and processing
MDF-e in processing

The MDF-e is sent to SEFAZ synchronously, but a temporary reply can keep the status processando. This status does not mean authorization. Follow the same document through the lookup before you request a new issue.

The status contingencia also does not prove that SEFAZ authorized the document. It does not mean the document was authorized in an alternative environment either. Neither status is notified; your url_notificacao receives the final result. See Notifications.

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. v1.4.4 · November 17, 2026 · Documentation · Changed

    The processing and contingency sections now have a flowchart from the request to the final result, with the statuses that are not final and the automatic resend.

    Changed section: contingencia

  2. v1.4.3 · 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.