The Webmania® REST API looks up, stores and downloads the tax documents issued to your company's CNPJ (the 14-digit company ID) or CPF (the 11-digit individual taxpayer ID). It also picks up documents that list your company in the autXML tag, the field where the issuer names other parties allowed to download the XML. It sends a notification for each document and event, and lets you list, look up, acknowledge and export each document. To start, read the Quick guide.
To use your company's own documents when calculating tax payment slips, see importing tax documents for payment slips. The Fiscal Monitor service must be active.
What is the Fiscal Monitor? It is the service that collects and organizes the tax documents in which your company appears: invoices for goods (NF-e), service invoices (NFS-e), freight bills (CT-e), cargo manifests (MDF-e) and consumer receipts (NFC-e). It collects the documents issued to your CNPJ or CPF, those that name your company in the autXML tag and, depending on the document type, those your company issued. It collects them from SEFAZ (the state tax authority), from the national NFS-e data environment (ADN) and from the city halls (prefeituras). See what each document type covers in Document types.
Each registered company is checked automatically and regularly, at most once an hour, for the document types chosen in modelos_download.
With dfe_retroativas, the company also receives the documents issued before it was registered. Once you turn this option on, you cannot turn it off.
Bring in documents by access key, by XML in Base64, or by a ZIP file with up to 5,000 XML files.
One account monitors many companies. Each one has its own digital certificate (Certificado Digital A1) and its own document types.
For an NF-e issued to it, the company confirms or rejects the transaction through the API (manifestação do destinatário). Before that, only a summary of the NF-e is available; after it, the full XML is downloaded.
Export the documents in XML, CSV, Excel or PDF, with the same filters as the listing.
Brazilian tax terms you will see. They keep their Brazilian names in the payload and in the documents:
NF-e / NFC-e: the invoice for goods and the consumer receipt. SEFAZ authorizes them.
CT-e / MDF-e: the freight bill and the cargo manifest of a shipment. SEFAZ authorizes them.
NFS-e: the service invoice. The city hall (prefeitura) or the national standard (Padrão Nacional) authorizes it; those under the national standard are stored in the ADN.
SEFAZ: the state tax authority, one per state and the Federal District.
Chave de acesso: the 44-digit access key of an NF-e, NFC-e, CT-e or MDF-e; a national NFS-e has a 50-digit key. Used to import and look up documents.
Manifestação do destinatário: the buyer confirms or rejects the transaction of an NF-e issued to it.
CFOP / NCM: the 4-digit transaction code and the 8-digit product classification code of each invoice line. Used by the cfop and ncm filters of the document list.
CNPJ / CPF: the company ID (14 digits) and the individual taxpayer ID (11 digits) the documents are issued to.
Every term in plain English: glossary of Brazilian tax terms.
Send every API request over encrypted HTTPS to https://api.webmania.com.br. Every request URL starts with the /2/monitor prefix.
| URL | HTTP Verb | Function |
|---|---|---|
/2/monitor/empresas | POST | Register a new company |
/2/monitor/empresas/{empresa_uuid}/municipios-nfse | POST | Register monitoring for a city (NFS-e) |
/2/monitor/documentos | POST | List or export tax documents |
/2/monitor/documentos/{uuid}/eventos | POST | Register the recipient acknowledgment |
/2/monitor/documentos/importacoes | POST | Import documents |
/2/monitor/empresas | GET | List all registered companies |
/2/monitor/empresas/{uuid} | GET | Get a company by UUID |
/2/monitor/empresas/{empresa_uuid}/municipios-nfse | GET | List the company's monitored cities |
/2/monitor/municipios-nfse | GET | List the cities available for NFS-e |
/2/monitor/documentos/{uuid} | GET | Get a document by UUID |
/2/monitor/documentos/{uuid}/eventos | GET | List the events of a document |
/2/monitor/estatisticas/downloads | GET | Get the number of documents downloaded in a period |
/2/monitor/empresas/{uuid} | PUT | Update a company's data |
/2/monitor/empresas/{empresa_uuid}/municipios-nfse/{uuid} | PUT | Update a monitored city's credentials (NFS-e) |
/2/monitor/empresas/{empresa_uuid}/municipios-nfse/{uuid} | DELETE | Stop monitoring a city (NFS-e) |
Data responses are in JSON. A report download returns the file itself. Send Authorization: Bearer YOUR_ACCESS_TOKEN in every call, and Content-Type: application/json in the calls that have a body. See Authentication and Response format.
How to integrate the Fiscal Monitor:
Authorization header. /2/monitor/empresas, with the CNPJ or CPF, the digital certificate (Certificado Digital A1) and the url_notificacao. Store the company's uuid in your system. modelos_download, only the NF-e is monitored. For NFS-e (service invoices) from a city outside the ADN and without a native integration, register the credentials in NFS-e cities. url_notificacao for each collected document (tipo_notificacao 1) and for each event (tipo_notificacao 2). Store the uuid of each document. /2/monitor/documentos, with filters, or GET to /2/monitor/documentos/{uuid}, which returns the XML and the PDF in docs. /2/monitor/documentos/{uuid}/eventos to confirm or reject the transaction. To find NF-e still available only as a summary and awaiting your acknowledgment, filter by status = pendente. The Fiscal Monitor starts working as soon as you register the company. From then on, each document follows the path below, from collection to acknowledgment and later events:
url_notificacao, no notification is sent: track the documents through the document list. Documents that you import do not trigger the type 1 notification.Every collected document gets a uuid and a status. Both appear in the document list, the lookup and the notifications. The status changes when the Fiscal Monitor collects an event for the document:
| Status | What it means | What to do |
|---|---|---|
aprovado | The document is authorized. No cancellation or closing event is registered. | Use the XML and the PDF in docs. For an NF-e you received, send the recipient acknowledgment for the transaction. |
cancelado | The document was canceled or, for an NFS-e, replaced by another invoice. | Update the document in your system. The event is in List events. |
encerrado | The MDF-e (cargo manifest) was closed. | Update the MDF-e in your system. The event is in List events. |
For events that change the status, the type 2 notification also includes the documento field with the updated document. See the events of each document type in List events.
Take this reference to your AI assistant, integrate the API with an official SDK, or start from the ready-made modules and examples.
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.
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
git clone https://github.com/
Python Available
git clone https://github.com/
PHP Available
git clone https://github.com/
Perl Available
git clone https://github.com/
Go Available
git clone https://github.com/
C Available
git clone https://github.com/
C++ Available
git clone https://github.com/
Lua Available
git clone https://github.com/
Dart Available
git clone https://github.com/
R Available
git clone https://github.com/
Java Available
git clone https://github.com/
Kotlin Available
git clone https://github.com/
Scala Available
git clone https://github.com/
Clojure Available
git clone https://github.com/
Ruby Available
git clone https://github.com/
.NET (C#) Available
git clone https://github.com/
PowerShell Available
git clone https://github.com/
Elixir Available
git clone https://github.com/
Rust Available
git clone https://github.com/
Haskell Available
git clone https://github.com/
Swift Available
git clone https://github.com/
Authenticate every API request with the Authorization HTTP header, in this format:
Authorization: Bearer {Access-Token} The Access-Token is the Fiscal Monitor token of your account. Generate it in the Webmania® Panel, under Configurações › Credenciais › Monitor Fiscal (Settings › Credentials › Fiscal Monitor). The token is shown only once, when you generate it. 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 others can easily read it.
For mobile apps (iOS and Android), we recommend calling the API from your server (back end). The app should only send the request; your server makes the API call.
The API returns data in JSON format. A report download returns the file with Content-Type: application/octet-stream, instead of JSON.
The HTTP code tells you whether the request succeeded:
| Code | Meaning | Success | Description |
|---|---|---|---|
200 | OK | Successful lookups, updates and deletions (GET, PUT and DELETE), and POST operations such as listing, event registration and document import. | |
201 | Created | Registration of companies and of cities for NFS-e monitoring (POST). | |
400 | Bad Request | The request is malformed or has invalid parameters in the body. | |
401 | Unauthorized | Authentication failed. Check the access token you sent. | |
403 | Forbidden | Access denied. You do not have permission for this operation. |
Example of an HTTP 400 response. The API returns error messages in Portuguese; this one means "Invalid parameter: cnpj. The value ABCD is not a valid CNPJ.":
{
"error": "Parâmetro inválido: cnpj. O valor ABCD não é um CNPJ válido."
}The Fiscal Monitor API looks up, downloads and stores tax documents according to the download direction in which your company appears: Received (issued to the company's CNPJ/CPF) and Issued (issued by the company itself). The supported document types are:
| Type | Code | Coverage | Received | Issued (by the company) | Description |
|---|---|---|---|---|---|
| NF-e | nfe | Nationwide | Electronic invoice for goods (Nota Fiscal Eletrônica) | ||
| NFS-e | nfse | Nationwide (ADN) + Cities | Service invoice (Nota Fiscal de Serviço Eletrônica) | ||
| CT-e | cte | Nationwide | Freight bill (Conhecimento de Transporte Eletrônico) | ||
| CT-e OS | cte_os | Nationwide | Passenger and other transport bill (Conhecimento de Transporte Eletrônico para Outros Serviços) | ||
| GTV-e | gtve | Nationwide | Valuables transport bill (Guia de Transporte de Valores Eletrônica) | ||
| MDF-e | mdfe | Nationwide | Cargo manifest (Manifesto Eletrônico de Documentos Fiscais) | ||
| NFC-e | nfce | SP | Consumer receipt (Nota Fiscal de Consumidor Eletrônica) |
Legend: = the Fiscal Monitor downloads the XML in this direction; = it does not download; = available only under certain conditions (see the document type's table below). For NF-e, CT-e, CT-e OS, GTV-e and MDF-e, the Issued direction is ❌ because the law requires the issuer to keep the XML for 5 years.
Collection runs automatically, at most once an hour. It fetches received invoices (issued to the company's CNPJ/CPF, plus those that name the CNPJ/CPF in the autXML tag) or issued ones. For NFS-e, invoices for services received and provided are collected from the national data environment (Ambiente de Dados Nacional, ADN) in every city that has joined the ADN, and through direct integration with city halls that have not joined it, such as São Paulo.
The tables below show the roles a company can have in a tax document:
| Role | Description | |
|---|---|---|
Issued | ❌ | The system does not download the tax document when the company is its issuer. The law requires the issuer to store the XML of the issued document for 5 years. |
Recipient | ✅ | The system downloads the full XML of the document after the company sends its recipient acknowledgment. Until then, SEFAZ shares only a summary of the NF-e. For an NF-e summary with no acknowledgment yet, Webmania automatically registers the acknowledgment "Ciência da Operação" (awareness of the transaction) if the document was issued less than 10 days ago. Otherwise, you must send the acknowledgment yourself. |
Carrier | ✅ | The system downloads the full XML when the company is named as the carrier (transportador) in the tax document, in group X03 of the XML. |
Third parties | ✅ | The system downloads the full XML when the company's CNPJ/CPF is listed in the autXML tag of the tax document. |
| Role | Description | |
|---|---|---|
Issuer | ✅ | Downloads the full XML of the invoices for services provided by the company. They are collected from the national data environment (ADN) in every city that has joined the ADN, and through direct integration with city halls that have not joined it, such as São Paulo, for companies located in those cities. Collection from the ADN is automatic and does not depend on the list of available cities. |
Recipient | ✅ | Downloads the full XML of the document when the company is named as the recipient (tomador) of the services. It is collected from the national data environment (ADN) when the NFS-e is issued in a city that has joined the ADN, and through direct integration with city halls that have not joined it (see the list of available cities). Collection from the ADN is automatic and does not depend on that list. |
| Role | Description | |
|---|---|---|
Issuer | ❌ | The system does not download the tax document when the company is its issuer. The law requires the issuer to store the XML of the issued document for 5 years. |
Sender | ✅ | Downloads the full XML when the company is named as the sender (remetente) in the tax document. |
Consignee | ✅ | Downloads the full XML when the company is named as the consignee (destinatário) in the tax document. |
Receiver | ✅ | Downloads the full XML when the company is named as the receiver (recebedor) in the tax document. |
Shipper | ✅ | Downloads the full XML when the company is named as the shipper (expedidor) in the tax document. |
Service taker | ✅ | Downloads the full XML when the company is named as the service taker (tomador, the party that pays for the freight) in the tax document. |
Third parties | ✅ | The system downloads the full XML when the company's CNPJ/CPF is listed in the autXML tag of the tax document. |
| Role | Description | |
|---|---|---|
Issuer | ❌ | The system does not download the tax document when the company is its issuer. The law requires the issuer to store the XML of the issued document for 5 years. |
Service taker | ✅ | Downloads the full XML when the company is named as the service taker (tomador) in the tax document. |
Third parties | ✅ | The system downloads the full XML when the company's CNPJ/CPF is listed in the autXML tag of the tax document. |
| Role | Description | |
|---|---|---|
Issuer | ❌ | The system does not download the tax document when the company is its issuer. The law requires the issuer to store the XML of the issued document for 5 years. |
Service taker | ✅ | Downloads the full XML when the company is named as the service taker (tomador) in the tax document. |
Third parties | ✅ | The system downloads the full XML when the company's CNPJ/CPF is listed in the autXML tag of the tax document. |
| Role | Description | |
|---|---|---|
Issuer | ❌ | The system does not download the tax document when the company is its issuer. The law requires the issuer to store the XML of the issued document for 5 years. |
Hiring party | ✅ | Downloads the full XML when the company is the party that hired the transport service in road transport. |
Vehicle owner | ✅ | Downloads the full XML when the company owns the transport vehicle in road transport. |
Third parties | ✅ | The system downloads the full XML when the company's CNPJ/CPF is listed in the autXML tag of the tax document. |
| Role | Description | |
|---|---|---|
Issuer | ✅ | Downloads through the SAE-NFC-e service of SEFAZ-SP (the São Paulo state tax authority). The company is identified by the CNPJ of its digital certificate A1 (e-CNPJ), so only the documents issued by the company itself are returned. The first window covers the current month. You can extend it up to 100 days back with the dfe_retroativas parameter. |
Recipient / Consumer | ❌ | There is no NFC-e distribution service for the recipient. NFeDistribuicaoDFe refuses model 65 (rejection 618), and the state distribution service only works between tax authorities, so a company certificate cannot use it. |
Availability | ✅ | Only companies with UF = SP. Requires a digital certificate (Certificado Digital A1). |
To keep your platform up to date, Webmania® sends automatic notifications for each collected document and each registered event. With notifications, you do not need to poll the API for new documents: wait for the webhook and update the document in your system when it arrives.
The notification is sent by POST, in JSON, to the url_notificacao set when you register or update the company. The tipo_notificacao field tells you what happened:
| tipo_notificacao | When it is sent |
|---|---|
1 | The Fiscal Monitor collected a tax document or updated its data. data contains the document, in the same format as the lookup. |
2 | An event was registered for the document. data contains the event and, for events that change the status, documento contains the updated document. |
3 | The company's digital certificate (Certificado Digital A1) expires within the next 15 days. data contains the company. |
5 | A ZIP file import has finished. data contains the batch, with importados and descartados. See Import by XML. |
url_notificacao, no notification is sent. Documents you import by access key or by XML do not trigger the type 1 notification: the import response already has the document.What is the UUID? The UUID (Universally Unique Identifier) is a unique 36-character ID, in the 8-4-4-4-12 format. Webmania assigns one to each tax document and each event.
Unlike the issuing APIs, here the UUID is created when the Fiscal Monitor finds and registers the document or the event, not when you issue something. It exists regardless of the document status at the SEFAZ (the state tax authority).
Once created, the UUID is permanent and does not change. The access key is a different field: it is the number that identifies the document at the tax authority. So use the UUID, not the access key, as your reference in your database.
The notification body has the fields below:
| Parameter | Type | Description |
|---|---|---|
tipo_notificacao | integer | Notification type1 - Tax documents |
data | object | Tax document, event, company or import dataType 1: tax document data |
documento | object | Document related to the eventDocument object, which varies by document type |
tipo_notificacao = 3) are scheduled daily for certificates that have not expired yet and expire in the next 15 days. Once the certificate has expired, it is no longer included in these notifications.The notification is sent as a POST request in application/json format:
-X POST \
-header "Content-type: application/json" \ Example notification of an MDF-e closing event (encerramento), which changes the document status:
{
"tipo_notificacao": 2,
"data": {
"uuid": "00000000-0000-0000-0000-000000000000",
"documento_uuid": "00000000-0000-0000-0000-000000000000",
"protocolo": "0000000000000000",
"registrado_em": "2025-06-02 13:17:00",
"tipo_evento": 110112,
"descricao_evento": "Encerramento",
"cnpj_autor": "00000000000000",
"cpf_autor": "00000000000",
"resumo": false,
"data_encerramento": "2025-06-02 13:15:00",
"cidade_encerramento": "XXXXXXXX",
"uf_encerramento": "XX",
"log": {}
},
"documento": {
"uuid": "00000000-0000-0000-0000-000000000000",
"empresa_uuid": "00000000-0000-0000-0000-000000000000",
"modelo": "mdfe",
"status": "encerrado",
"categoria": "citadas",
"data_emissao": "2025-02-03 08:43:00",
"numero": 500,
...
}
} The Fiscal Monitor works by automatically monitoring the documents issued to the CNPJ (company ID) or CPF (individual taxpayer ID) of the registered companies. You cannot access a company's tax documents until you register it.
This section covers registering, updating, retrieving and listing companies, and setting up the NFS-e cities that require credentials.
The registration saves the company, with its digital certificate (Certificado Digital A1), and starts monitoring its tax documents. The uuid in the response identifies the company in all other calls.
To register a company, send a POST request to /2/monitor/empresas, with the parameters below in the request body.
Without modelos_download, monitoring starts with the NF-e only. If you send this parameter, send the full list of document types you want to monitor, including nfe to keep the NF-e. Here is how monitoring starts for each document type:
| Type | How monitoring starts |
|---|---|
NF-enfe | Automatically, when you register the company. You can remove it from modelos_download at any time. |
CT-e and MDF-ecte, mdfe | Automatically, after you add them to modelos_download. |
NFS-enfse | After you add it to modelos_download, check whether the city has a native integration. If it does not, register the credentials for the city. |
NFC-enfce | Only for companies with UF = SP, with a digital certificate A1 and opt-in activation. Returns only the receipts issued by the company itself, identified by the CNPJ of the A1 certificate (e-CNPJ). dfe_retroativas controls the look-back of up to 100 days. See NFC-e. |
Request parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
cnpjCompany | string | Valid CNPJ (company ID) of the company, not already used by another registered company00.000.000/0000-00. On registration, required when cpf is not sent. | |
razao_socialCompany or individual | string | Legal name of the company, or name of the individualAlso required when you register with cpf. From 2 to 150 characters. | |
cpfIndividual | string | Valid CPF (individual taxpayer ID) of the individual, not already used by another registered company000.000.000-00. On registration, required when cnpj is not sent. | |
nome_completoResponse only | string | Output field for an individual; it is not an input parameter. To send the name when you register or update, use razao_social. | |
im | string | City registration (Inscrição Municipal), optional when you register or update the companyWhen sent, it must have at least 3 digits. To see what city monitoring requires, check the city. | |
cep | string | Valid CEP (postal code) of the company's addressWhen sent, it cannot be empty. | |
certificado_base64 | string (Base64) | Valid, unexpired digital certificate A1 that matches the company's CPF or CNPJ. On update, required when certificado_senha is sent. Learn more (in Portuguese) | |
certificado_senha | string | Password for the digital certificate A1, with at least 1 characterRequired when certificado_base64 is sent; send both fields together. | |
url_notificacao | string | Valid, non-empty URL of the webhook that receives the notifications Notifies new tax documents received, status updates and other events for the monitored tax documents. | |
modelos_download | array | Monitored tax document types. When sent, it must have 1 to 5 items. If left out, the default is ["nfe"]. nfe (default) Note: nfce = NFC-e (model 65). Download is available ONLY for companies with UF = SP, and requires a digital certificate A1 and opt-in activation. Returns only the receipts issued by the company itself, identified by the CNPJ of the A1 certificate. The dfe_retroativas parameter controls the look-back of up to 100 days. NFC-e details. | |
categorias_download | integer | Monitored tax document categories 1 - All categories (default) Note: This parameter is available only for the NFS-e type. If it is not sent, all categories are monitored. When nfse is not in modelos_download, the value is silently ignored and does not affect monitoring. It does not apply to the NFC-e, whose direction is always issued. | |
ambiente_download | integer | Environment where the tax documents are monitored 1 - Production (default) Note: Tax documents are monitored only in the selected environment. You can switch environments at any time. | |
dfe_retroativas | boolean | Turns on the download of past tax documents (issued before the company was registered in the Fiscal Monitor).Default: falseWarning: Once you turn this option on, you cannot turn it off again for that company. |
Request example:
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cnpj": "00.000.000/0000-00",
"razao_social": "Nome da empresa LTDA",
"cep": "00000-000",
"certificado_base64": "...",
"certificado_senha": "abc12345"
}' \
https://api.webmania.com.br/2/monitor/empresas Example of an HTTP 201 response, with the registered company's data. Fields with no value, empty lists and false or zero values are left out; for example, dfe_retroativas does not appear when it is off. Partial example:
| Parameter | Type | Description |
|---|---|---|
uuid | string | UUID of the registered company |
status | integer | Status of the company's tax document monitoring.1 - Active |
cnpj|cpf | string | CNPJ of the company or CPF of the individual; only the field that matches the registration is returned |
razao_social|nome_completo | string | Legal name of the company (razao_social) or full name of the individual (nome_completo) |
im | string | City registration (Inscrição Municipal) |
endereco.cep | string | CEP (postal code) of the address |
endereco.municipio | string | City |
endereco.codigo_municipio | integer | IBGE code of the city (official city code) |
endereco.estado | string | State abbreviation (UF) |
modelos_download | array | Monitored tax document types |
categorias_download | integer | Monitored tax document categories |
ambiente_download | integer | Configured environment: 1 - Production or 2 - Sandbox (homologação). Left out when it was not set explicitly. |
certificado_vencimento | string | Expiration date of the digital certificate A1 Important: keep track of when the digital certificate A1 expires so the API keeps working fully. |
url_notificacao | string | URL that receives the notifications; left out when not set |
dfe_retroativas | boolean | Download of past tax documents; returns true when on and is left out when off. |
dfe_retroativas_total | integer | Number of past tax documents found. Note: This parameter is returned only if the dfe_retroativas option is off and there are hidden past documents (total greater than zero). Turn the option on to access the past tax documents. |
{
"uuid": "00000000-0000-0000-0000-000000000000",
"cnpj": "00.000.000/0000-00",
"razao_social": "Nome da empresa LTDA",
"endereco": {
"cep": "00000-000",
"municipio": "São Paulo",
"codigo_municipio": 3550308,
"estado": "SP"
},
"certificado_vencimento": "2026-12-06 08:56:03",
"modelos_download": ["nfe", "nfse", "mdfe", "cte", "nfce"]
}
The update replaces the certificate, the url_notificacao, the monitored document types or other data of a registered company. Send in the body only the parameters you want to change.
To update a company, send a PUT request to /2/monitor/empresas/{uuid}. Replace {uuid} with the company UUID.
| Parameter | Required | Type | Description |
|---|---|---|---|
cnpjCompany | string | Valid CNPJ (company ID) of the company, not already used by another registered company00.000.000/0000-00. On registration, required when cpf is not sent. | |
razao_socialCompany or individual | string | Legal name of the company, or name of the individualWhen sent, it cannot be empty and must have up to 150 characters. | |
cpfIndividual | string | Valid CPF (individual taxpayer ID) of the individual, not already used by another registered company000.000.000-00. On registration, required when cnpj is not sent. | |
nome_completoResponse only | string | Output field for an individual; it is not an input parameter. To send the name when you register or update, use razao_social. | |
im | string | City registration (Inscrição Municipal), optional when you register or update the companyWhen sent, it must have at least 3 digits. To see what city monitoring requires, check the city. | |
cep | string | Valid CEP (postal code) of the company's addressWhen sent, it cannot be empty. | |
certificado_base64 | string (Base64) | Valid, unexpired digital certificate A1 that matches the company's CPF or CNPJ. On update, required when certificado_senha is sent. Learn more (in Portuguese) | |
certificado_senha | string | Password for the digital certificate A1, with at least 1 characterRequired when certificado_base64 is sent; send both fields together. | |
url_notificacao | string | Valid, non-empty URL of the webhook that receives the notifications Notifies new tax documents received, status updates and other events for the monitored tax documents. | |
modelos_download | array | Monitored tax document types. When sent, it replaces the previous selection and accepts 0 to 5 items; an empty list stops monitoring all document types. nfe (default) Note: nfce = NFC-e (model 65). Download is available ONLY for companies with UF = SP, and requires a digital certificate A1 and opt-in activation. Returns only the receipts issued by the company itself, identified by the CNPJ of the A1 certificate. The dfe_retroativas parameter controls the look-back of up to 100 days. NFC-e details. | |
categorias_download | integer | Monitored tax document categories 1 - All categories (default) Note: This parameter is available only for the NFS-e type. If it is not sent, all categories are monitored. When nfse is not in modelos_download, the value is silently ignored and does not affect monitoring. It does not apply to the NFC-e, whose direction is always issued. | |
ambiente_download | integer | Environment where the tax documents are monitored 1 - Production (default) Note: Tax documents are monitored only in the selected environment. You can switch environments at any time. | |
dfe_retroativas | boolean | Turns on the download of past tax documents (issued before the company was registered in the Fiscal Monitor).Default: falseWarning: Once you turn this option on, you cannot turn it off again for that company. | |
status | integer | Turns tax document monitoring on or off for the company.1 - ActiveWarning: When you turn monitoring off, the automatic download of new tax documents for the company stops. The tax documents already downloaded remain available for lookup. |
curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"certificado_base64": "...",
"certificado_senha": "abc12345"
}' \
https://api.webmania.com.br/2/monitor/empresas/00000000-0000-0000-0000-000000000000 Example of an HTTP 200 response, with the updated company's data. Fields with no value, empty lists and false or zero values are left out, as in the registration. Partial example:
| Parameter | Type | Description |
|---|---|---|
uuid | string | UUID of the registered company |
status | integer | Status of the company's tax document monitoring.1 - Active |
cnpj|cpf | string | CNPJ of the company or CPF of the individual; only the field that matches the registration is returned |
razao_social|nome_completo | string | Legal name of the company (razao_social) or full name of the individual (nome_completo) |
im | string | City registration (Inscrição Municipal) |
endereco.cep | string | CEP (postal code) of the address |
endereco.municipio | string | City |
endereco.codigo_municipio | integer | IBGE code of the city (official city code) |
endereco.estado | string | State abbreviation (UF) |
modelos_download | array | Monitored tax document types |
categorias_download | integer | Monitored tax document categories |
ambiente_download | integer | Configured environment: 1 - Production or 2 - Sandbox (homologação). Left out when it was not set explicitly. |
certificado_vencimento | string | Expiration date of the digital certificate A1 Important: keep track of when the digital certificate A1 expires so the API keeps working fully. |
url_notificacao | string | URL that receives the notifications; left out when not set |
dfe_retroativas | boolean | Download of past tax documents; returns true when on and is left out when off. |
dfe_retroativas_total | integer | Number of past tax documents found. Note: This parameter is returned only if the dfe_retroativas option is off and there are hidden past documents (total greater than zero). Turn the option on to access the past tax documents. |
{
"uuid": "00000000-0000-0000-0000-000000000000",
"cnpj": "00.000.000/0000-00",
"razao_social": "Nome da empresa LTDA",
"endereco": {
"cep": "00000-000",
"municipio": "São Paulo",
"codigo_municipio": 3550308,
"estado": "SP"
},
"certificado_vencimento": "2026-12-06 08:56:03",
"modelos_download": ["nfe", "nfse", "mdfe", "cte", "nfce"]
}
This call returns a company's data, including the expiration date of its digital certificate A1 and the monitored document types.
To get a company, send a GET request to /2/monitor/empresas/{uuid}. Replace {uuid} with the ID returned at registration.
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
https://api.webmania.com.br/2/monitor/empresas/00000000-0000-0000-0000-000000000000 Example of an HTTP 200 response, with the company's data. Fields with no value, empty lists and false or zero values are left out, as in the registration. Partial example:
| Parameter | Type | Description |
|---|---|---|
uuid | string | UUID of the registered company |
status | integer | Status of the company's tax document monitoring.1 - Active |
cnpj|cpf | string | CNPJ of the company or CPF of the individual; only the field that matches the registration is returned |
razao_social|nome_completo | string | Legal name of the company (razao_social) or full name of the individual (nome_completo) |
im | string | City registration (Inscrição Municipal) |
endereco.cep | string | CEP (postal code) of the address |
endereco.municipio | string | City |
endereco.codigo_municipio | integer | IBGE code of the city (official city code) |
endereco.estado | string | State abbreviation (UF) |
modelos_download | array | Monitored tax document types |
categorias_download | integer | Monitored tax document categories |
ambiente_download | integer | Configured environment: 1 - Production or 2 - Sandbox (homologação). Left out when it was not set explicitly. |
certificado_vencimento | string | Expiration date of the digital certificate A1 Important: keep track of when the digital certificate A1 expires so the API keeps working fully. |
url_notificacao | string | URL that receives the notifications; left out when not set |
dfe_retroativas | boolean | Download of past tax documents; returns true when on and is left out when off. |
dfe_retroativas_total | integer | Number of past tax documents found. Note: This parameter is returned only if the dfe_retroativas option is off and there are hidden past documents (total greater than zero). Turn the option on to access the past tax documents. |
{
"uuid": "00000000-0000-0000-0000-000000000000",
"cnpj": "00.000.000/0000-00",
"razao_social": "Nome da empresa LTDA",
"endereco": {
"cep": "00000-000",
"municipio": "São Paulo",
"codigo_municipio": 3550308,
"estado": "SP"
},
"certificado_vencimento": "2026-12-06 08:56:03",
"modelos_download": ["nfe", "nfse", "mdfe", "cte", "nfce"]
}
The listing returns the companies registered in your account, page by page. You can also search by text.
To list the companies, send a GET request to /2/monitor/empresas. The query parameters are optional:
page: integer from 1; default: 1.per_page: integer from 10 to 200; default: 50.pesquisa: text with at least 3 characters to search companies.curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
"https://api.webmania.com.br/2/monitor/empresas?page=1&per_page=50" Example of an HTTP 200 response. The JSON object has data (an array of companies in the same format as Get a company, with the same fields left out) and meta (pagination data: current_page, last_page, per_page and total, all integers). Partial example:
{
"data": [
{
"uuid": "00000000-0000-0000-0000-000000000000",
"cnpj": "00.000.000/0000-00",
"razao_social": "Nome da empresa LTDA",
"endereco": {
"cep": "00000-000",
"municipio": "São Paulo",
"codigo_municipio": 3550308,
"estado": "SP"
},
"certificado_vencimento": "2026-12-06 08:56:03",
"modelos_download": ["nfe", "nfse", "mdfe", "cte", "nfce"],
"categorias_download": 1
},
{
"uuid": "00000000-0000-0000-0000-000000000000",
"cnpj": "00.000.000/0000-00",
"razao_social": "Nome da empresa LTDA",
"endereco": {
"cep": "00000-000",
"municipio": "São Paulo",
"codigo_municipio": 3550308,
"estado": "SP"
},
"certificado_vencimento": "2026-12-06 08:56:03",
"modelos_download": ["nfe", "nfse", "mdfe", "cte", "nfce"],
"categorias_download": 3
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 50,
"total": 2
}
}
After you register a company, you can set up NFS-e (service invoice) monitoring for the cities that require extra credentials. See all available cities.
Why is this setup needed?
Automatic monitoring with only the company's digital certificate A1. Examples: São Paulo, Belo Horizonte.
Downloading requires the city hall portal login and password. Examples: Osasco, Fortaleza.
How does it work?
/2/monitor/municipios-nfse.Important: Check the list of available cities or the IBGE code before you register the city credentials. Want to see it as a spreadsheet? Click here (in Portuguese)
Received and provided NFS-e: they are collected automatically from the national data environment (Ambiente de Dados Nacional, ADN) in every city that has joined the ADN, regardless of this list or of registered credentials. The list below applies to cities that have not joined the ADN and are served through direct integration with the city hall (for example, São Paulo).
For each city served by direct integration, the list shows whether monitoring is native (nativo) and whether the city registration (Inscrição Municipal) is required (im).
To list the available cities, send a GET request to /2/monitor/municipios-nfse.
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
https://api.webmania.com.br/2/monitor/municipios-nfse To search for one city, send the optional codigo_ibge parameter in the query string: a non-empty string with exactly 7 digits. Example with the IBGE code (official city code):
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
https://api.webmania.com.br/2/monitor/municipios-nfse?codigo_ibge=0000000 Without codigo_ibge, the response is a JSON object with data, an array of available cities. With codigo_ibge, it returns the city object directly, without data. If there is no match, it returns only the boolean flags with the value false, without name, state (UF) or code. The registration guide is left out when there is none. Example of the listing without a filter:
| Parameter | Type | Description |
|---|---|---|
municipio | string | City name |
uf | string | State abbreviation |
codigo_ibge | string | IBGE code of the city |
nativo | boolean | Whether the city is nativetrue = Native |
download_emitidas | boolean | Not returned by this response: it is an availability flag used when you register city monitoring. It tells whether the city allows the download of documents issued through the city provider. Received and provided NFS-e from cities that have joined the national data environment (ADN) are collected automatically, regardless of this field. |
download_recebidas | boolean | Not returned by this response: it is an availability flag used when you register city monitoring. It tells whether the city allows the download of received documents through the city provider. Received and provided NFS-e from cities that have joined the national data environment (ADN) are collected automatically, regardless of this field. |
im | boolean | Whether the city registration (Inscrição Municipal) is required |
certificado | boolean | Whether a digital certificate A1 is required |
login_senha | boolean | Whether the city requires a login and password for accessWhen true, login and password are required to register the monitoring. This flag does not depend on the certificate. |
cadastro_prefeitura | boolean | Whether a registration with the city hall is required |
guia_cadastro_prefeitura | string | Returns the URL of the guide in the Webmania Help Center (in Portuguese) |
domicilio_fiscal_municipio | boolean | Whether a tax address in the city is requiredThis is the address registered with the tax authority. It must be in the same city. |
multiplos_servicos | boolean | Whether the city supports several services per invoiceThis is when one service invoice (NFS-e) includes two or more different services provided to the same customer. They are listed separately but charged together in one tax document. |
{
"data": [
{
"municipio": "São Paulo",
"uf": "SP",
"codigo_ibge": "3550308",
"nativo": true,
"certificado": true,
"login_senha": false,
"cadastro_prefeitura": false,
"domicilio_fiscal_municipio": false,
"multiplos_servicos": false
},
{
"municipio": "Osasco",
"uf": "SP",
"codigo_ibge": "3534401",
"nativo": false,
"certificado": false,
"login_senha": true,
"cadastro_prefeitura": false,
"domicilio_fiscal_municipio": false,
"multiplos_servicos": false
}
]
} This endpoint returns the cities registered for the company, with the download type of each one.
To list the monitored cities, send a GET request to /2/monitor/empresas/{uuid}/municipios-nfse. Replace {uuid} with the company UUID. These query string parameters are optional:
page: integer from 1; default: 1.per_page: integer from 10 to 200; default: 50.municipio: non-empty string with at least 3 characters.uf: non-empty string with 2 characters.codigo_ibge: string with exactly 7 digits.The city, state (UF) and IBGE code filters match exact values, not parts of the name.
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
"https://api.webmania.com.br/2/monitor/empresas/00000000-0000-0000-0000-000000000000/municipios-nfse?page=1&per_page=50" Example of an HTTP 200 response. The JSON object has data (an array of monitored cities) and meta (pagination data: current_page, last_page, per_page and total, all integers). The login and im fields are left out when they have no value; the password is never returned. Each item has tipo_download. Partial example:
| Parameter | Type | Description |
|---|---|---|
uuid | string | UUID of the city monitoring |
municipio | string | Name of the monitored city |
uf | string | State abbreviation (UF) |
tipo_download | integer | Download type1 - Received documents |
codigo_ibge | string | IBGE code of the monitored city |
login | string | Login for the city hall portal |
im | string | City registration (Inscrição Municipal) in the monitored city |
{
"data": [
{
"uuid": "00000000-0000-0000-0000-000000000000",
"municipio": "Osasco",
"uf": "SP",
"codigo_ibge": "0000000",
"login": "usuario123",
"im": "00000000"
},
{
"uuid": "00000000-0000-0000-0000-000000000000",
"municipio": "São Paulo",
"uf": "SP",
"codigo_ibge": "0000000",
"login": "usuario123",
"im": "00000000"
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 50,
"total": 2
}
} This call registers the city hall portal credentials for a non-native city, so the Fiscal Monitor can download its NFS-e. Only non-native cities that support the requested download type are accepted.
To register a city, send a POST request to /2/monitor/empresas/{empresa_uuid}/municipios-nfse, with the parameters below in the JSON body. Replace {empresa_uuid} with the company UUID. A successful response is HTTP 201, with the monitoring object in the format described in List monitored cities, without the data wrapper:
| Parameter | Required | Type | Description |
|---|---|---|---|
codigo_ibge | string | IBGE code of the cityNon-empty string with exactly 7 digits. E.g.: 3534401 | |
login | string | Login for the city hall portalWhen sent, a non-empty string of 3 to 50 characters. Login and password are required if the city requires authentication. | |
senha | string | Password for the city hall portalWhen sent, a non-empty string of 3 to 50 characters. Required together with login if the city requires authentication. Sending a login alone does not make the password required for other cities. | |
im | string | City registration (Inscrição Municipal) in the cityWhen sent, a non-empty string of 3 to 50 characters. Required if the city requires a city registration. | |
tipo_download | integer | Download type1 - Received documents |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"codigo_ibge": "0000000",
"login": "usuario123",
"senha": "senha123"
}' \
https://api.webmania.com.br/2/monitor/empresas/00000000-0000-0000-0000-000000000000/municipios-nfse The update replaces the login, the password or the city registration (IM) of a registered city, for example after a password change on the city hall portal. This method does not change the IBGE code or the download type.
To update the credentials of a city, send a PUT request to /2/monitor/empresas/{empresa_uuid}/municipios-nfse/{uuid}, with the company UUID and the UUID of that company's city monitoring. Send in the JSON body only the fields below that you want to update. Each value you send must be a non-empty string of 3 to 50 characters. Fields you leave out stay the same.
| Parameter | Required | Type | Description |
|---|---|---|---|
login | string | Login for the city hall portal | |
senha | string | Password for the city hall portal | |
im | string | City registration (Inscrição Municipal) in the city |
curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"login": "login123",
"senha": "senha123"
}' \
https://api.webmania.com.br/2/monitor/empresas/00000000-0000-0000-0000-000000000000/municipios-nfse/00000000-0000-0000-0000-000000000000 Example of an HTTP 200 response, with the JSON object of the updated monitoring. It has the same format as the items of List monitored cities: it includes tipo_download and leaves out login or im with no value. The password is never returned. Partial example:
{
"uuid": "00000000-0000-0000-0000-000000000000",
"municipio": "Osasco",
"uf": "SP",
"codigo_ibge": "0000000",
"login": "usuario123",
"im": "00000000"
} This call stops NFS-e monitoring for a city registered to the company.
To remove a city, send a DELETE request to /2/monitor/empresas/{empresa_uuid}/municipios-nfse/{uuid}, with the company UUID and the monitoring UUID.
curl -X DELETE \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
https://api.webmania.com.br/2/monitor/empresas/00000000-0000-0000-0000-000000000000/municipios-nfse/00000000-0000-0000-0000-000000000000 Example of an HTTP 200 response, with the success message (in Portuguese, it says that the invoice download for the city Osasco - SP was stopped):
{
"msg": "O download de notas para o município Osasco - SP foi interrompido com sucesso."
} You can list the documents collected by the Fiscal Monitor with filters, look each one up with its XML and PDF, follow its events and import documents. Each document is identified by its uuid, which you receive in the notification and in the document list.
The listing returns, page by page, the documents collected for the companies in your account, with filters by document type, date, status and other fields. Use it to check in bulk what arrived through the notifications.
To list the tax documents, send a POST request to /2/monitor/documentos. In the request body, send modelo to select the document type and, optionally, the filtros, filtros_modelo and pesquisa parameters. The modelo parameter is optional in the listing and required when you export reports. Filters for a specific document type require it.
For page-number pagination, the query strings page (integer from 1, default 1) and per_page (integer from 10 to 200, default 50) are optional. Request parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
modelo | string | Tax document type. Optional in the listing; required when you export reports and when you use filters for a specific document type. nfe | |
novos_documentos | boolean | When true, selects the documents collected after the last access registered for the account. With no earlier access, this cutoff does not apply.Keeps the company, period, environment and document type filters; the other filters and the text search are not applied in this mode. Each call records a new access for later searches. | |
filtros | object | General filtersSee all filters - Learn more | |
filtros_modelo | object | Filters by tax document typeSee all filters - Learn more | |
pesquisa | string | Text search across the document data, from 3 to 80 characters.Searches the tax document's data. Learn more |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"modelo" : "nfe"
}' \
https://api.webmania.com.br/2/monitor/documentos?page=1&per_page=50 Example of an HTTP 200 response. The JSON object has data, with the array of tax documents, and meta, with the pagination data. Each tax document type has a different response: select the type below to see the example.
Interactive tip: Hover over the JSON fields to see the detailed description of each parameter, its data type and its possible values.
The NF-e example below is partial and shows a document whose full data has already been collected. The listing does not return the products, the transport, the nature of the transaction, the billing, the installments, the technical contact, the protocol or the files. Use the lookup by UUID to get these details. The available fields depend on the collected data; this example is not a complete schema.
{
"data": [
{
"uuid": "00000000-0000-0000-0000-000000000000",
"empresa_uuid": "00000000-0000-0000-0000-000000000000",
"modelo": "nfe",
"status": "aprovado",
"categoria": "recebidas",
"data_emissao": "2025-02-27 13:17:00",
"numero": 200,
"serie": 1,
"chave": "00000000000000000000000000000000000000000000",
"valor": 6200,
"operacao": 0,
"finalidade": 1,
"cfop": ["2909"],
"emitente": {
"cnpj": "00000000000000",
"razao_social": "EMPRESA FORNECEDORA LTDA",
"ie": "000000000000",
"uf": "SP",
"cidade": "São Paulo"
},
"cliente": {
"cnpj": "11111111000111",
"razao_social": "EMPRESA COMPRADORA S/A",
"ie": "111111111111",
"uf": "SP",
"cidade": "São Paulo"
},
"totais": {
"icms_bc": 6200,
"icms_valor": 1116,
"icms_valor_desonerado": 0,
"icms_st_bc": 0,
"icms_st_valor": 0,
"fcp_valor": 0,
"fcp_st_valor": 0,
"fcp_st_retido_valor": 0,
"ipi_valor": 310,
"ipi_devolvido_valor": 0,
"pis_valor": 102.3,
"cofins_valor": 471.2,
"ii_valor": 0,
"valor_produtos": 6200,
"valor_seguro": 0,
"valor_outras_despesas": 0,
"valor_desconto": 0,
"valor_frete": 0
},
"totais_issqn": {
"valor_servicos": 0,
"iss_bc": 0,
"iss_valor": 0,
"pis_valor": 0,
"cofins_valor": 0,
"data_competencia": "2025-02-27",
"deducao": 0,
"outras_retencoes": 0,
"desconto_incondicionado": 0,
"desconto_condicionado": 0,
"iss_retido_valor": 0,
"regime_especial_tributacao": "1"
}
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 50,
"total": 1
}
} Send the general filters in the filtros object of the JSON body of POST /2/monitor/documentos. They are also accepted at the top level; if the same key is in both places, the top-level value wins. Filters are optional and can be combined. When you send them, they must follow the types and limits below.
| Parameter | Required | Type | Description |
|---|---|---|---|
ambiente | number or numeric string | Environment of the tax document. The default is 1 when left out.1 - Production | |
empresa_uuid | string or array of strings | Company UUID, or a list of up to 50 distinct UUIDs. A string is turned into a list; duplicate UUIDs are merged. | |
categoria | string or array of strings | Tax document category, that is, how the company takes part in the document. Send one value or a non-empty list; list values are combined with OR.emitidas (issued) | |
status | string or array of strings | Tax document status. Send one value or a non-empty list.aprovadopendente selects authorized documents available only as a summary, awaiting the recipient acknowledgment. Which other statuses are available depends on the document type. | |
chave | string | Access key: 44 positions (6 digits, 12 alphanumeric characters and 26 digits), or 50 digits for the national NFS-e. Send the key in the filtros object or at the top level, not in filtros_modelo. | |
data_inicial | string | Earliest issue date, from the start of the day, in YYYY-MM-DD format. | |
data_final | string | Latest issue date, through the end of the day, in YYYY-MM-DD format. Must be on or after data_inicial. | |
serie | number or numeric string | In the filtros object, numeric series up to 999; requires modelo. For NFS-e, it is an alias of serie_rps; prefer filtros_modelo.serie_rps for text series. Does not apply to CT-e, CT-e OS, GTV-e or MDF-e. | |
numero | number or numeric string | Number equal to or greater than 1. For NFS-e, it is an alias of numero_rps. Prefer that specific name, and do not mix the two sets of aliases in the same request. | |
valor | number or numeric string | Amount of the tax document, zero or greater. Use a dot as the decimal separator, for example 100.00. Zero is accepted, but then the amount filter is not applied. |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"modelo" : "nfe",
"filtros": {
"ambiente": 1,
"empresa_uuid": "00000000-0000-0000-0000-000000000000",
"categoria": "emitidas",
"data_inicial": "2026-12-06",
"data_final": "2026-12-06",
"serie": "1",
"numero": "12345",
"valor": "100.00"
}
}' \
"https://api.webmania.com.br/2/monitor/documentos?page=1&per_page=50" Send the type-specific filters in the filtros_modelo object of the JSON body of POST /2/monitor/documentos, and send modelo at the top level. Each object accepts only the fields listed in the table for the chosen document type. General filters such as status and chave belong in filtros or at the top level, never in filtros_modelo. The specific fields are also accepted at the top level, which wins when the same key is sent in both places.
For modelo equal to nfe or nfce. See the general filters for status and chave.
| Parameter | Required | Type | Description |
|---|---|---|---|
finalidade | number, numeric string or array | Purpose of the tax document. Accepts one value or a non-empty list of numeric values from 0 to 4. The filter accepts 0, even though 0 is not a tax purpose.1 - Normal | |
operacao | number, numeric string or array | Direction of the tax document. Accepts one value or a non-empty list of the values below. A return is a purpose, not a direction code.0 - Incoming | |
ncm | string | NCM of the product (the Mercosur product classification code, based on the international HS code), with exactly 8 digits. Keep the leading zeros. | |
cfop | string | CFOP of the product, with exactly 4 digits: the code that says what kind of transaction it is, for example, 5102 = sale, inside the state, of goods bought from others. |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"modelo" : "nfe",
"filtros": {
"categoria": "recebidas",
"chave": "00000000000000000000000000000000000000000000"
},
"filtros_modelo": {
"operacao": 1
}
}' \
"https://api.webmania.com.br/2/monitor/documentos?page=1&per_page=50" For modelo equal to nfse. Send status and chave in the general filters.
| Parameter | Required | Type | Description |
|---|---|---|---|
codigo_verificacao | string | Verification code of the tax document, a string with at least 1 character. | |
codigo_cnae | string | CNAE code (economic activity code) of the service provided, with exactly 7 digits. | |
codigo_servico | string | Code of the service provided, a string of 3 to 6 characters. | |
serie_rps | string | RPS (provisional service receipt) series, with at least 1 character. | |
numero_rps | number or numeric string | RPS number, equal to or greater than 1. Use the RPS-specific fields without mixing them with the serie and numero aliases. |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"modelo" : "nfse",
"filtros": {
"categoria": "recebidas"
},
"filtros_modelo": {
"codigo_cnae": "0000000"
}
}' \
"https://api.webmania.com.br/2/monitor/documentos?page=1&per_page=50" For modelo equal to cte or cte_os. The same fields also apply to gtve, except finalidade. Send status and chave in the general filters.
| Parameter | Required | Type | Description |
|---|---|---|---|
finalidade | number, numeric string or array | Purpose of the tax document. For CT-e and CT-e OS, accepts one value or a non-empty list of numbers or numeric strings from 0 to 4. Not allowed for GTV-e. | |
cfop | string | CFOP code (transaction code) with exactly 4 digits. | |
modalidade | number, numeric string or array | Transport mode of the tax document. Accepts one value or a non-empty list of values from 1 to 6.1 - Road | |
uf_inicio_prestacao | string | Brazilian state (UF) where the service starts, as a 2-letter uppercase abbreviation.Example: SP | |
uf_termino_prestacao | string | Brazilian state (UF) where the service ends, as a 2-letter uppercase abbreviation.Example: SP |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"modelo" : "cte",
"filtros": {
"categoria": "recebidas"
},
"filtros_modelo": {
"modalidade": 1
}
}' \
"https://api.webmania.com.br/2/monitor/documentos?page=1&per_page=50" For modelo equal to mdfe. Send status and chave in the general filters.
| Parameter | Required | Type | Description |
|---|---|---|---|
modalidade | number, numeric string or array | Transport mode of the tax document. Accepts one value or a non-empty list of values from 1 to 6.1 - Road | |
uf_carregamento | string | Brazilian state (UF) of loading, as a 2-letter uppercase abbreviation.Example: SP | |
uf_descarregamento | string | Brazilian state (UF) of unloading, as a 2-letter uppercase abbreviation.Example: SP | |
placa_veiculo | string | License plate with 7 characters, no separators: 3 letters, 1 digit, 1 letter or digit, and 2 digits. Letters are converted to uppercase.Examples: ABC1234 or ABC1D23 |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"modelo" : "mdfe",
"filtros": {
"categoria": "recebidas"
},
"filtros_modelo": {
"uf_carregamento": "PR"
}
}' \
"https://api.webmania.com.br/2/monitor/documentos?page=1&per_page=50" Send the optional pesquisa parameter at the top level of the JSON body of POST /2/monitor/documentos, with the text you want to find. The search is case-insensitive and can be combined with the other filters.
With the text search, you can find tax documents by these criteria:
Example request using the text search:
Limits: The optional pesquisa parameter must be a string of 3 to 80 characters.
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"modelo" : "nfe",
"filtros": {
"categoria": "recebidas"
},
"pesquisa": "EMPRESA LTDA"
}' \
"https://api.webmania.com.br/2/monitor/documentos?page=1&per_page=50"The event listing shows what happened to a document after it was issued: cancellation, correction letter, recipient acknowledgment, closing and other events already collected. This call does not register new events.
To list the events of a document, send a GET request to /2/monitor/documentos/{uuid}/eventos. Replace {uuid} with the UUID of a document that your Fiscal Monitor credential can access.
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
https://api.webmania.com.br/2/monitor/documentos/00000000-0000-0000-0000-000000000000/eventos Example of an HTTP 200 response: a JSON object with data, an array of event objects sorted by registrado_em, newest first. With no collected events, the response is {"data":[]}. Each JSON below is one item of that array, not the full response.
The examples are illustrative. Fields with a null value are left out; false, zero and empty values are not removed by this rule. The content of log and of the specific data depends on the event and its source. The listed types are not options you send in this GET call: registering an acknowledgment is a separate operation, described in Recipient acknowledgment.
Response JSON examples: Each event returns a specific structure. To see each variation, click the JSON example links in the tables below.
| Event | Type | Example | Purpose |
|---|---|---|---|
| Correction letter (Carta de correção) | 110110 | JSON example | Fixes errors in the tax document without canceling and reissuing it |
| Cancellation (Cancelamento) | 110111 | JSON example | Voids the authorized tax document when the transaction does not happen |
| Confirmação da operação (confirmation of the transaction) | 210200 | JSON example | The recipient of the tax document confirms that the transaction happened as described in the document |
| Ciência da operação (awareness of the transaction) | 210210 | JSON example | The recipient only declares that it knows the tax document was issued |
| Desconhecimento da operação (transaction not recognized) | 210220 | JSON example | The recipient states that it does not recognize the transaction described in the tax document |
| Operação não realizada (transaction did not take place) | 210240 | JSON example | The recipient states that the transaction did not take place |
| CT-e authorization record | 610600 | JSON example | Shows that a CT-e (freight bill) that references the NF-e was authorized |
| CT-e cancellation record | 610601 | JSON example | Shows that a CT-e that references the NF-e was canceled |
| CT-e proof of delivery | 610130 | JSON example | Proves the delivery of the goods carried under a CT-e that references the NF-e |
| MDF-e authorization record | 610614 | JSON example | Shows that an MDF-e (cargo manifest) that references the NF-e was authorized |
| MDF-e cancellation record | 610615 | JSON example | Shows that an MDF-e that references the NF-e was canceled |
| Automatic passage record | 510630 | JSON example | Automatically records a vehicle passing through toll plazas while carrying goods covered by an MDF-e that references the NF-e |
| Tax checkpoint passage record | 610500 | JSON example | Records the passage of the carried goods through a tax checkpoint |
| Propagated passage record | 610514 | JSON example | Records carried goods passing through tax checkpoints when they are covered by an MDF-e that includes a CT-e referencing the NF-e |
| Event | Type | Example | Purpose |
|---|---|---|---|
| Cancellation (Cancelamento) | 101101 | JSON example | Voids the authorized tax document when the transaction does not happen |
| Substitution (Substituição) | 105102 | JSON example | Replaces the tax document with a new one, fixing incorrect or incomplete data in the original document |
| Request for a tax review of the cancellation (Solicitação de Análise Fiscal para Cancelamento) | 101103 | JSON example | The issuer asks the city to review the cancellation of the NFS-e; it does not change the document status |
| Cancellation approved after tax review (Cancelamento Deferido por Análise Fiscal) | 105104 | JSON example | The city approves the tax review request; the document status changes to cancelado |
| Event | Type | Example | Purpose |
|---|---|---|---|
| Correction letter (Carta de correção) | 110110 | JSON example | Fixes errors in the tax document without canceling and reissuing it |
| Cancellation (Cancelamento) | 110111 | JSON example | Voids the authorized tax document when the transaction does not happen |
| Proof of delivery (Comprovante de entrega) | 110180 | JSON example | Proves the delivery of the carried goods |
| MDF-e authorization record | 310610 | JSON example | Shows that an MDF-e (cargo manifest) that references the CT-e was authorized |
| MDF-e cancellation record | 310611 | JSON example | Shows that an MDF-e that references the CT-e was canceled |
| Service disagreement (Prestação de serviço em desacordo) | 610110 | JSON example | The service taker states that it disagrees with an issued CT-e, because the document contains errors or discrepancies |
| Event | Type | Example | Purpose |
|---|---|---|---|
| Cancellation (Cancelamento) | 110111 | JSON example | Voids the authorized tax document when the transaction does not happen. |
| Closing (Encerramento) | 110112 | JSON example | Shows that the transport is complete and that the goods were delivered to the final destination. |
| Driver added (Inclusão de condutor) | 110114 | JSON example | Adds new drivers during the trip, when a driver changes or a new driver must be registered in addition to the ones already listed. |
The lookup returns a full document, including data the document list does not return and the XML and PDF files in docs. Use the uuid received in the notification or in the document list.
To look up a tax document, send a GET request to /2/monitor/documentos/{uuid}. Replace {uuid} with the document UUID.
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
https://api.webmania.com.br/2/monitor/documentos/00000000-0000-0000-0000-000000000000 Example of an HTTP 200 response: the document object itself, without the data wrapper of the listing. The available fields depend on the collected data; fields with no data may be left out. Each tax document type has a different response: select the type below to see the example.
Interactive tip: Hover over the JSON fields to see the detailed description of each parameter, its data type and its possible values.
{
"uuid": "00000000-0000-0000-0000-000000000000",
"empresa_uuid": "00000000-0000-0000-0000-000000000000",
"modelo": "nfe",
"status": "aprovado",
"categoria": "recebidas",
"data_emissao": "2025-02-27 13:28:00",
"numero": 100,
"serie": 1,
"chave": "00000000000000000000000000000000000000000000",
"valor": 6700,
"operacao": 0,
"finalidade": 1,
"cfop": [
"2909"
],
"natureza_operacao": "Retorno de bem por conta de contrato de comodato ou locacao.",
"emitente": {
"cnpj": "00000000000000",
"cpf": "00000000000",
"razao_social": "XXXXXX XXXXXX XXX",
"nome_completo": "XXXXXX XXXXXX XXX",
"ie": "00000000",
"endereco": "XXXX XXXX",
"numero": "XXX",
"complemento": "XXXX XXXXXX",
"bairro": "XXXXXXX XXXX",
"cep": "00000000",
"cidade": "Sao Paulo",
"uf": "SP",
"telefone": "00000000000",
"email": "abcd@efgh.com"
},
"cliente": {
"cnpj": "00000000000000",
"cpf": "00000000000",
"razao_social": "XXXXXX XXXXXX XXX",
"nome_completo": "XXXXXX XXXXXX XXX",
"ie": "00000000",
"endereco": "XXXX XXXX",
"numero": "XXX",
"complemento": "XXXX XXXXXX",
"bairro": "XXXXXXX XXXX",
"cep": "00000000",
"cidade": "Sao Paulo",
"uf": "SP",
"telefone": "00000000000",
"email": "abcd@efgh.com"
},
"pedido": {
"ID": "000000000",
"presenca": "0",
"modalidade_frete": "0",
"frete": 5,
"intermediador": "0",
"cnpj_intermediador": "00000000000000",
"id_intermediador": "XXXXXXXXX",
"pagamento": [
"0"
],
"forma_pagamento": [
"99"
],
"desc_pagamento": [
"Pagamento Digital"
],
"valor_pagamento": [
6700
],
"tipo_integracao": [
"1"
],
"cnpj_credenciadora": [
"00000000000000"
],
"bandeira": [
"01"
],
"autorizacao": [
"12345"
],
"desconto": 0,
"informacoes_fisco": "XXXXX XXXXXXXXXXX",
"informacoes_complementares": "XXXXXXX XXXXXXXX XXXXXXXXX XXXX"
},
"produtos": [
{
"nome": "HD SSD 512GB NVME",
"item": "1",
"codigo": ".560",
"ncm": "85219000",
"cest": "0000000",
"quantidade": 1,
"quantidade_tributavel": 1,
"unidade": "UN",
"unidade_tributavel": "UN",
"origem": "0",
"subtotal": 1000,
"subtotal_tributavel": 1000,
"total": 1000,
"desconto": 0,
"frete": 0,
"seguro": 0,
"outras_despesas": 0,
"gtin": "SEM GTIN",
"gtin_tributavel": "SEM GTIN",
"impostos": {
"icms": {
"codigo_cfop": "2909",
"situacao_tributaria": "41",
"icms_bc":0,
"icms_modalidade_bc":0,
"icms_aliquota":0,
"icms_valor":0,
"icms_aliquota_reducao":0,
"icms_valor_desonerado":0,
"icms_motivo_desoneracao":0,
"icms_valor_operacao":0,
"icms_aliquota_diferimento":0,
"icms_valor_diferimento":0,
"icms_aliquota_reducao_efetiva":0,
"icms_bc_efetiva":0,
"icms_aliquota_efetiva":0,
"icms_valor_efetivo":0,
"icms_bc_operacao_propria":0,
"icms_substituto_valor":0,
"icms_aliquota_credito":0,
"icms_valor_credito":0,
"icms_bc_uf_destino":0,
"icms_aliquota_uf_destino":0,
"icms_aliquota_interestadual":0,
"icms_aliquota_partilha_interestadual":0,
"icms_valor_uf_destino":0,
"icms_valor_uf_remetente":0,
"icms_st_bc":0,
"icms_st_modalidade_bc":0,
"icms_st_aliquota":0,
"icms_st_valor":0,
"icms_st_aliquota_mva":0,
"icms_st_aliquota_reducao":0,
"icms_st_uf":0,
"icms_st_bc_dest":0,
"icms_st_valor_dest":0,
"icms_st_retido_bc":0,
"icms_st_retido_valor":0,
"fcp_bc":0,
"fcp_aliquota":0,
"fcp_valor":0,
"fcp_bc_uf_destino":0,
"fcp_aliquota_uf_destino":0,
"fcp_valor_uf_destino":0,
"fcp_st_bc":0,
"fcp_st_aliquota":0,
"fcp_st_valor":0,
"fcp_st_retido_bc":0,
"fcp_st_retido_aliquota":0,
"fcp_st_retido_valor":0
},
"ipi": {
"situacao_tributaria": "99",
"codigo_enquadramento": "999",
"ipi_bc": 0,
"ipi_aliquota": 0,
"ipi_valor": 0,
"codigo_selo": "XXXX",
"qtd_selo": 1
},
"ipi_devolvido": {
"percentual_devolvido": 0,
"ipi_devolvido_valor": 0
},
"pis": {
"situacao_tributaria": "98",
"pis_bc": 0,
"pis_quantidade_bc": 0,
"pis_aliquota": 0,
"pis_aliquota_valor": 0,
"pis_valor": 0
},
"cofins": {
"situacao_tributaria": "98",
"cofins_bc": 0,
"cofins_quantidade_bc": 0,
"cofins_aliquota": 0,
"cofins_aliquota_valor": 0,
"cofins_valor": 0
},
"ibs_cbs": {
"situacao_tributaria": "000",
"classificacao_tributaria": "000001",
"indicador_doacao": false,
"bc": 1000.0,
"valor_ibs": 20.0,
"ibs_estadual": {
"aliquota": 1.2,
"valor": 12.0,
"aliquota_diferimento": 0.1,
"valor_diferimento": 1.0,
"valor_devolvido": 0.5,
"aliquota_reducao": 0.2,
"aliquota_efetiva": 1.0
},
"ibs_municipal": {
"aliquota": 0.8,
"valor": 8.0,
"aliquota_diferimento": 0.05,
"valor_diferimento": 0.5,
"valor_devolvido": 0.2,
"aliquota_reducao": 0.1,
"aliquota_efetiva": 0.7
},
"cbs": {
"aliquota": 0.9,
"valor": 9.0,
"aliquota_diferimento": 0.03,
"valor_diferimento": 0.3,
"valor_devolvido": 0.1,
"aliquota_reducao": 0.05,
"aliquota_efetiva": 0.85
},
"situacao_tributaria_regular": "000",
"classificacao_tributaria_regular": "000001",
"tributacao_regular": {
"ibs_estadual": {
"aliquota_efetiva": 1.1,
"valor": 11.0
},
"ibs_municipal": {
"aliquota_efetiva": 0.75,
"valor": 7.5
},
"cbs": {
"aliquota_efetiva": 0.88,
"valor": 8.8
}
},
"compra_governamental": {
"ibs_estadual": {
"aliquota": 1.0,
"valor": 10.0
},
"ibs_municipal": {
"aliquota": 0.6,
"valor": 6.0
},
"cbs": {
"aliquota": 0.7,
"valor": 7.0
}
},
"tributacao_monofasica": {
"quantidade_bc": 1.0,
"aliquota_ibs": 0.3,
"aliquota_cbs": 0.2,
"valor_ibs": 0.3,
"valor_cbs": 0.2,
"quantidade_bc_retencao": 0.2,
"aliquota_ibs_retencao": 0.1,
"aliquota_cbs_retencao": 0.05,
"valor_ibs_retencao": 0.02,
"valor_cbs_retencao": 0.01,
"quantidade_bc_retido": 0.1,
"aliquota_ibs_retido": 0.08,
"aliquota_cbs_retido": 0.04,
"valor_ibs_retido": 0.008,
"valor_cbs_retido": 0.004,
"aliquota_diferimento_ibs": 0.02,
"aliquota_diferimento_cbs": 0.01,
"valor_diferimento_ibs": 0.002,
"valor_diferimento_cbs": 0.001,
"valor_total_ibs": 0.33,
"valor_total_cbs": 0.215
},
"transferencia_credito": {
"valor_ibs": 1.0,
"valor_cbs": 0.5
},
"ajuste_competencia": {
"competencia_apuracao": "2026-01",
"valor_ibs": 0.8,
"valor_cbs": 0.4
},
"credito_presumido": {
"classificacao": "01",
"bc": 1000.0,
"aliquota_ibs": 0.5,
"valor_ibs": 5.0,
"valor_ibs_condicionado_suspensao": 0.2,
"aliquota_cbs": 0.3,
"valor_cbs": 3.0,
"valor_cbs_condicionado_suspensao": 0.1
},
"credito_presumido_zfm": {
"competencia_apuracao": "2026-01",
"classificacao": "02",
"valor_ibs": 2.0
},
"estorno_credito": {
"valor_ibs": 1.0,
"valor_cbs": 0.5
}
},
"issqn": {
"iss_bc": 0,
"iss_aliquota": 0,
"iss_valor": 0,
"municipio_fato_gerador": "00000000",
"item_servico": "0000",
"deducao": 0,
"retencoes": 0,
"desconto_incondicionado": 0,
"desconto_condicionado": 0,
"iss_retido_valor": 0,
"exigibilidade": "1",
"codigo_servico": "0000",
"municipio_incidencia": "00000000",
"pais": "1058",
"processo": "12345",
"incentivo_fiscal": "2"
},
"imposto_importacao": {
"ii_bc": 0,
"despesas_aduaneiras": 0,
"ii_valor": 0,
"iof_valor": 0
}
}
}
],
"transporte": {
"volume": "0",
"especie": "PECAS",
"peso_liquido": 0,
"peso_bruto": 0,
"transportadora": {
"cnpj": "00000000000000",
"cpf": "00000000000",
"razao_social": "XXXXXX XXXXXX XXX",
"nome_completo": "XXXXXX XXXXXX XXX",
"ie": "00000000",
"endereco": "XXXX XXXX",
"numero": "XXX",
"complemento": "XXXX XXXXXX",
"bairro": "XXXXXXX XXXX",
"cep": "00000000",
"cidade": "Sao Paulo",
"uf": "SP",
"telefone": "00000000000",
"email": "abcd@efgh.com"
},
"entrega": {
"cnpj": "00000000000000",
"cpf": "00000000000",
"razao_social": "XXXXXX XXXXXX XXX",
"nome_completo": "XXXXXX XXXXXX XXX",
"ie": "00000000",
"endereco": "XXXX XXXX",
"numero": "XXX",
"complemento": "XXXX XXXXXX",
"bairro": "XXXXXXX XXXX",
"cep": "00000000",
"cidade": "Sao Paulo",
"uf": "SP",
"telefone": "00000000000",
"email": "abcd@efgh.com"
},
"retirada": {
"cnpj": "00000000000000",
"cpf": "00000000000",
"razao_social": "XXXXXX XXXXXX XXX",
"nome_completo": "XXXXXX XXXXXX XXX",
"ie": "00000000",
"endereco": "XXXX XXXX",
"numero": "XXX",
"complemento": "XXXX XXXXXX",
"bairro": "XXXXXXX XXXX",
"cep": "00000000",
"cidade": "Sao Paulo",
"uf": "SP",
"telefone": "00000000000",
"email": "abcd@efgh.com"
}
},
"totais": {
"icms_bc": 0,
"icms_valor": 0,
"icms_valor_desonerado": 0,
"icms_st_bc": 0,
"icms_st_valor": 0,
"fcp_valor": 0,
"fcp_st_valor": 0,
"fcp_st_retido_valor": 0,
"ipi_valor": 0,
"ipi_devolvido_valor": 0,
"pis_valor": 0,
"cofins_valor": 0,
"ii_valor": 0,
"valor_produtos": 6700,
"valor_seguro": 0,
"valor_outras_despesas": 0,
"valor_desconto": 0,
"valor_frete": 0
},
"totais_issqn": {
"valor_servicos": 0,
"iss_bc": 0,
"iss_valor": 0,
"pis_valor": 0,
"cofins_valor": 0,
"data_competencia": "2025-02-27",
"deducao": 0,
"outras_retencoes": 0,
"desconto_incondicionado": 0,
"desconto_condicionado": 0,
"iss_retido_valor": 0,
"regime_especial_tributacao": "1"
},
"fatura": {
"numero": "000000000",
"valor": 6700,
"desconto": 0,
"valor_liquido": 6700
},
"parcelas": [
{
"numero": 1,
"valor": 6700,
"vencimento": "2025-03-27"
}
],
"responsavel_tecnico": {
"cnpj": "00000000000000",
"razao_social": "XXXXXX XXXXXX XXX",
"telefone": "00000000000",
"email": "abcd@efgh.com"
},
"protocolo": {
"motivo": "Autorizado o uso da NF-e",
"status": "100",
"data_recebimento": "2025-02-27T13:28:33-03:00",
"numero_protocolo": "000000000000000"
},
"docs": {
"xml": "<nfeProc versao=\"4.00\" xmlns=\"http://www.portalfiscal.inf.br/nfe\">...</nfeProc>",
"pdf": "H4sIAAAAAAAAA+3BMQEAAADCoPVEAAA..."
}
} When you look up a specific document by UUID, the response is the document object itself, without the data wrapper. The docs object holds the available files:
Important: The lookup of a single NF-e, NFS-e, CT-e or MDF-e can return docs.xml and docs.pdf, depending on which files are available. Empty fields may be left out, including the docs object when no file is available. An NF-e available only as a summary has no PDF.
| Field | Format | Description |
|---|---|---|
docs.xml | String (plain text) | Text of the available XML. After you parse the JSON response, save the string as it is, without decoding HTML entities: entities such as & are part of the XML itself. |
docs.pdf | String (Base64 + Gzip) | PDF of the tax document, compressed with Gzip and then encoded in Base64. You must decode and decompress it. |
{
"docs": {
"xml": "<nfeProc versao=\"4.00\" xmlns=\"http://www.portalfiscal.inf.br/nfe\">...</nfeProc>",
"pdf": "H4sIAAAAAAAAA+3BMQEAAADCoPVEAAA..."
}
} The docs.pdf field is compressed and encoded to reduce the response size. To get the original PDF file, follow these steps:
<?php
// Assuming $response holds the lookup JSON, already parsed as an array
$pdfBase64 = $response['docs']['pdf'];
$xmlContent = $response['docs']['xml'];
// Keep the text and the entities of the XML itself
file_put_contents('documento.xml', $xmlContent);
// Process the PDF
$pdfCompressed = base64_decode($pdfBase64);
$pdfContent = gzdecode($pdfCompressed);
file_put_contents('documento.pdf', $pdfContent);
echo "Files saved successfully!";
?> Warning: The code examples assume that both files are available; check that each field exists before you read it. The shortened PDF above is only an illustration. The escaping used to show XML on this page is not an encoding step of the API; do not apply HTML decoding to the XML you receive.
The status update lets you request a check of your tax documents' status and events without waiting for the next automatic update. The request does not guarantee new events or a status change.
Use it when you need to check right away whether the document status changed or whether SEFAZ (the state tax authority) registered new events.
To update the status, send a GET request to /2/monitor/documentos/{uuid}?atualizar_status=1. It is the same URL as the lookup, with the atualizar_status=1 parameter. The system tries to query SEFAZ when the document meets the conditions below:
| Rule | How it works |
|---|---|
| Available for | Full NF-e, MDF-e and CT-e (including CT-e OS and GTV-e), with an access key and an active digital certificate of the company. |
| Conditions | Issued in the last 30 days, with a status other than cancelado or encerrado. NF-e summaries are not updated by this option. |
| Interval | When at least one event is applied, new attempts for the same document are blocked for 10 minutes. One update per hour is not guaranteed. |
| Response | Same format as the standard lookup, without the data wrapper. If the update is not applied, it returns the data already collected. |
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
"https://api.webmania.com.br/2/monitor/documentos/00000000-0000-0000-0000-000000000000?atualizar_status=1"The import adds tax documents to the company's Fiscal Monitor, in addition to the ones collected automatically. The company must belong to the authenticated account, have an active digital certificate and not be inactive.
To import a document, send a POST request to /2/monitor/documentos/importacoes, with exactly one input method per request:
| Input method | How it works |
|---|---|
chave | Access key of the NF-e. The import is synchronous and the response contains the document. |
xml | Text of the XML, encoded in Base64. The import is synchronous and the response contains the document. |
url_arquivo_zip | URL of a ZIP file with up to 5,000 XML files. Processing is asynchronous: the result arrives at the company's url_notificacao, with tipo_notificacao 5. |
To import a tax document by access key, send a POST request to /2/monitor/documentos/importacoes, with the empresa_uuid and the chave. Do not send xml or url_arquivo_zip in the same request.
| Parameter | Required | Type | Description |
|---|---|---|---|
empresa_uuid | string | Company UUID Note: The selected company must meet the conditions for taking part in the tax document. Learn more | |
chave | string | Access key with exactly 44 characters. Positions 7 to 18 accept letters and numbers; the other positions must be numeric. Required in this method. Do not send xml or url_arquivo_zip together with the key. |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
"https://api.webmania.com.br/2/monitor/documentos/importacoes" \
-d '{
"empresa_uuid": "00000000-0000-0000-0000-000000000000",
"chave": "00000000000000000000000000000000000000000000"
}' The HTTP 200 response has the imported tax document, in the same format as the document lookup, which has examples for each document type.
Besides the access key, you can import tax documents by XML, in two ways:
XML (base64): send the text of the XML encoded in Base64, without Gzip. The import is synchronous and returns the document object itself, without the data wrapper. The example below encodes a minimal illustrative XML, not a tax document that can be imported.
ZIP file: send the URL of a ZIP file of up to 50 MB with up to 5,000 XML files. Processing is asynchronous: follow the result through the notification URL set for the company.
To import by XML or by ZIP, send a POST request to /2/monitor/documentos/importacoes, with the parameters below in the request body:
| Parameter | Required | Type | Description |
|---|---|---|---|
empresa_uuid | string | Company UUID Note: The selected company must take part in the tax document as one of the parties, or have its CNPJ/CPF listed as authorized to access the XML. | |
xml | string | Text of the XML, as valid Base64, without compression. String limit: 2,097,152 characters. The decoded XML has a default limit of 1 MiB, depending on the service configuration. Required when neither chave nor url_arquivo_zip is sent. | |
url_arquivo_zip | string | Valid URL of up to 2,048 characters for a ZIP with XML files, subject to the security policy of the service. Required when neither chave nor xml is sent. |
Important: use exactly one of the chave, xml or url_arquivo_zip fields per request. The empresa_uuid field is always required and must be a valid company UUID of the authenticated account.
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
"https://api.webmania.com.br/2/monitor/documentos/importacoes" \
-d '{
"empresa_uuid": "00000000-0000-0000-0000-000000000000",
"xml": "PE5GZT48L05GZT4="
}' The HTTP 200 response has the imported tax document, in the same format as the document lookup, which has examples for each document type.
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
"https://api.webmania.com.br/2/monitor/documentos/importacoes" \
-d '{
"empresa_uuid": "00000000-0000-0000-0000-000000000000",
"url_arquivo_zip": "https://exemplo.com/arquivo.zip"
}' Example of an HTTP 200 response for the ZIP: the JSON object contains the import progress and the imported and discarded documents. Returned fields:
| Parameter | Type | Description |
|---|---|---|
uuid | string | UUID that identifies the import batch. |
empresa_uuid | string | Company UUID. |
status | string | Import status.processando (processing) |
processado | integer | Number of XML files processed so far. |
total | integer | Total number of XML files to process, when known. The field may be left out while this total is not available. |
importados | array | List of documents imported successfully: arquivo (XML file name) and uuid (UUID of the tax document). May be empty. |
descartados | array | List of discarded documents: arquivo (XML file name) and motivo (description of the failure). May be empty. |
If you repeat the same POST with the same empresa_uuid and url_arquivo_zip, the service returns the existing progress while it is available; this does not necessarily start a new batch. The processado field is the sum of the imported and discarded items. If you choose to follow the progress this way, we recommend waiting at least 5 seconds between requests.
If you set url_notificacao in the company settings, a POST is sent to that URL when the import finishes, with tipo_notificacao: 5 and the batch data inside data. This notification wrapper is different from the direct response to the import POST shown below.
When the import is complete, the status changes to concluido, and the importados and descartados parameters show which documents were imported successfully and which were discarded. The discard reason in motivo is in Portuguese; in this example, it says that the access key has no authorization protocol at the SEFAZ. Example of an HTTP 200 response with the import complete:
{
"uuid": "00000000-0000-0000-0000-000000000000",
"status": "concluido",
"empresa_uuid": "00000000-0000-0000-0000-000000000000",
"importados": [
{
"arquivo": "arquivo1.xml",
"uuid": "00000000-0000-0000-0000-000000000000"
},
{
"arquivo": "arquivo2.xml",
"uuid": "00000000-0000-0000-0000-000000000000"
}
],
"descartados": [
{
"arquivo": "arquivo3.xml",
"motivo": "A chave do documento fiscal não possui protocolo de aprovação na SEFAZ."
}
],
"processado": 3,
"total": 3
} This import brings tax documents into the Fiscal Monitor of the company linked to the Fiscal Issuer token, to use them when calculating tax payment slips (guias). The Fiscal Monitor service must be active, and the company and its digital certificate must be active.
To import documents for payment slips, send a POST request to /2/guias/importacoes. Do not send empresa_uuid in the request: the token identifies the company.
The payment slip calculation can use NF-e (model 55) issued by the company itself that are authorized, not canceled and have a verified protocol, in the same environment as the calculation. An accepted import does not guarantee that the document is eligible: the calculation checks these requirements. For an NF-e imported by XML, SEFAZ is queried in production; a sandbox (homologação) XML is not accepted. If the check shows a cancellation (SEFAZ status code 101 or 151), the document is stored as cancelado and is not used in the payment slips.
Send exactly one of the options below in the JSON body, with the company's Bearer token in the Authorization header.
| Parameter | Required | Type | Accepted format and values |
|---|---|---|---|
xml | One of the options | string | Content of one XML file, encoded as valid base64: up to 2,097,152 encoded characters and, by default, 1 MiB after decoding. |
url_arquivo_zip | One of the options | string | Public HTTPS URL of a ZIP file with XML files, with up to 2,048 characters and allowed by the URL security policy. |
Encode the full content of the XML file in base64 and send the result in the xml field. A single import is synchronous.
{ printf '{"xml":"'; base64 < nota.xml | tr -d '\n'; printf '"}'; } | \
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @- \
https://api.webmania.com.br/2/guias/importacoes This sends the JSON through standard input, so the base64 content never goes into a shell argument. Replace nota.xml with the file to import and stay within the limits above.
On success, the HTTP 200 response has the imported document, in the same format as Look up a document. The example below shows the main fields of an NF-e; the full response may also have other fields, depending on the document:
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"empresa_uuid": "550e8400-e29b-41d4-a716-446655440001",
"modelo": "nfe",
"status": "aprovado",
"categoria": "emitidas",
"chave": "35250211111111000111550010000123451234567890"
} The fields depend on the document and may be left out when not available. In the response for an NF-e:
| Response field | Type | Description |
|---|---|---|
uuid | string | UUID of the tax document. |
empresa_uuid | string | UUID of the company in the Fiscal Monitor; it is not an input parameter of this route. |
modelo | string | Document type; for NF-e, nfe. |
status | string | Document status, for example aprovado or cancelado. |
categoria | string | How the company takes part in the document, for example emitidas or recebidas. |
chave | string | Access key of the document, with 44 characters. |
ZIP processing is asynchronous. Repeat the same request to follow the progress.
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url_arquivo_zip": "https://exemplo.com/documentos.zip"
}' \
https://api.webmania.com.br/2/guias/importacoes Example of the first HTTP 200 response:
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"status": "processando",
"empresa_uuid": "550e8400-e29b-41d4-a716-446655440001",
"importados": [],
"descartados": [],
"processado": 0
} | Response field | Type | Description |
|---|---|---|
uuid | string | UUID of the import. |
status | string | Import status: processando, concluido or invalido. |
empresa_uuid | string | UUID of the company in the Fiscal Monitor. |
importados | array | Imported documents; each object has uuid (string, document ID) and arquivo (string, file name). |
descartados | array | Discarded documents; each object has arquivo (string, file name) and motivo (string, reason for the discard). |
processado | integer | Number of processed documents, including imported and discarded ones. |
total | integer, optional | Total number of documents found, when available. |
erro | string, optional | Error message for the file, if any. |
codigo | string, optional | Error code for the file, if any; for example, zip_invalido. |
Errors return error (string, message) and, for business refusals, may include codigo (string, refusal code). Check the HTTP code and the response body. Error messages are in Portuguese.
Request example with invalid base64:
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"xml": "%%%"
}' \
https://api.webmania.com.br/2/guias/importacoes HTTP 400 response (the message means "The xml field is not valid base64."):
{
"error": "O campo xml não está em base64 válido."
} HTTP 422 example when the company is not linked to an available Fiscal Monitor (the message says this; codigo is empresa_sem_monitor):
{
"error": "A empresa não possui vínculo disponível com o Monitor Fiscal.",
"codigo": "empresa_sem_monitor"
} The API may also return HTTP 401 for a missing or invalid token, HTTP 403 when access to the company is not authorized, HTTP 400 for an inactive company or certificate, and HTTP 422 when a document is not available for import.
The recipient acknowledgment (manifestação do destinatário) records with SEFAZ (the state tax authority) the company's position on an NF-e it received. There are four possible responses: Confirmação da operação (the company confirms the transaction), Desconhecimento da operação (the company does not recognize it), Operação não realizada (the transaction did not take place) and Ciência da operação (the company is aware of it). Available only for an NF-e received by the recipient company.
To register the acknowledgment, send a POST request to /2/monitor/documentos/{uuid}/eventos, replacing {uuid} with the UUID of the tax document.
status = pendente.| Parameter | Required | Type | Description |
|---|---|---|---|
evento | integer | Event type 1 - Recipient acknowledgment (Manifestação do destinatário) | |
manifestacao | integer | Acknowledgment type 1 - Confirmação da operação (confirms the transaction) | |
justificativa | string | Reason for the event Required for acknowledgment type 3. Optional for the other types. When sent, it must have 15 to 255 characters. |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"evento": 1,
"manifestacao": 1
}' \
https://api.webmania.com.br/2/monitor/documentos/00000000-0000-0000-0000-000000000000/eventos Partial example of an HTTP 200 response, with the ID and date of the created event. The content of log depends on the tax service's response:
{
"uuid": "00000000-0000-0000-0000-000000000000",
"documento_uuid": "00000000-0000-0000-0000-000000000000",
"registrado_em": "2024-12-15 12:56:40",
"log": {}
} The export generates a file with the documents that match the document list filters, in CSV, XML, Excel or PDF format. The file is generated in the background.
To export a report, send a POST request to /2/monitor/documentos, with the filters you need plus the modelo and relatorio parameters. The url_notificacao parameter is optional.
| Parameter | Required | Type | Description |
|---|---|---|---|
relatorio | string | Report format to export xml | |
url_notificacao | string | Valid URL that receives a notification when the export is complete. When sent, it cannot be empty. |
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"modelo" : "nfe",
"filtros": {
"ambiente": 1,
"empresa_uuid": "00000000-0000-0000-0000-000000000000",
"categoria": "emitidas",
"data_inicial": "2025-07-11",
"data_final": "2025-07-11",
"serie": "1",
"numero": "12345",
"valor": "100.00"
},
"relatorio": "xml",
"url_notificacao": "https://seusite.com.br/api/relatorio-concluido"
}' \
https://api.webmania.com.br/2/monitor/documentos Example of an HTTP 200 response, with the report details (fields whose value is zero, such as processado, may be left out):
{
"uuid": "00000000-0000-0000-0000-000000000000",
"relatorio": "xml",
"modelo": "nfe",
"status": "processando",
"total": 120
} To track progress, repeat the same request: processado shows how many documents are already in the file. Wait at least 5 seconds between requests. If you sent url_notificacao, a POST is sent to that URL when the export finishes.
When the export is complete, the status changes to concluido and the url parameter contains the report's download URL:
{
"uuid": "00000000-0000-0000-0000-000000000000",
"relatorio": "xml",
"modelo": "nfe",
"status": "concluido",
"processado": 120,
"total": 120,
"url": "https://api.webmania.com.br/2/monitor/documentos/relatorios/00000000-0000-0000-0000-000000000000",
"expira_em": "2025-07-25 15:20:10"
} This endpoint shows how many tax documents were downloaded in a period: the overall total and the breakdown for the 10 companies with the highest volume.
To get the download statistics, send a GET request to /2/monitor/estatisticas/downloads.
| Parameter | Required | Type | Description |
|---|---|---|---|
ano | integer | Reference year (4 digits, minimum 2025). Default: current year. Required when the | |
mes | integer | Reference month (1 to 12). Default: current month. Required when the |
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
https://api.webmania.com.br/2/monitor/estatisticas/downloads?ano=2026&mes=5 Example of an HTTP 200 response:
{
"total_downloads": 42,
"empresas": [
{ "empresa_uuid": "f1c2d3e4-...", "total_downloads": 30 },
{ "empresa_uuid": "a5b6c7d8-...", "total_downloads": 12 }
]
} Example of an HTTP 400 response, when the year and month are in the future. The message means "The year and month sent cannot be later than the current date.":
{
"error": "O ano e mês informados não podem ser maiores que a data atual."
} 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.
The same entry IPs serve the whole world. Your request goes to the server closest to you, with no setup on your side.
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.
Fixed IPs for inbound and outbound traffic: allow them in your firewall and check the source of the notifications you receive.
13.248.145.9076.223.17.24034.196.69.3844.219.142.86Webmania® limits the number of requests per second and the total number of requests per month based on the chosen plan. The count adds up the requests from the client side and from the server side. If the application goes over the initial limit, its requests will fail.
https://webmania.com.br/api/ returns 403 Forbidden, contact us and we will allow the IP of your server. The documentation explains how to generate the access token in the Webmania® Panel.
Changed section: autenticacao
Documented the national standard NFS-e events 101103 (request for a tax review to cancel) and 105104 (cancellation approved by tax review), with JSON examples and their effect on the document status.
Changed section: listar-eventos-nfse
The documentation covers importing XML and ZIP files for payment slip calculation with Fiscal Monitor documents.
Changed section: importar-para-guias
The documentation is now LLM-ready: copy the page or each section as Markdown, a section index and llms.txt.