webmania®
  • Contact

Region and language

Brazil

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

Document guide

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

Tax intelligence and security

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

Start here

Brazil tax guideComplete guide

Popular chapters

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

By company size

Mid-sized Companies

Other industries

ManufacturingBanks & FintechsServices & Subscriptions
Developers
See all documentation →

Tax & Invoicing

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

Logistics & Transport

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

Payments & Management

GNREDARE‑ICMS SPDUA‑ESB2B Management

Resources

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

Webmania

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

Document guide

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

Document guide

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

Tax intelligence and security

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

Not sure where to start?

Book a demo →

Tax & Invoicing

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

Logistics & Transport

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

Payments & Management

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

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

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

By company size

Mid-sized CompaniesOperations that are scaling up

Other industries

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

Not sure where to start?

Book a demo →

Webmania

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

In numbers

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

Not sure where to start?

Book a demo →

Start here

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

Go deeper

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

Goods and services

NF‑eElectronic invoiceNFC‑eConsumer receiptNFS‑eService invoiceNFComTelecom invoice

Transport

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

Taxes and reform

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

Not sure which documents your operation needs?

Book a demo →
  • DUA-ES REST API
  • Quick guide
    • Configure the Company
    • Covered States
    • CNAB 240 Export
  • SDKs & LLMs
    • LLM-ready
    • Webmania SDKs
    • Examples
  • Authentication
  • Response format
  • Notifications
  • DUA-ES Batch Issuing
    • Import Documents
    • Start a Calculation
    • Get a Calculation
      • Planned Slips
      • Pending Items
      • Refusals
    • Confirm a Calculation
    • List Slips
    • Get a Slip
  • Batch Payment
    • Slip Status
    • Prepare an Export
    • Get an Export
      • Exclusions
    • Download File
    • Banks and Restrictions
      • Banks by Slip Type and State
    • Send the Bank Return File
    • Get a Bank Return
      • Record and Webhook
  • DUA-ES Single Issuing
    • Accredited Agencies
    • Area and Service
    • City
    • Service Amount
    • Request Parameters
    • Request Example
    • Overdue Tax Debt (CDA)
  • Status Lookup
    • Result Fields
    • Processing and Contingency
  • Lookups
    • DUA-e Lookup
    • Get the PDF
    • Paid DUA-e
  • Error Codes
    • Return Codes
  • Infrastructure
  • Request limits
  • Changelog
⚡ Follow in real time (in Portuguese): Status | SEFAZ Monitor | City Hall Monitor

Last updated: November 17, 2026 · v1.1.1 Beta

Region and language

Brazil

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

DUA-ES REST API

Documentation for issuing and looking up the electronic payment slip of the state of Espírito Santo (DUA-e)

DUA-ES payment slip issued through the API DUA-ES payment slip issued through the API

The Webmania® REST API creates and looks up DUA-e payment slips of the state of Espírito Santo from your company's NF-e (electronic invoices for goods). The invoices can be issued by the Webmania® Fiscal Issuer, or by another issuer and imported into the Fiscal Monitor. Each slip has a barcode, a payment code (linha digitável: the barcode number you type into online banking) and a PIX code (instant payment). The calculation reads the XML of each invoice and works out which slips are due. It returns everything for you to review before the slips are issued. To start, read the Quick guide. Need to issue other document types? See the documentation

What is the DUA-e? A payment slip (guia) is the government's bill for a tax. The DUA-e (Documento Único de Arrecadação Eletrônico) is the official payment slip of the state of Espírito Santo. One document collects state taxes, fees and other state revenue. Examples are DIFAL and FCP-DIFAL in interstate sales to final consumers (buyers who do not resell the goods). DIFAL is the interstate rate difference: the destination state's share when a sale crosses states. FCP-DIFAL is the FCP part of that share; FCP is the poverty fund surcharge, an extra ICMS rate. ICMS is the state sales tax, and ICMS-ST is ICMS tax substitution, where one company in the chain pays in advance the ICMS for the rest of the chain. Each slip names a state agency, an area and a service. Each service has a revenue code, the number that tells the state which tax or fee you pay. Issuing a slip does not pay the tax: you pay each slip after it is issued. Each invoice is handled in one of three ways:

Automatic generation

The invoice XML has everything the slip needs. The calculation returns the slip in guias, ready for you to review and confirm.

Generation with a parameter

The slip needs a value that is not in the XML, such as an ICMS agreement or the state's product code. The calculation returns pendencias with the exact field in o_que_enviar[]. Send it in a new calculation.

Monthly tax return by the accountant

If the company has a state registration (IE) in the destination state, including as a tax substitute (ICMS-ST), or a special tax regime there, the accountant pays the tax in the monthly return and no slip is generated. The API detects this from the XML or from the states marked in the company configuration. It reports the case in recusas, with acao: apuracao_periodica.

A scenario the API does not cover yet also appears in recusas, with the reason and the suggested action. Sending a parameter never unlocks a refused scenario. See the calculation refusals.

Production only. SEFAZ/ES (the Espírito Santo state tax authority) has no test environment (homologação) for the DUA-e. Every issue request runs in production and creates a real, payable document, and there is no cancellation. Review the data before you confirm.

Brazilian tax terms you will see. They keep their Brazilian names in the payload and on the slip:
ICMS: the state sales tax on goods, calculated on each line of the NF-e with the rate of each state. The calculation reads it from the invoice XML.
DIFAL: the destination state's ICMS rate minus the interstate rate, on goods sold to a final consumer in another state. tributo = difal.
FCP: a small extra ICMS percentage some states charge, collected with the ICMS; with the DIFAL it is the FCP-DIFAL. tributo = fcp_difal.
ICMS-ST: ICMS collected in advance by one company in the chain. The calculation does not create ICMS-ST slips automatically.
SEFAZ: the state tax authority; for the DUA-e, SEFAZ/ES.
CNPJ / CPF / IE: the company ID (14 digits), the individual taxpayer ID (11 digits) and the state registration. The agency's CNPJ goes in cnpj_orgao; the taxpayer's CPF or CNPJ in documento_contribuinte.
Every term in plain English: glossary of Brazilian tax terms.

Only Espírito Santo uses the DUA-e

The slip type depends on the state that receives the tax: São Paulo uses the DARE-ICMS, Espírito Santo uses the DUA-e, and the other states use the GNRE. One calculation plans the slips for every state in the selected invoices, each one with the right slip type. The API never switches the slip type for you. ICMS-ST and FCP-ST for SP and ES are not generated automatically.

Other states → GNRE National payment slip for state taxes. See the documentation São Paulo → DARE-ICMS SP São Paulo state tax payment slip. See the documentation
This API is in beta. The endpoints and fields in this documentation are available, but they may change during the beta. Changes are listed in the Changelog. Need to issue other document types? See the documentation
Availability and Security
High availability, scalable and redundant servers at the highest PCI DSS security level, on Amazon Web Services, the global cloud computing leader.
Storage
Secure, encrypted and unlimited storage of your tax documents on Amazon S3.
REST API Integration
Works with every programming language through JSON, with low latency on a global infrastructure.
Automatic DUA-e
Issue the DUA-e with a payment code and a PIX QR code directly with SEFAZ/ES.
SEFAZ/ES Lookups
Look up areas, services, cities, amounts and paid DUA-e in real time.
Expert Support
Expert help with tax integration and programming.

Quick guide

Send every request over encrypted HTTPS to https://api.webmania.com.br. The /2/ prefix means that we currently use version 2.0 of the API.

URLHTTP VerbFunction
/2/empresaPOSTUpdate the company configuration
/2/guias/importacoesPOSTImport invoices from another issuer into the Fiscal Monitor
/2/guias/apuracoesPOSTStart a calculation
/2/guias/apuracoes/{uuid}/confirmarPOSTConfirm issuance of the slips
/2/guias/exportacoesPOSTPrepare an export for payment
/2/guias/exportacoes/{uuid}/retornosPOSTSend a bank return file
/2/dua/emissaoPOSTIssue a DUA-e with amounts you provide
/2/dua/emissao-cdaPOSTIssue a DUA-e for overdue tax debt (dívida ativa)
/2/dua/consultaPOSTLook up a DUA-e
/2/dua/pagosPOSTLook up paid DUA-e
/2/empresaGETGet the company configuration
/2/guias/apuracoes/{uuid}GETGet a calculation
/2/guias/apuracoes/{uuid}/guiasGETList the slips of a calculation
/2/guias/apuracoes/{uuid}/pendenciasGETGet the pending items
/2/guias/apuracoes/{uuid}/recusasGETGet the refusals
/2/guiasGETList issued slips
/2/guias/{uuid}GETGet a slip
/2/guias/exportacoes/{uuid}GETGet an export
/2/guias/exportacoes/{uuid}/arquivoGETDownload the export file
/2/guias/exportacoes/{uuid}/retornos/{retorno}GETGet a bank return and its reconciliation
/2/dua/status/{uuid}GETGet the status of a DUA-e
/2/dua/pdf/{numero_guia}GETGet the PDF of a DUA-e
/2/dua/area-servicoGETLook up areas and services
/2/dua/municipioGETLook up cities
/2/dua/valor-servicoGETGet the amount of a service

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

How to integrate batch issuing:

  1. Configure the company One-time setup: mark the states where the company has a state registration (IE) or a special tax regime.
  2. Import invoices from another issuerif needed Only for NF-e issued outside Webmania: they come in through the Fiscal Monitor. Invoices from the Webmania® Fiscal Issuer are already available.
  3. Start the calculation Select the invoices by period, access keys or UUIDs.
  4. Review the result Get the planned slips, the pending items and the refusals.
  5. Complete the pending itemsif needed If the calculation asks for a value that is not in the XML, send it in a new calculation.
  6. Confirm issuance Choose all or only some of the planned slips.
  7. Track and pay Track each slip by webhook or lookup, then pay it with the payment code (linha digitável) or PIX, or in a CNAB 240 batch. See CNAB 240 Export.

Already have the calculated amounts? DUA-ES single issuing issues one slip with the amounts you send, without a calculation. For overdue tax debt (dívida ativa), the debt certificate (CDA) number is enough.

Quick guide
Configure the Company

Before the first calculation, list the states where the company has an IE (Inscrição Estadual, the state registration of a company that pays ICMS), including as a tax substitute (ICMS-ST), or a special tax regime. In those states the accountant pays the tax in the monthly return, and the API does not generate a slip. Check the list with whoever handles the company's taxes: a missing state can generate slips that are not due.

In the Webmania® Panel, go to Configurações da empresa › Nota Fiscal › Guias de Pagamento (company settings › invoices › payment slips). If you use only the Fiscal Monitor, use the Empresa (company) tab. Through the API, send the state codes in POST /2/empresa:

{
  "guias_declaracao_ufs": ["SP", "MG"]
}

Send [] to mark no state. If you omit the field, the configuration does not change. GET /2/empresa returns the current configuration.

Quick guide
Covered States

The DUA-e covers Espírito Santo only. DIFAL and FCP-DIFAL are generated automatically. The ES ICMS-ST (revenue code 137-6) and the FCP-ST are not generated. An invoice whose receiving state is not ES is refused with uf_fora_escopo, which names the right slip.

DIFAL

ES

FCP-DIFAL

ES

UF automatic state · UF state that needs a parameter, requested as a pending item

The path of each invoice inside the calculation:

How each invoice is handled in the calculation If the company has a state registration (IE) or a special tax regime in the state, the invoice goes to the accountant's monthly tax return. Otherwise, if the scenario is not released, the invoice is refused with a reason and an action. If it is released and the XML has all the data, the slip is ready. If a value is missing, it becomes a pending item, which you complete in a new calculation. NF-e in the calculation Company has IE or special regimein the destination state? Is the scenario released forthis state and tax? Does the XML have allthe slip data? Accountant's monthly return No slip generated Slip ready Pending item recusas · acao: apuracao_periodica recusas · reason and suggested action guias · review and confirm pendencias · field in o_que_enviar[] YesNoYes NoYesNo new calculation with the parameter
Each invoice is checked per state and per tax. One invoice can produce a slip and a refusal.

Quick guide
CNAB 240 Export

Once the slips are issued, you can pay them in a batch. CNAB 240 is the Brazilian bank file standard: instead of paying one slip at a time, the API builds one CNAB 240 file for your bank. Later, it reads the bank return file and marks the slips as paid automatically.

1Export

Create the CNAB 240 remittance file with slips that are already issued: from a whole calculation or from a list of slips.

2Pay at the bank

Send the file to your bank and authorize the payment. One file pays all the slips, with no need to type each code.

3Import the return

Send the bank return file. The API reconciles each slip and marks it as pago (paid), with a webhook notification.

Banks that collect DUA-ES: 001 Banco do Brasil, 033 Santander, 237 Bradesco, 341 Itaú and 756 Sicoob. 041 Banrisul and 748 Sicredi do not collect DUA-ES: the slip stays out of the file, and the export reports it.

Creating the file does not pay the slips. You always authorize the payment yourself, at the bank, under your own bank agreement and account. The parameters, exclusions and error codes are in Batch payment.

SDKs & LLMs

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

LLM-ready

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

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

Webmania SDKs

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

  • Node.js / TypeScript Available

    Node.js >= 22 README

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

  • Python Available

    Python >= 3.11 README

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

  • PHP Available

    PHP >= 8.3 README

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

  • Perl Available

    Perl 5.36 README

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

  • Go Available

    Go 1.26 README

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

  • C Available

    C11, Linux arm64 README

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

  • C++ Available

    C++, Linux arm64 README

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

  • Lua Available

    Lua 5.4, Linux arm64 README

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

  • Dart Available

    Dart >= 3.8.3, Linux arm64 README

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

  • R Available

    R >= 4.6.2, Linux arm64 README

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

  • Java Available

    Java 17+ README

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

  • Kotlin Available

    Kotlin 2.4 / JVM 17+ README

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

  • Scala Available

    Scala 3.3 / JVM 17+ README

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

  • Clojure Available

    Clojure 1.12 / JVM 17+ README

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

  • Ruby Available

    Ruby 3.3, Ruby 3.4 README

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

  • .NET (C#) Available

    .NET 10 README

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

  • PowerShell Available

    PowerShell 7.6 README

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

  • Elixir Available

    Elixir ~> 1.18, Linux arm64 README

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

  • Rust Available

    Rust >= 1.85 README

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

  • Haskell Available

    GHC 9.6.7, Linux arm64 README

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

  • Swift Available

    macOS 13+, iOS 16+ README

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

Examples

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

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

Authentication

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

Authorization: Bearer {Access-Token}

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

You do not need to send a digital certificate in your requests to the Webmania® API.

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

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

Response format

API responses are JSON, with field names in snake_case. Accepting a request does not confirm that the slips were approved or paid. Track each slip by its UUID in the Status lookup and review the refusals in Refusals.

HTTPWhen it happens
200The lookup was answered, or the issue request was received for processing. A received issue request is not an approved slip yet; track the uuid.
202Calculation created or confirmation accepted, in Batch issuing.
400Input refused in the document import, for example invalid JSON or an xml that is not base64.
401Missing or invalid token.
403Inactive subscription, feature not available for the account, or access not authorized.
404The slip or calculation does not exist, belongs to another company or is of another type.
409A slip was already generated or reserved for the obligation (guia_gerada), or there is a conflict in the calculation confirmation (for example, apuracao_expirada).
422Invalid data. Read error and, when present, codigo.
429Request limit exceeded. See Request limits.
500Internal error. Keep the UUIDs you already received, and look up each slip before you request another one.
503Temporarily unavailable. This failure alone does not confirm the result of an earlier request.

In error responses, the JSON body has error. The other fields depend on the error:

FieldType and presenceDescription
errorstring, in every errorError message.
codigostring, depending on the errorRefusal code, when returned.
error_codestring, in subscription HTTP 403 errorsSubscription status code.
action_urlstring, in subscription HTTP 403 errorsURL where the subscription can be fixed; use the value returned in the response.

Example of invalid authentication, HTTP 401 ("Restricted access. Token missing or invalid."):

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

Example of an inactive subscription, HTTP 403 ("Trial period expired. Activate your subscription to continue."):

{
  "error": "Período de teste expirado. Ative sua assinatura para continuar.",
  "error_code": "trial_expired",
  "action_url": "https://webmania.com.br/"
}

The refusal codes and messages of each service are listed in Error codes.

In the SEFAZ-ES lookups (DUA-e, PDF, paid slips, area and service, city and service amount), an HTTP 200 response can carry a SEFAZ-ES refusal in codigo_retorno or a communication failure in error. Other validation failures in these lookups also return HTTP 200 with error, so always read the body. The codes are in Return codes.

Environment: the DUA-e accepts only ambiente: 1 (production); see the notice in the Quick guide. A request with ambiente: 2 is refused with HTTP 422 and codigo: dua_sem_ambiente_homologacao. For a calculation that includes DUA-e, also send data_pagamento in the YYYY-MM-DD format (year-month-day).

Notifications

To keep your platform always up to date, Webmania® sends an automatic notification for every status change of every slip. With notifications, you do not need to poll the API for updates: wait for the webhook and update the slip in your system when it arrives.

The notification is sent by POST, in JSON, to the URL in url_notificacao. Send this URL in the issue request and also in the calculation, where it is optional. Without it, a slip generated by the calculation is not notified.

Notified statusWhen it is sent
pendenteThe DUA-e was issued and is ready for payment.
reprovadoThe issue request was refused, including by SEFAZ (the state tax authority). The body has motivos_rejeicao.
pagoThe bank return file of a CNAB 240 export confirmed that the slip was paid in full.

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

It is created as soon as the API accepts the request, before anything is sent to SEFAZ, and it is permanent: it does not change on retries. Use the UUID, not the position in the list or the SEFAZ receipt, to identify the slip in your database. One calculation can generate several slips, each with its own UUID and its own notification.

The POST request is sent in application/json format:

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

Example of the POST received — approved slip, waiting for payment:

{
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "modelo": "dua",
  "status": "pendente",
  "ambiente": 1,
  "numero_dua": "0000000000",
  "origem": "periodo",
  "guias": [{ "alocacao": "automatica", "classe": null, "complementos_aplicados": null }],
  "declaracao": {
    "ufs_com_inscricao": ["SP"],
    "texto_versao": "guias-declaracao-uf/v2",
    "atualizada_em": "2026-10-29T10:00:00-03:00"
  }
}

Example of the POST received — rejected slip (SEFAZ-ES return code 705: the area does not belong to the agency):

{
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "modelo": "dua",
  "status": "reprovado",
  "ambiente": 1,
  "motivos_rejeicao": [
    { "codigo": "705", "mensagem": "A Área não pertence ao Órgão" }
  ]
}

A pago webhook is also sent when the reconciled bank return file shows that the whole slip was paid. A scheduled payment, a refusal, a mismatch or a partial payment does not trigger this confirmation. The same return file does not trigger a second payment notification. See Batch payment.

Excerpt of the payment webhook. The object has the same structure validated in the slip reconciliation, with sample values; other conditional fields are left out:

{
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "modelo": "dua",
  "status": "pago",
  "pagamento": {
    "data_pagamento": "2026-11-07",
    "valor": "12.00",
    "banco": "237",
    "autenticacao": null,
    "registrado_em": "2026-11-07T00:35:37-03:00"
  }
}

Webmania® sends the fields below in the notification body. Whether the conditional fields appear depends on the data available for the slip.

FieldPresence / typeFormat, values and meaning
uuidAlways / stringUUID of the slip, with 36 characters. Match it with the issue request and the status lookup.
modeloAlways / stringdua for DUA-ES.
statusAlways / stringpendente, reprovado or pago.
pagamentoWhen pago / objectHolds data_pagamento, valor, banco, autenticacao and registrado_em; formats in Slip status and payment.
ambienteAlways / integer1, production. SEFAZ/ES offers no test environment (homologação) for the DUA-e.
numero_duaConditional / stringDUA-e number when available; missing while there is no number. For overdue tax debt (dívida ativa), it is not the CDA number.
motivos_rejeicaoConditional / arrayReasons for the rejection, when available. In the normalized form, each object has codigo and mensagem (strings); see Return codes. Older responses may keep another format.
origemConditional / stringFor slips created by the calculation, periodo or chaves, according to the selection.
notas, notas_ignoradasConditional / arrays of objectsRelated invoices and, when there are any, the subset of ignored ones. Each object has chave (string), valor_icms_st and valor_difal (decimal strings or null), motivo_ignorado (string or null) and receita (string or null).
guiasConditional / array of objectsDetails of the slip, when available: alocacao is automatica, classe is a string or null, and complementos_aplicados is an array or null.
parcelas_recusadasConditional / array of objectsInstallments not included. Their fields and formats are described in Status lookup.
declaracaoConditional / object or nullDeclaration used for the slip. ufs_com_inscricao is an array of state codes (UF) where the company declared, at the time of issuing, that it has a state registration (IE) or a special tax regime. texto_versao is the version of the declaration text, a string or null. atualizada_em is the date and time of the update, a string or null. The object can be null when the declaration is not available, and it can be missing on slips without a related calculation.

The notification does not include the full issuing result. To get it, use the Status lookup.

When there is no notification. The statuses processando and contingencia are not notified. In these cases, do not create another issue request for the same obligation. Wait for the next notification or check the slip in the Status lookup. If the mensagem shows an uncertain result, confirm it with SEFAZ-ES before you pay or issue the slip another way.

DUA-ES Batch Issuing

Batch issuing creates the payment slips from your company's NF-e (electronic invoices for goods), so you do not have to calculate any tax. The calculation (apuração) reads the XML of each invoice and returns the slips owed, the pending items and the refusals, for you to review before you confirm. One calculation plans GNRE, DARE-SP and DUA-ES slips. Issuing a slip does not pay the tax: you still have to pay each slip, for example with Batch Payment.

The invoices can come from two sources:

  • Webmania® Fiscal Issuer: NF-e issued through Webmania are already available to the calculation.
  • Another issuer: import the XML or a ZIP of the invoices into the Fiscal Monitor, through the Webmania® Panel or with Import Documents. The Fiscal Monitor service must be active. If the same access key is in both sources, the Fiscal Issuer invoice takes precedence.
Batch issuing flow Invoices issued by the Webmania® Fiscal Issuer go straight into the calculation. Invoices from another issuer go in after you import them into the Fiscal Monitor. The calculation returns slips, pending items and refusals for review. You complete pending items in a new calculation. Confirmed slips are issued and paid by payment code, PIX or CNAB 240. Fiscal Issuer Other issuer Calculation Review Confirmation Payment invoices already available import into Fiscal Monitor POST /2/guias/apuracoes slips · pending items · refusals issues the slips payment code, PIX or CNAB 240 pending items: new calculation with the parameter
A finished calculation does not mean that a slip was approved or paid. Track each slip by webhook or by lookup.

The calculation includes only model 55 NF-e that belong to your own company, are authorized and not canceled, have a verified authorization protocol and are in the requested environment. A summary without the full document is not enough.

All calls use the authentication described in Authentication. The common error responses (HTTP 401 and 403) are in Response format, and the refusal reasons are in Refusals. Selection dates use Brasília time.

DUA-ES Batch Issuing
Import Documents

Imports invoices issued by another issuer into your company's Fiscal Monitor, so they can be included in the calculation. The Fiscal Monitor service, the company and its digital certificate must be active. For NF-e (model 55), the authorization is confirmed with SEFAZ (the state tax authority). SEFAZ only allows this lookup for access keys issued within the last 6 months.

To import, send a POST request to /2/guias/importacoes with exactly one of the options below.

Request parameters:

ParameterRequiredTypeFormat and values
xml
One of the options
stringOne complete tax document encoded in base64: up to 2,097,152 encoded characters and, by default, 1 MiB after decoding.
url_arquivo_zip
One of the options
stringA valid HTTPS URL, allowed by the security policy and up to 2,048 characters long, of a ZIP file of tax documents.

Request example with a ZIP file:

curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url_arquivo_zip": "https://exemplo.com.br/documentos.zip"
  }' \
  https://api.webmania.com.br/2/guias/importacoes

Example HTTP 200 response for an import in progress:

{
  "uuid": "a1b2c3d4-e5f6-4890-abcd-ef1234567890",
  "status": "processando",
  "empresa_uuid": "8f14e45f-ceea-4d3e-a2e0-123456789012",
  "importados": [],
  "descartados": [],
  "processado": 0
}
FieldType and presenceDescription
uuidstring, alwaysUUID of the import.
statusstring, alwaysStatus of the import; initially processando (processing).
empresa_uuidstring, alwaysUUID of the company in the Fiscal Monitor, taken from the token.
importados, descartadosarrays, alwaysDocuments imported and discarded so far.
processadointeger, alwaysNumber of documents already handled.
totalinteger, when availableTotal number of documents found.
erro, codigostrings, when the ZIP failsError message and code.

To track the ZIP import, repeat the same POST with the same URL. For a single document in base64, the HTTP 200 response is the Fiscal Monitor tax document. Example of the identification fields of an imported NF-e:

{
  "uuid": "a1b2c3d4-e5f6-4890-abcd-ef1234567890",
  "empresa_uuid": "8f14e45f-ceea-4d3e-a2e0-123456789012",
  "modelo": "nfe",
  "status": "aprovado",
  "categoria": "emitidas",
  "chave": "35260700000000000000550010000012341123456789"
}

The full object follows the format of the Fiscal Monitor document.

Document fieldType and presenceDescription
uuid, empresa_uuidstrings, when availableUUID of the document and of the company in the Fiscal Monitor.
modelo, status, categoriastrings, when availableDocument type, status and category in the Fiscal Monitor. An issued NF-e may return nfe, aprovado and emitidas.
chavestring, when availableAccess key of the tax document.
data_emissaostring, when availableIssue date and time in YYYY-MM-DD HH:MM:SS.
numero, seriestrings, when availableDocument number and series.
valornumber or string, when availableDocument amount.
emitente, clienteobjects, when availableIssuer and recipient data.
fornecedor, manifestacaoobject or nullSupplier data and the recipient's acknowledgment (manifestação), when available.
HTTPResponse
400Invalid input, or inactive certificate or company: error. NF-e authorization not confirmed with SEFAZ: error and codigo.
401Invalid token; see Response format.
403Inactive subscription or no access to the company: error.
422No Fiscal Monitor link available, or the document cannot be imported: error and codigo.

HTTP 400 refusal codes when the NF-e authorization is not confirmed:

CodeMessage
chave_fora_prazo_consultaA chave de acesso tem mais de 6 meses e a SEFAZ não permite consultá-la; não foi possível confirmar a autorização da nota.
The access key is more than 6 months old and SEFAZ does not allow a lookup, so the invoice authorization could not be confirmed.
documento_sem_protocoloA chave do documento fiscal não possui protocolo de aprovação na SEFAZ.
The tax document key has no approval protocol at SEFAZ.

Examples of HTTP 400 errors. An xml that is not base64 is refused during validation. An xml whose decoded content is empty returns O campo xml não está em base64 válido ou está vazio. (the xml field is not valid base64 or is empty).

{
  "error": "O campo xml não está em base64 válido."
}
{
  "error": "A chave de acesso tem mais de 6 meses e a SEFAZ não permite consultá-la; não foi possível confirmar a autorização da nota.",
  "codigo": "chave_fora_prazo_consulta"
}

Example HTTP 422 error (the company has no available link to the Fiscal Monitor):

{
  "error": "A empresa não possui vínculo disponível com o Monitor Fiscal.",
  "codigo": "empresa_sem_monitor"
}

Next step: once the documents are imported, start the calculation. The reasons that can refuse an invoice are in Refusals.

DUA-ES Batch Issuing
Start a Calculation

Starts the calculation of the selected invoices. The API reads the XML of each invoice and plans the slips owed, the pending items and the refusals.

To start, send a POST request to /2/guias/apuracoes with exactly one way to select invoices: periodo, chaves or uuids.

Request parameters:

ParameterRequiredTypeFormat and values
ambiente
Required
integer1 production; 2 test environment (homologação). Must match the invoices.
periodo
One of the three options
objectdata_inicio and data_fim in YYYY-MM-DD format, both included, up to 31 days. There is no limit on the number of invoices in the period.
periodo.data_inicio
With periodo
stringFirst issue date in YYYY-MM-DD, included.
periodo.data_fim
With periodo
stringLast issue date in YYYY-MM-DD, included. It must be the same as or later than the first date.
chaves
One of the three options
array of stringsFrom 1 to 1,000 NF-e access keys, 44 characters each.
uuids
One of the three options
array of stringsFrom 1 to 1,000 tax document UUIDs.
url_notificacao
Optional
stringHTTPS URL of up to 500 characters for the notifications of each slip.
data_pagamentoConditionalstringDate in YYYY-MM-DD. Required for DUA-ES, which is issued only in production.
inscricao_estadualOptionalstringPre-existing field that identifies the issuer for DARE-SP, with 12 digits. It does not declare a state registration (IE) in the destination state and does not enable ICMS-ST. The states where the company is registered are declared in guias_declaracao_ufs, in the company record.
ufsWhen requestedobjectInformation for this calculation, keyed by uppercase state (UF) code. See the accepted leaf fields below.
excecoesOptionalarrayFrom 1 to 1,000 objects. Each one has a distinct 44-character chave and the same ICMS agreement and tax leaf fields. When you select by chaves, each exception's key must be in that list.

Parameters by state

In the first calculation, ambiente and the invoice selection are usually enough. You only need the ufs fields when the calculation lookup returns a pending item that asks for one of them. In that case, start a new calculation with the requested field:

ParameterFormatWhen to send it, and the question for the accountant
ufs.PA.recolhimentopor_operacao or opcao_mensalDid the company choose to pay the DIFAL of Pará once a month? Send por_operacao to create the DIFAL slip when the goods leave, if the other conditions of the scenario are met. Without the field, you get the pending item recolhimento_pa_nao_informado. opcao_mensal results in the refusal opcao_recolhimento_mensal_pa, with the action apuracao_periodica: the accountant pays it, outside the scope of this API. Not accepted for another state or in excecoes.
ufs.{UF}.convenio
ufs.{UF}.{tributo}.convenio
string of 1 to 30 charactersWhich ICMS agreement number goes on the GNRE for this state? Send it only when requested, as for the FCP-DIFAL of MG.
ufs.{UF}.{tributo}.produtostring of 1 to 4 digits, no leading zeroWhich GNRE product code of this state matches the goods? Choose only one of the options published in o_que_enviar[].opcoes. Do not invent codes.
ufs.{UF}.{tributo}.detalhamento_receita6-digit stringWhich published revenue detail code matches the operation? Send only the one the pending item asks for. Do not replace a revenue detail code that the XML already sets.

{tributo} accepts only difal or fcp_difal. These parameters do not set amounts, revenue code or due date: those come from the NF-e and from the rule of the enabled scenario.

In excecoes[], the tax leaf field takes precedence over the exception's own ICMS agreement, then over the tax leaf field in ufs, and finally over the state's agreement. Precedence applies leaf by leaf; a state never lends its agreement to another state. Exceptions with no selected invoice are counted in estatisticas.excecoes_nao_aplicadas.

Request example

Request by period in production (include data_pagamento for the ES invoices):

curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ambiente": 1,
    "periodo": {
      "data_inicio": "2026-10-01",
      "data_fim": "2026-10-10"
    },
    "data_pagamento": "2026-10-10"
  }' \
  https://api.webmania.com.br/2/guias/apuracoes

Example with parameters by state

A new calculation for the same period, after the lookup returned pending items for the DIFAL of Pará and the FCP-DIFAL of Minas Gerais. Send the per-operation payment for PA and the ICMS agreement requested for MG. Replace CONVENIO_DO_CONTADOR with the agreement provided by whoever handles your taxes. Send only the fields that apply to the selected invoices.

curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ambiente": 1,
    "periodo": {
      "data_inicio": "2026-10-01",
      "data_fim": "2026-10-10"
    },
    "ufs": {
      "PA": {"recolhimento": "por_operacao"},
      "MG": {"convenio": "CONVENIO_DO_CONTADOR"}
    },
    "data_pagamento": "2026-10-10"
  }' \
  https://api.webmania.com.br/2/guias/apuracoes

HTTP 202 response: calculation created. Use the returned uuid in the next requests.

{
  "uuid": "00000000-aaaa-0000-aaaa-000000000000"
}

Repeating an identical request while the calculation is processando returns HTTP 200 with the same UUID. If a temporary error occurs when you start, repeat the same request to recover the calculation in progress.

HTTPResponse
200Identical repeat during processing: the same uuid.
202Calculation created: uuid.
401Invalid authentication; see Response format.
403Calculation not available for the account, or inactive subscription.
422error with the first validation failure.

Examples of HTTP 422 errors (period longer than 31 days; not exactly one selection criterion):

{
  "error": "O período deve abranger no máximo 31 dias."
}
{
  "error": "Informe exatamente um critério: periodo, chaves ou uuids."
}

A root-level ICMS agreement (convenio) is no longer accepted: HTTP 422, {"error":"O campo convenio foi substituído por ufs.{UF}.convenio (ex.: ufs.MG.convenio)."} (the convenio field was replaced by ufs.{UF}.convenio). An unknown key also returns its path: {"error":"O campo ufs.SP.recolhimento não é permitido."} or {"error":"O campo ufs.PA.inscricao_estadual não é permitido."} (the field is not allowed).

Example HTTP 403 error (slip calculation is not available for this account):

{
  "error": "A apuração de guias não está disponível para esta conta.",
  "codigo": "apuracao_indisponivel"
}

Next step: get the calculation until it is no longer processando.

DUA-ES Batch Issuing
Get a Calculation

Returns the status and the statistics of the calculation. The calculation goes through the states below:

Calculation states The calculation starts as processando. It moves to aguardando_confirmacao when there are slips to review, or straight to concluida when no slip is planned. After the confirmation, it moves to emitindo and then to concluida. Aguardando_confirmacao can end as expirada, when the deadline passes, or as substituida, when a newer identical calculation finishes. Processando and emitindo can end as falhou. processando aguardando_confirmacao emitindo concluida expirada substituida falhou the API reads the invoices you review and confirm slips being issued track each slip deadline passed a newer one exists see codigo_erro no planned slips
A finished calculation does not mean that a slip was approved or paid.

To get it, send a GET request to /2/guias/apuracoes/{uuid}, with the UUID you received when you started the calculation.

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  https://api.webmania.com.br/2/guias/apuracoes/00000000-aaaa-0000-aaaa-000000000000

Example HTTP 200 response with the calculation awaiting confirmation; the values are illustrative:

{
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "status": "aguardando_confirmacao",
  "ambiente": 1,
  "estatisticas": {
    "notas": {"analisadas": 2, "com_guia": 1, "sem_guia": 1, "com_pendencia": 0},
    "guias": {
      "quantidade": 1,
      "valor_total": "10.00",
      "por_tipo": {
        "gnre": {"quantidade": 0, "valor": "0.00"},
        "dare": {"quantidade": 0, "valor": "0.00"},
        "dua": {"quantidade": 1, "valor": "10.00"}
      }
    },
    "por_uf": [],
    "por_tributo": [],
    "recusas": {"itens": 1, "valor_total": "0.00", "por_motivo": [{"motivo": "sem_icms_st_nem_difal", "acao": "apuracao_periodica", "itens": 1, "valor": "0.00"}], "fora_do_escopo": {"itens": 0, "valor_total": "0.00"}},
    "pendencias": {"itens": 0, "valor_total": "0.00", "por_motivo": []},
    "excecoes_nao_aplicadas": 0,
    "dare": {"modo": "consolidado_mensal", "referencias": []}
  },
  "confirmacao": null,
  "expira_em": "2026-10-11T10:00:00-03:00",
  "contadores": {"planejadas": 1},
  "codigo_erro": null,
  "criado_em": "2026-10-10T10:00:00-03:00",
  "finalizada_em": "2026-10-10T10:00:05-03:00"
}
FieldDescription
uuid, ambienteUUID and environment of the calculation: 1 production or 2 test environment (homologação).
statusprocessando, aguardando_confirmacao, emitindo, concluida, expirada, substituida or falhou.
estatisticasSummary of invoices, slips, pending items, amounts and refusals, described below.
confirmacaonull, or an object with confirmada_em, guias_confirmadas, reservadas, divergentes, recusadas_na_confirmacao and pendentes.
expira_emConfirmation deadline in ISO 8601, or null.
contadoresInteger counters. When available: planejadas, reservadas, ja_reservadas, ignoradas, recusadas, declaracao_empresa_ausente and declaracao_empresa_nao_confirmada, plus one counter per reason. Other integer counters may appear.
codigo_erronull, assinatura_inativa or erro_interno.
criado_em, finalizada_emDates in ISO 8601; finalizada_em may be null.

In estatisticas, quantities are integers and money amounts are strings with two decimal places.

Statistics fieldDescription
notas.analisadas, notas.com_guia, notas.sem_guiaNumber of invoices analyzed, with a slip and without a slip.
guias.quantidade, guias.valor_totalNumber and total amount of the planned slips.
guias.por_tipo.gnre, guias.por_tipo.dare, guias.por_tipo.duaEach type reports quantidade and valor. For DARE, the count is estatisticas.guias.por_tipo.dare.quantidade.
por_uf[]Per state: uf, notas, guias and valor.
por_tributo[]tributo (difal or fcp_difal), guias and valor.
recusas.itens, recusas.valor_total, recusas.por_motivo[]Refusal totals and, per reason, motivo, acao, itens and valor.
notas.com_pendenciaInvoices with missing information. They may also have another component with a slip.
pendencias.itens, pendencias.valor_total, pendencias.por_motivo[]Pending totals; each reason reports motivo, acao, itens and valor.
recusas.fora_do_escopo.itens, recusas.fora_do_escopo.valor_totalThe subset of refusals with the reasons empresa_inscrita_na_uf, regime_recolhimento_nao_certificado or opcao_recolhimento_mensal_pa. Slips already created and invoices with no eligible tax are not part of this total.
excecoes_nao_aplicadasExceptions whose key was not found among the selected invoices.
dare.modo, dare.referencias[]Mode consolidado_mensal (consolidated by month). Each reference reports referencia, notas, difal.valor, difal.guias, fecoep.valor and fecoep.guias.

processando changes to aguardando_confirmacao when there are slips to review, or to concluida when no slip is planned. After you confirm, it changes to emitindo and then to concluida. A calculation can also become expirada after expira_em (the confirmation deadline), substituida when an identical request completes a newer plan, or falhou, with a codigo_erro, from processando or emitindo.

HTTPResponse
401, 403Invalid token or inactive subscription; see Response format.
404The calculation does not exist, is invalid or belongs to another company: {"error":"Apuração não encontrada."} (calculation not found). On the /guias, /recusas and /confirmar routes, this body applies to a UUID that does not exist or belongs to another company. Always send a valid UUID in {uuid}.

DUA-ES Batch Issuing > Get a Calculation
Planned Slips

Lists the slips that the calculation planned, with amounts and due dates, so you can review them before you confirm issuance.

To list them, send a GET request to /2/guias/apuracoes/{uuid}/guias. Use the cursor you receive to get the next page.

Optional filterFormat and values
limiteInteger from 1 to 500; default 100.
cursorOpaque string returned on the previous page, up to 2,048 characters.
uf, tipo, situacaoReceiving state, type (gnre, dare, dua) and status of the planned slip.

Example HTTP 200 response; the values are illustrative:

{
  "guias": [{
    "id": "0000000000000000000000000000000000000000000000000000000000000000",
    "tipo": "dua",
    "uf": "ES",
    "tributo": "difal",
    "receita": "386-7",
    "valor": "10.00",
    "data_vencimento": "2026-10-10",
    "confirmar_ate": "2026-10-10T23:59:59-03:00",
    "chave": "32261000000000000000550010000000011000000010",
    "situacao": "planejada",
    "guia_uuid": null,
    "motivo": null,
    "detalhes": {
      "codigo_servico": "3867",
      "data_referencia": "2026-10",
      "receita": "386-7",
      "valor": "10.00",
      "data_vencimento": "2026-10-10",
      "chave": "32261000000000000000550010000000011000000010",
      "receitas": ["386-7"]
    }
  }],
  "cursor": null
}
FieldDescription
guias, cursorList of planned slips, and the cursor of the next page or null.
guias[].idID of the planned slip, with 64 hexadecimal characters. Use it to confirm.
tipo, uf, tributo, receitaType, state, tax and revenue code of the slip.
valor, data_vencimento, confirmar_ateAmount and due date. confirmar_ate is the earlier of expira_em and 23:59:59 Brasília time on the due date, or null.
chave, guia_uuid, motivoInvoice access key, slip UUID and reason, when they apply.
situacaoplanejada, confirmada, nao_confirmada, reservada, divergente, recusada_na_confirmacao or expirada.
detalhesMay contain receita, valor, data_vencimento, chave and receitas[]. For GNRE: uf_favorecida, tipo_gnre and quantidade_notas. For DARE: codigo_servico_dare, receita_codigo and referencia. For DUA: codigo_servico and data_referencia.
consolidado, referencia, notasIn a consolidated DARE: consolidado: true, the reference period and the number of invoices. chave is null, and detalhes includes codigo_servico_dare and descricao.

An invalid cursor returns HTTP 422: {"error":"Cursor inválido."} (invalid cursor).

DUA-ES Batch Issuing > Get a Calculation
Pending Items

Lists what is missing to create the slip of a scenario that is already enabled. Each pending item gives the exact field to send in o_que_enviar[]. Send it in a new calculation, with the same selection criteria.

To get them, send a GET request to /2/guias/apuracoes/{uuid}/pendencias. It accepts limite (1 to 500, default 100), cursor (up to 2,048 characters), uf, tipo (gnre, dare, dua) and motivo (up to 64 characters), with the same pagination as the refusals. A UUID that does not exist or belongs to another company returns HTTP 404; an invalid cursor returns 422.

Example of an MG FCP-DIFAL without an ICMS agreement; the values and identifiers are illustrative:

{
  "pendencias": [{
    "chave": "31261100000000000000550010000000011000000010",
    "uf": "MG",
    "tipo": "gnre",
    "tributo": "fcp_difal",
    "valor": "2.00",
    "data_vencimento": "2026-11-12",
    "motivo": "convenio_obrigatorio",
    "acao": "enviar_complementos",
    "mensagem": "Informe o convênio para esta UF e refaça a apuração.",
    "o_que_enviar": [{
      "campo": "ufs.MG.fcp_difal.convenio",
      "tipo": "string",
      "formato": "1 a 30 caracteres",
      "obrigatorio": true,
      "opcoes": [],
      "descricao": "Convênio exigido para esta receita.",
      "pergunta_contador": "Qual o número do convênio a informar na GNRE desta UF?",
      "origem_exigencia": "configuracao_uf",
      "aceita_por_documento": true
    }]
  }],
  "cursor": null
}
FieldDescription
pendencias[]Each item contains chave, uf, tipo, tributo, valor, data_vencimento, motivo, acao, mensagem and o_que_enviar.
o_que_enviar[].campoExact path of the parameter to send in the new calculation.
tipo, formato, obrigatorio, descricaoType, format, whether it is required, and an explanation of the requested information.
opcoes[]Options with codigo and descricao. When there is a list, use only a published code.
pergunta_contadorA question that helps whoever handles your taxes choose the right value.
origem_exigenciaregra_uf or configuracao_uf.
aceita_por_documentoWhen true, the matching leaf field is allowed in excecoes[]. The Pará payment option is set per state only.
cursorCursor of the next page, or null.

How to complete: ask your accountant, then start a new calculation with the same period, or with the pending keys, and the requested fields. The previous calculation stays available for audit; you cannot edit its plan. A component already linked to a slip returns guia_gerada: review the existing slip and do not pay it again. Only items from guias can be confirmed.

Limit: the DIFAL of Pará is created with ufs.PA.recolhimento = por_operacao, if the other conditions of the scenario are met. ICMS-ST and FCP-ST are not created automatically. If the state configuration is unavailable, that is a dependency failure (HTTP 503), never a response that you must complete.

DUA-ES Batch Issuing > Get a Calculation
Refusals

Lists the invoices and taxes for which the calculation does not create a slip. Each refusal has a mensagem (message) and an acao (action) that gives the next step:

acaoWhat it meansWhat to do
enviar_complementosThe slip needs a value that is not in the XML.Send the field requested in o_que_enviar[] in a new calculation. See Pending items.
apuracao_periodicaThe accountant pays the tax in the monthly tax return, or there is no slip to generate.No action in this API. Read the mensagem to learn which case applies.
configurar_empresaThe company configuration prevents issuing.Review the company configuration and run the calculation again.
emissao_individualThe calculation does not generate this slip automatically.Issue it through single issuing, with amounts checked by your accountant.
usar_outra_apiThe invoice or the state uses another type of slip.Issue it through the documentation named in the mensagem (GNRE, DARE-SP or DUA-ES).
recolher_fora_da_webmaniaThe tax is paid through a channel that Webmania does not issue.Pay it through the channel named in the mensagem.
revisar_com_contadorThe scenario is not handled automatically.Check the payment with your accountant before you issue the slip another way.
aguardar_liberacaoThe scenario is not released in this API yet.No slip was generated. Check the payment with your accountant.

To get them, send a GET request to /2/guias/apuracoes/{uuid}/recusas. It accepts limite, cursor, uf, tipo and motivo (up to 64 characters). Pagination uses the same formats as the planned slip list.

Example HTTP 200 response; the values are illustrative:

{
  "recusas": [{
    "chave": "35261000000000000000550010000000011000000010",
    "uf": "SP",
    "tipo": "dare",
    "componente": null,
    "parcela": null,
    "valor": "0.00",
    "motivo": "perfil_emitente_incompleto",
    "acao": "configurar_empresa",
    "mensagem": "A inscrição estadual do emitente necessária ao DARE de São Paulo não foi informada ou é inválida. Confira a configuração e refaça a apuração.",
    "guia_indicado": null
  }],
  "cursor": null
}
FieldDescription
recusas[]Each refusal reports chave, uf, tipo, componente, parcela, valor, motivo, acao, mensagem and guia_indicado. What to do for each acao is in the table at the start of Refusals.
cursorCursor of the next page, or null.

Next step: review the three lists, complete the pending items that apply and confirm only the planned slips.

DUA-ES Batch Issuing
Confirm a Calculation

Confirms issuance of the planned slips. Confirm only after you review the amounts and the refusals. Selecting a consolidated DARE confirms the whole slip.

To confirm, send a POST request to /2/guias/apuracoes/{uuid}/confirmar with exactly one selection: all slips, with the JSON boolean true, or a list of 1 to 1,000 distinct IDs taken from /guias.

FieldFormatDescription
todasboolean trueConfirms all slips. Do not combine with guias.
guiasarray of stringsFrom 1 to 1,000 distinct IDs of planned slips. Do not combine with todas.
curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "todas": true
  }' \
  https://api.webmania.com.br/2/guias/apuracoes/00000000-aaaa-0000-aaaa-000000000000/confirmar

HTTP 202 response: confirmation accepted and issuing started.

{
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "status": "emitindo",
  "guias_confirmadas": 1
}
HTTPResponse
200Same selection sent again: summary of the calculation, in the format of Get a calculation.
202uuid, status: emitindo and guias_confirmadas.
401Invalid token; see Response format.
403Inactive subscription or apuracao_indisponivel.
404The calculation does not exist or belongs to another company.
409Conflict with the status or with an earlier selection: error and codigo.
422Invalid selection: error and, when it applies, codigo.
HTTP 409: codeMessage in error
apuracao_ja_confirmadaEsta apuração já foi confirmada com outra seleção de guias.
This calculation was already confirmed with another selection of slips.
apuracao_nao_confirmavelEsta apuração não está disponível para confirmação.
This calculation is not available for confirmation.
apuracao_expiradaO prazo de confirmação desta apuração expirou. Refaça a apuração.
The confirmation deadline of this calculation has passed. Run the calculation again.
apuracao_substituidaEsta apuração foi substituída. Consulte a nova apuração.
This calculation was replaced. Get the new calculation.

Example HTTP 409 error:

{
  "error": "O prazo de confirmação desta apuração expirou. Refaça a apuração.",
  "codigo": "apuracao_expirada"
}
HTTP 422: codigoMessage in error
guia_prevista_invalidaUma ou mais guias não pertencem ao plano desta apuração. Guias inválidas: followed by the refused IDs, separated by commas, and a period.
One or more slips are not part of the plan of this calculation. Invalid slips: …
selecao_obrigatoriaInforme "todas": true ou a lista "guias" para confirmar a apuração.
Send "todas": true or the "guias" list to confirm the calculation.
selecao_ambiguaInforme apenas um critério de seleção: "todas" ou "guias", não os dois.
Send only one selection criterion: "todas" or "guias", not both.
no codigoO campo todas deve ser verdadeiro ou falso. Returned for a value that is not boolean, such as "sim".
The todas field must be true or false.
no codigoO campo todas deve ser o booleano true. Returned for false, 0 or 1. Send todas only as the JSON boolean true.
The todas field must be the boolean true.

Example HTTP 422 error with no selection. error has the message and codigo has the stable code:

{
  "error": "Informe \"todas\": true ou a lista \"guias\" para confirmar a apuração.",
  "codigo": "selecao_obrigatoria"
}

Neither confirming nor completing the calculation proves that each slip was approved. Next step: list the slips by the calculation UUID, and track each one by UUID or notification.

DUA-ES Batch Issuing
List Slips

Lists the slips issued by the company. All filters are optional; when you send one, it must have a valid value.

To list them, send a GET request to /2/guias. To track the slips of a confirmed calculation, send its UUID: /2/guias?apuracao_uuid={uuid}.

ParameterRequiredTypeFormat and values
apuracao_uuid
Optional
stringUUID of the calculation.
tipo
Optional
stringgnre, dare or dua.
status
Optional
stringprocessando, pendente, pago, contingencia or reprovado. See Slip status and payment.
ambiente
Optional
integer1 production or 2 test environment (homologação).
chave
Optional
stringAccess key of the invoice, 44 characters.
data_inicio, data_fim
Optional
stringCreation dates in YYYY-MM-DD, Brasília time, both included. The end date cannot be before the start date.
cursor
Optional
stringOpaque value returned on the previous page, up to 2,048 characters. Copy it as is, without parsing it.
limite
Optional
integerFrom 1 to 100 slips per page; default 100.
curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/guias?ambiente=1&limite=1"

Example HTTP 200 response with an approved DUA-ES. Replace the illustrative cursor with the value you receive in the response:

{
  "guias": [{
    "uuid": "a1b2c3d4-e5f6-4890-abcd-ef1234567890",
    "tipo": "dua",
    "status": "pendente",
    "ambiente": 1,
    "data_pagamento": "2026-10-01",
    "criado_em": "2026-10-01T10:00:00-03:00",
    "aprovado_em": "2026-10-01T10:01:00-03:00"
  }],
  "cursor": "CURSOR_RETORNADO_PELA_API"
}

Example HTTP 200 response with no slips for the filters you sent:

{
  "guias": [],
  "cursor": null
}
FieldType and presenceDescription
guiasarray of objects, alwaysSummary of the slips found; may be empty.
cursorstring or null, alwaysOpaque value of the next page, or null on the last page. Send the value received in cursor to continue.
guias[].uuid, tipo, statusstringsUUID, type and status of the slip, with the values of the filters above.
guias[].ambienteintegerEnvironment of the slip, 1 or 2.
guias[].numero_duastring, when availableID assigned by the issuing service (DUA number).
guias[].valor_totaldecimal string, when availableTotal amount of the slip in reais (BRL), with two decimal places.
guias[].uf_favorecida, receitastrings, when availableReceiving state code and revenue code.
guias[].data_vencimento, data_pagamentostrings, when availableDates in YYYY-MM-DD.
guias[].criado_em, aprovado_emISO 8601 strings, when availableCreation date and issue date of the slip.
HTTPResponse
401, 403Invalid token or inactive subscription; see Response format.
422Invalid filter or cursor: error.

Example HTTP 422 error for an invalid cursor:

{
  "error": "Cursor inválido."
}

DUA-ES Batch Issuing
Get a Slip

Returns one of the company's slips. The response has the same format as the status lookup of the slip type.

To get it, send a GET request to /2/guias/{uuid}, with the UUID of the slip.

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  https://api.webmania.com.br/2/guias/a1b2c3d4-e5f6-4890-abcd-ef1234567890

Example HTTP 200 response for a slip that is still processing:

{
  "status": "processando",
  "uuid": "a1b2c3d4-e5f6-4890-abcd-ef1234567890",
  "numero_dua": null
}
FieldType and presenceDescription
status, uuidstrings, alwaysStatus and UUID of the slip. The status values are in the filter table above.
numero_duastring or null, alwaysID assigned by the issuing service, when available (DUA number).
resultadoobject, in pendente or pagoResponse of the issue request. The data depends on the slip type and on the result.
motivos_rejeicaoarray, in reprovadoReasons returned. The rejection code is in motivos_rejeicao[].codigo.
pagamentoobject, when pagoPayment data found in a bank return file, as described in Slip status and payment.
mensagemstring, when it appliesGuidance about processing, a communication failure or contingency.
origemstring, when it appliesHow the invoices were selected, such as periodo or chaves.
notas, notas_ignoradasarrays of objects, when availableDetails of the invoices and, if any, of the ignored invoices. Each item may report chave, valor_icms_st, valor_difal, motivo_ignorado and receita.
guiasarray of objects, when availableDetails of each slip, including payment data when available.
parcelas_recusadasarray of objects, if anyInstallments not included in the slip, with ID, amount, reason and guidance when available.
declaracaoobject or null, when availableDeclaration applied to the slip. It may be missing when there is no linked plan.
declaracao.ufs_com_inscricaoarray of stringsStates where the company declared a state registration (IE) or a special tax regime at the time of issue.
declaracao.texto_versao, declaracao.atualizada_emstring or nullVersion of the declaration text, and update date in ISO 8601.

A slip that is waiting for a safe retry is returned with status: contingencia. The mensagem field says that the attempt created no slip and that the same request will be tried again. Keep tracking the same UUID and do not create another issue request for the same obligation. This slip does not appear in GET /2/guias?status=processando.

If mensagem reports an uncertain result, the slip may have been issued. Check with SEFAZ and with support before you pay it or issue it again by another channel.

HTTPResponse
401, 403Invalid token or inactive subscription; see Response format.
404The slip does not exist or belongs to another company.

Example HTTP 404 error (slip not found):

{
  "error": "Guia não encontrada."
}

Batch Payment

Batch payment puts slips that are already issued into one file for your bank. Later, it reads the bank return file to mark each slip as paid. The API does not issue the slips again, does not recalculate taxes and does not move money: you always authorize the payment yourself, at your bank.

Batch payment flow With the slips issued, prepare the CNAB 240 export and download the ZIP with the remittance file. You import the remittance file at your bank and authorize the payment. Then send the bank return file: the API reconciles each slip, which becomes pago (paid), with a webhook notification. 1 Issued slips result of the issuing 2 Prepare the export POST /2/guias/exportacoes 3 Download the file ZIP with the .rem and manifest 4 Pay at the bank you import .rem and authorize 5 Send the return the bank's .ret file 6 Slip paid status pago and webhook done by the API done by you, at the bank
The JSON format follows steps 1 to 3, for review or integration; only CNAB 240 takes a return file.

The export has two formats:

JSON

For review or integration. For each slip, it gives the barcode, the payment code (linha digitável, the numeric code of the slip) and the PIX code, when available.

CNAB 240

Remittance file for the bank (.rem) in CNAB 240, the Brazilian bank file standard, with a JSON manifest. After the payment, the API reconciles the bank return file.

Available banks. The export is active by default; your account does not need to be enabled. Each bank collects only some slip types and states:

BankGNREDARE-SPDUA-ES
Banco do Brasil
001
All 25 states ✓ ✓
Bradesco
237
24 states ✓ ✓
Itaú
341
22 states ✓ ✓
Santander
033
20 states ✓ ✓
Sicoob
756
12 states ✓ ✓
Sicredi
748
AL, GO, PR, RS, SC — —
Banrisul
041
RS, SC — —

An operational restriction may shorten this list. In that case, the refusal lists the banks accepted at that moment. The states of each bank are in Banks by Slip Type and State.

Creating or downloading the file does not pay the slips

  • The payment happens only when you import the remittance file at your bank and authorize it.
  • Before you import it, check the amounts, due dates, collecting bank, account, bank agreement and remittance sequence number.
  • Exporting the same slips again does not stop the bank from paying them twice. Also check payments made through other channels.

Layout change. If the bank changed its file layout before you created the file, request a new export. A file that was already created is still reconciled in the original export.

Batch Payment
Slip Status

This status applies to issuing, lookup, listing and the slip webhook. It is not the status of the calculation or of the export.

StatusMeaning and action
processandoThe issue request is still processing. Track the UUID and do not issue again.
pendenteSlip issued, with no full payment found in a bank return file. It does not mean that the slip was never paid through another channel.
pagoPayment found in an imported bank return file and reconciled for every payment instrument of the slip. The slip detail and the webhook include pagamento.
contingenciaThe issue request is awaiting communication or has an uncertain result. Read mensagem, and check with SEFAZ and with support before you issue it again or pay by another channel.
reprovadoThe issue request was refused, including by SEFAZ. Review motivos_rejeicao and the guidance you received.

When the slip is pago, the lookup and the webhook include the pagamento object:

FieldTypeDescription
data_pagamentostringPayment date, in YYYY-MM-DD format.
valorstringDecimal amount paid.
bancostringThree-digit COMPE bank code (the Brazilian bank number).
autenticacaostring or nullBank authentication code, when available.
registrado_emstringDate and time of the record, in ISO 8601.

For slips with several payment instruments, the object summarizes the last record that completed the payment. Check each instrument in the return file. A reversal can move the slip back to pendente, and a partial payment does not produce pago.

Batch Payment
Prepare an Export

Prepares the payment file of slips that are already issued: json for review or cnab240 for the bank.

To prepare it, send a POST request to /2/guias/exportacoes with exactly one selector: the UUID of a completed calculation whose issue requests are finished, or a list of UUIDs of your company's slips. Do not send IDs of planned slips.

Request parameters:

ParameterRequiredType and format
apuracao_uuidOne of the optionsUUID string. Do not combine with guias.
guiasOne of the optionsarray of 1 to 1,000 distinct UUIDs. Do not combine with apuracao_uuid.
formatoYesstring: json or cnab240. This export has no CSV or PDF.
bancoWith cnab240string with exactly three COMPE digits, keeping leading zeros. See Banks and restrictions.
data_pagamentoWith cnab240string YYYY-MM-DD, today or a future date in Brasília time. Optional for JSON.
numero_remessaWith cnab240Positive JSON integer, within the width of the bank profile. You set this sequence with your bank.
confirmar_conferencia_bancariaWith cnab240Only the JSON boolean true. A string or a number does not replace the confirmation.
pagadorWith cnab240Object with the fields below. The CNPJ (company ID) must be the authenticated company's own, never a third party's.
pagador.cnpj, pagador.razao_socialWith pagadorstrings. A valid numeric 14-digit CNPJ without punctuation, and a legal company name without control characters.
pagador.enderecoWith pagadorObject: logradouro, numero, cidade, cep and uf are required; complemento is optional. All strings. An eight-digit CEP (postal code) and a valid uppercase state code.
conta_bancariaWith cnab240Object: agencia and conta; it may contain agencia_dv, conta_dv, dac and convenio. All strings, keeping leading zeros. Requirements and widths depend on the bank. For Bradesco (237), also send agencia_dv and dac. For Sicredi (748), conta_dv must contain one numeric digit; the dac field is not used in the file.
  • Unknown fields are refused.
  • For JSON, you may leave out the bank data and the confirmation. If you send them, they are validated.
  • The limit is 20,000 payment instruments per export, including through a calculation. Above that, the request is refused, never truncated. This limit does not guarantee that the bank accepts a file of that size.

JSON review example, based on a validated request. Replace the UUIDs with your company's slips. Available by default, subject to the account permissions:

curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"guias":["00000000-aaaa-0000-aaaa-000000000000","00000000-bbbb-0000-bbbb-000000000000"],"formato":"json"}' \
  https://api.webmania.com.br/2/guias/exportacoes

Example CNAB request body, validated in a test environment, with replaced identifiers. It does not prove that the bank imported or paid anything. Replace the date with a valid date, and the bank details with the setup you confirmed with your bank:

{
  "guias": ["00000000-aaaa-0000-aaaa-000000000000"],
  "formato": "cnab240",
  "banco": "237",
  "data_pagamento": "2026-11-07",
  "numero_remessa": 556225,
  "confirmar_conferencia_bancaria": true,
  "pagador": {
    "cnpj": "12345678000195",
    "razao_social": "EMPRESA EXEMPLO LTDA",
    "endereco": {"logradouro":"RUA EXEMPLO","numero":"1","complemento":"","cidade":"CURITIBA","cep":"80010000","uf":"PR"}
  },
  "conta_bancaria": {"agencia":"01234","agencia_dv":"0","conta":"000000012345","conta_dv":"1","dac":"0","convenio":"TESTE"}
}

HTTP 202 creates the export. HTTP 200 returns the same export for an identical request that is still valid. The first response body contains uuid, status and expira_em; get the other fields in Get an export. Track the export by the returned UUID.

HTTPRefusal
401Missing or invalid authentication.
403Account not enabled: exportacao_indisponivel. The subscription or the permissions can also block access.
404selecao_invalida: the selection does not exist or belongs to another company. The response does not reveal who owns it.
409Issue requests still in progress: emissao_em_andamento. Wait for the results.
422dados_invalidos (body validation), selecao_invalida (invalid selector, UUIDs or payer CNPJ), banco_nao_habilitado or banco_nao_suportado (bank refused), limite_exportacao (the selection exceeds the preparation limit) or nenhuma_guia_elegivel when no issued slip is found in the selection. Check codigo_erro and mensagem.
503dependencia_indisponivel. Try again later.

After you send it:

  • Checking the payment instruments and creating the file happen asynchronously. Track the export until concluida or falhou. The HTTP 202 acceptance does not guarantee that a bank file will be created.
  • An identical request made after expiration creates a new export, with another uuid, if it is still valid.
  • For CNAB, a data_pagamento before today in Brasília time is refused with HTTP 422.

Example HTTP 403 refusal (slip export is not available for this account):

{
  "codigo_erro": "exportacao_indisponivel",
  "mensagem": "A exportação de guias não está disponível para esta conta."
}

Batch Payment
Get an Export

Returns the status of the export, the files created and the slips left out.

To get it, send a GET request to /2/guias/exportacoes/{uuid}. Example HTTP 200 response, with replaced UUIDs and hashes:

{
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "status": "concluida",
  "quantidade_guias": 2,
  "valor_total": "12.00",
  "arquivos": [{
    "nome": "guias_pagamento.zip",
    "sha256": "0000000000000000000000000000000000000000000000000000000000000000",
    "valor_total": "12.00",
    "tipo_conteudo": "application/zip",
    "quantidade_guias": 2
  }, {
    "nome": "guias_237_789026.rem",
    "sha256": "0000000000000000000000000000000000000000000000000000000000000000",
    "valor_total": "12.00",
    "tipo_conteudo": "text/plain",
    "quantidade_guias": 2
  }, {
    "nome": "manifesto.json",
    "sha256": "0000000000000000000000000000000000000000000000000000000000000000",
    "valor_total": "12.00",
    "tipo_conteudo": "application/json",
    "quantidade_guias": 2
  }],
  "avisos": [],
  "mensagem": "Exportação disponível para download.",
  "motivo": null,
  "exclusoes": [],
  "codigo_erro": null,
  "expira_em": "2026-11-07T20:06:30-03:00",
  "gerado_em": "2026-11-06T20:06:30-03:00"
}
FieldType and meaning
uuid, statusstrings. Status processando, concluida, falhou or expirada.
quantidade_guias, valor_totalInteger number of payment instruments included, and a decimal string. They are not proof of a debit.
arquivos[]File descriptors: nome, tipo_conteudo and sha256 (strings), quantidade_guias (integer), valor_total (decimal string). Empty before completion or after expiration. It contains no public URL.
avisos[]Payment instruments left out of a completed export, each with guia_uuid, indice_guia, codigo and mensagem. The codes are in Export exclusions.
mensagemString in Portuguese about the export status.
motivoString with the refusal reason: instrumento_conflitante, nenhuma_guia_elegivel or leiaute_bancario_alterado. null when there is no refusal reason.
exclusoes[]Details of the export refusal, each with guia_uuid (UUID string), indice_guia (integer or null), codigo and mensagem (strings). Empty array when there are no refusal details.
codigo_erronull; exportacao_falhou when status is falhou; or exportacao_expirada when status is expirada.
expira_em, gerado_emISO 8601 strings. gerado_em may be null before completion. JSON is valid for 24 hours. CNAB expires at the earlier of 24 hours after creation and the end of the payment day in Brasília time.

Each export uses a fixed snapshot of the slips. The manifest contains uuid, formato, gerado_em, data_pagamento, banco, quantidade_guias, valor_total, instrumentos, exclusoes, anomalias and arquivos. The payment instruments report identificador, guia_uuid, indice_guia, tipo, ambiente, uf_favorecida, receita, valor, data_vencimento, valido_ate, data_pagamento, codigo_barras, linha_digitavel, pix_copia_cola, situacao_pagamento and elegivel_cnab. Unavailable data may be null. situacao_pagamento: nao_verificada does not mean that there was no payment through another channel.

The CNAB file leaves out payment instruments that are:

  • refused, or from the test environment (homologação);
  • overdue or past their validity;
  • already identified as paid;
  • not covered by the bank for the slip type and the state.

Inconsistent financial data in an issued payment instrument blocks the CNAB file. The API does not fill in amounts or fix codes by guessing. The JSON can record anomalies with null data for review, without making those instruments payable. A GNRE batch can contain several payment instruments: the approval of the batch is not enough to include all of them. Dates are not moved to the next business day automatically.

Batch Payment > Get an Export
Exclusions

Each slip left out of the file appears in avisos[], with one of the codes below. For CNAB, these exclusions do not block the file for the other slips.

Exception that refuses the whole export: instrumento_conflitante, or the same payment instrument in two slips of the selection, refuses the whole export: status: falhou, codigo_erro: exportacao_falhou, motivo: instrumento_conflitante and arquivos: [], with the details in exclusoes[]. Review the slips and split the selection, or use JSON for review.
CodeMessage
guia_rejeitadaA guia foi rejeitada e não pode ser incluída no pagamento.
The slip was rejected and cannot be included in the payment.
homologacao_nao_pagavelGuias de homologação não podem ser pagas.
Slips from the test environment cannot be paid.
situacao_nao_confirmadaA emissão deste instrumento não está confirmada.
Issuance of this payment instrument is not confirmed.
codigo_barras_invalidoO código de arrecadação está ausente, inválido ou divergente.
The collection code is missing, invalid or does not match.
valor_referencia_nao_suportadoO código contém um valor de referência, não um valor em reais.
The code contains a reference value, not an amount in reais.
valor_ausenteNão há um valor exato e positivo confirmado para este instrumento.
There is no confirmed exact, positive amount for this payment instrument.
valor_divergenteOs valores informados para este instrumento não conferem.
The amounts given for this payment instrument do not match.
vencimento_desconhecidoO vencimento nominal ou a validade do instrumento não é conhecido de forma inequívoca.
The nominal due date or the validity of the payment instrument is not known for certain.
fora_validadeO instrumento está fora do período permitido para esta data de pagamento.
The payment instrument is outside the period allowed for this payment date.
pagamento_ja_identificadoJá existe um pagamento identificado para este instrumento.
A payment was already identified for this payment instrument.
banco_nao_arrecadadorO banco não possui cobertura confirmada para o tipo de guia e a UF favorecida.
The bank has no confirmed coverage for the slip type and the receiving state.
duplicada_na_selecaoEste instrumento já está presente na seleção.
This payment instrument is already in the selection.
instrumento_conflitanteExistem informações conflitantes para o mesmo instrumento.
There is conflicting information for the same payment instrument.

Guidance. For banco_nao_arrecadador, see the coverage table. For this exclusion only, use the PIX code or the barcode of the slip itself, when available, after you check whether the slip was already paid. For pagamento_ja_identificado and duplicada_na_selecao, do not pay again. For a duplicate, review the entry that is already included.

Batch Payment
Download File

Downloads the export file, with authentication and no public URL. For json, you get the JSON manifest. For cnab240, you get a ZIP with the .rem file and manifesto.json.

Extract the ZIP and import only the .rem file into your bank.

To download it, send a GET request to /2/guias/exportacoes/{uuid}/arquivo. If the remittance is split, the split follows the bank's documented limit, not a generic split per thousand slips. The file may contain more than one batch, according to the bank's rules; the slip IDs are preserved.

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -o exportacao.json \
  https://api.webmania.com.br/2/guias/exportacoes/00000000-aaaa-0000-aaaa-000000000000/arquivo

For CNAB, use exportacao.zip as the local file name. An identical request made after expiration creates a new export, with another uuid, if it is still valid.

HTTPMeaning
409exportacao_em_andamento: the file is not finished yet; or exportacao_falhou: the preparation failed.
410The export has expired.
404The UUID does not exist or belongs to another company.
503File or dependency unavailable.

Batch Payment
Banks and Restrictions

Each bank has its own CNAB 240 file profile, chosen by the banco field: the three-digit COMPE code, as a string. There is no generic profile. Before you import the remittance file, check the layout, the bank agreement and your account data with your bank.

StatusBanksAPI response
Available by defaultBanco do Brasil (001), Santander (033), Banrisul (041), Bradesco (237), Itaú (341), Sicredi (748) and Sicoob (756)CNAB file created for the eligible slips, following the slip types and states that each bank collects.
No layout in this exportBanco do Nordeste (004), Inter (077), Caixa (104), BTG Pactual (208), Nubank (260), C6 Bank (336), Cora (403), Safra (422) and all other codesHTTP 422, banco_nao_suportado.
  • An operational restriction on the account may return HTTP 403, exportacao_indisponivel, before the bank is validated.
  • An operational setting with an empty bank list turns off new CNAB exports. It does not turn off JSON, or the reconciliation of return files for exports already created.

Batch Payment > Banks and Restrictions
Banks by Slip Type and State

The table lists the banks named in the official collection sources checked on November 15, 2026, and used to select banks in this export: GNRE Portal (in Portuguese), SEFAZ-SP (in Portuguese) and SEFAZ-ES (in Portuguese). A bank's presence on the list does not confirm that it accepts every slip by CNAB. Check the channel, the collection agreement and your account contract with the bank.

BankGNREDARE-SPDUA-ES
Banco do Brasil
001
AC, AL, AM, AP, BA, CE, DF, GO, MA, MG, MS, MT, PA, PB, PE, PI, PR, RJ, RN, RO, RR, RS, SC, SE, TO ✓ ✓
Bradesco
237
AL, AM, AP, BA, CE, DF, GO, MA, MG, MS, MT, PA, PB, PE, PI, PR, RJ, RN, RO, RR, RS, SC, SE, TO ✓ ✓
Itaú
341
AL, AM, AP, BA, CE, DF, GO, MA, MG, MT, PA, PB, PE, PI, PR, RJ, RN, RO, RS, SC, SE, TO ✓ ✓
Santander
033
AL, AM, AP, BA, CE, DF, GO, MA, MG, MT, PA, PB, PE, PI, PR, RJ, RN, RS, SC, SE ✓ ✓
Sicoob
756
AL, BA, CE, DF, GO, MA, PA, PB, PE, PI, RJ, RS ✓ ✓
Sicredi
748
AL, GO, PR, RS, SC — —
Banrisul
041
RS, SC — —

Santander and GNRE. MS and RR appear in Santander's PAGFOR agreement list (in Portuguese), but not in the GNRE Portal list that was checked. These states stay out of the coverage of this export until this is clarified.

How to read the table. ✓ or a listed state: the official source has a record. —: nothing was found in the check. The listing does not prove that the bank accepts the slip by file under your agreement.

GNRE. Each bank collects GNRE only for the listed states. A slip for a state that is not listed for the chosen bank is left out of the file, with banco_nao_arrecadador in avisos[]. After you check whether it was already paid, pay it with the PIX code or the barcode of the slip itself, when available. The bank list does not enable automatic issuing of any tax.

DARE-SP and DUA-ES. DARE-SP exists only for SP, and DUA-ES only for ES. Banrisul and Sicredi collect neither of them. A bank that is not on the channel's list leaves the slip out with banco_nao_arrecadador.

When in doubt, the slip is left out: unknown coverage for the slip type and the state also results in banco_nao_arrecadador, never in an assumed payment instruction.

Batch Payment
Send the Bank Return File

Receives the return file from the bank and reconciles the payment of each slip of the export. Only exports in the cnab240 format accept a return file. For a json export, the API returns HTTP 422, arquivo_invalido.

To upload it, send a POST request to /2/guias/exportacoes/{uuid}/retornos. Use multipart/form-data with one arquivo field, with the .ret or .txt extension, up to 10 MB. Records must have 240 bytes, with LF or CRLF line endings, in ASCII or ISO-8859-1. The file must be a return file, not a remittance file.

curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -F "arquivo=@retorno.ret" \
  https://api.webmania.com.br/2/guias/exportacoes/00000000-aaaa-0000-aaaa-000000000000/retornos

Do not set the Content-Type: application/json header; curl builds the multipart body. HTTP 202 for a new file; 200 for the same bytes already received in the same export. The body contains only uuid (of the return file), exportacao_uuid and status (processando, concluido or falhou). Store both UUIDs.

HTTPCode and meaning
403exportacao_indisponivel: same account enablement as the export.
404exportacao_nao_encontrada: the export does not exist or belongs to another company.
409exportacao_nao_concluida: wait until the export is completed.
413arquivo_muito_grande: larger than 10 MB.
422arquivo_invalido (file missing or without a valid structure, or an export that is not CNAB 240), retorno_nao_e_retorno (the file sent is not a bank return file), banco_divergente (a different bank from the export's) or pagador_divergente (a different payer from the export's). No reconciliation is done for a refused file.
422leiaute_bancario_alterado: unsupported layout version. Supported versions of files already created are still reconciled in the original export. Do not send a payment again just to reconcile its return file. If the remittance file was not created yet, request a new export.
503retorno_falhou or dependencia_indisponivel, including when the export snapshot is unavailable.

Errors use codigo_erro and mensagem. The expiration of the remittance download does not block sending a return file, but the snapshot of the completed export must still be available.

Batch Payment
Get a Bank Return

Returns the reconciliation result: how each line of the return file was classified (paid, scheduled, rejected, not recognized) and whether the payment was recorded on the slip.

To get it, send a GET request to /2/guias/exportacoes/{uuid}/retornos/{retorno}. The only pagination filter is cursor (opaque string, up to 4,096 characters), taken from the cursor field of the response. Each page has up to 500 items.

HTTP 200 example, based on a validated response, with replaced UUIDs. Processing is complete, but the bank entry is only a scheduled payment, not a payment:

{
  "uuid": "00000000-bbbb-0000-bbbb-000000000000",
  "exportacao_uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "status": "concluido",
  "banco": "237",
  "recebido_em": "2026-11-07T02:14:36-03:00",
  "processado_em": "2026-11-07T02:14:36-03:00",
  "quantidade_registros": 1,
  "pagos": 0,
  "agendados": 1,
  "rejeitados": 0,
  "divergentes": 0,
  "estornados": 0,
  "nao_correspondentes": 0,
  "nao_reconhecidos": 0,
  "itens": [{
    "linha": 3,
    "guia_uuid": "00000000-cccc-0000-cccc-000000000000",
    "identificador": "XXXXXXXXXXXXXXXXXXXX",
    "situacao": "agendado",
    "ocorrencias": [{"codigo":"BD","descricao":"Inclusão efetuada com sucesso"}],
    "valor_pago": "0.90",
    "data_pagamento": "2026-11-07",
    "autenticacao": null,
    "registro": null,
    "webhook": null
  }],
  "cursor": null,
  "codigo_erro": null,
  "mensagem": "O retorno bancário foi processado."
}
FieldType and meaning
uuid, exportacao_uuid, statusstrings. Processing status of the return file: processando, concluido or falhou. Completion does not mean that every item was paid.
itensarray; empty until processing is complete. Each item gives the classification of one line.
itens[].linha, guia_uuid, identificadorInteger line number, and strings, or null when there is no match.
itens[].situacaopago, agendado, rejeitado, divergente, estornado, nao_correspondente or nao_reconhecido. These are bank classifications, different from the public status of the slip.
itens[].ocorrenciasarray of objects with the strings codigo and descricao. Their meaning depends on the bank profile.
itens[].valor_pago, data_pagamento, autenticacaoStrings or null: decimal amount, YYYY-MM-DD date and the authentication given by the bank, never created by the API.
itens[].registroString or null. Tells whether the line was saved in the payment history of the slip. Values in Record and webhook. It is not a payment order.
itens[].webhookString or null. Status of the payment notification. Values in Record and webhook.
cursor, codigo_erro, mensagemCursor and code are strings or null; the message is a string. Copy the cursor to the next call. codigo_erro is retorno_falhou when processing fails, or leiaute_bancario_alterado when the layout version of the export is not supported (see below).
banco, recebido_em, processado_emCOMPE code as a string; ISO 8601 dates. processado_em may be null.
quantidade_registros, pagos, agendados, rejeitados, divergentes, estornados, nao_correspondentes, nao_reconhecidosIntegers with the totals of the whole return file, not only of the current page. They are zero until processing is complete.

A payment is recorded only when:

  • the bank and the CNPJ match those of the export;
  • the reference and the barcode match the payment instrument;
  • the bank entry shows that the payment was made, with no refusal;
  • the amount is exact and the date is valid and not in the future.

A scheduled payment, a bank test, a refusal, a mismatch or a reversal does not prove payment. The same file never records the same fact twice.

Bank layout changed. If the layout version of the export is not supported, the lookup responds HTTP 200 with status falhou, codigo_erro leiaute_bancario_alterado, mensagem "Não foi possível processar o retorno bancário." (the bank return file could not be processed) and an empty itens. No item is reconciled in this result, and sending the same file again does not change the refusal. Supported versions of files already created are still reconciled in the original export. Do not pay again, and do not send the remittance file to the bank again, just to reconcile a return file. If the version is refused, contact support with the UUIDs of the export and of the return file.

Batch Payment > Get a Bank Return
Record and Webhook

FieldValueMeaning
itens[].registroregistradoThe line was saved in the payment history of the slip.
ja_registradoThe same fact was already in the history; nothing was saved again.
log_pagamento_cheioThe payment history of the slip reached its limit, and the line was not saved.
guia_indisponivelThe slip was not available for saving, and the line was not saved.
nullThe line does not create a payment record. Only pago items, and estornado items with a valid date and amount, are saved.
itens[].webhookenviadoThe payment notification of this slip was sent.
pendenteThe payment notification was attempted, but delivery was not confirmed.
nullNo payment notification: the item is not pago, the slip is not fully paid yet, or the slip has no notification set up.

A reversal does not trigger a webhook. An estornado (reversed) item can be saved in the history and move the slip back to pendente, but the API sends no reversal notification: webhook is always null for that item. Get the slip by UUID to see its current status.

HTTP 404 for a return file that does not exist or belongs to another company; 422 with cursor_invalido; 410 with retorno_expirado 24 hours after it was received; 503 when the result is unavailable. The expiration of the remittance file is not the expiration of the return file. Get the slip by UUID to see its current status and the pagamento object.

DUA-ES Single Issuing

Issues one DUA-e with the service data and the amounts you send, without going through the calculation. In this mode the API does not calculate taxes. The agency, the service, the dates and the amounts come from your integration. SEFAZ-ES (the Espírito Santo state tax authority) validates the slip before it approves it.

Batch Issuing

The API reads the NF-e and calculates the slips. Use it for the scenarios the calculation covers. See DUA-ES Batch Issuing.

Single Issuing

You send the revenue code, the amounts and the due date. Use it when you already have the amounts, checked with your accountant, or when the calculation refuses the invoice with acao: emissao_individual.

Production only. SEFAZ-ES has no test environment (homologação) and no cancellation for the DUA-e. Every issue request creates a real, payable document. Review all the data before you send it.

How to issue a single slip:

  1. Find the agency and the serviceChoose the accredited agency, then look up the area, the service, the city and the service amount.
  2. Build the slipSend the agency, the area, the service, the taxpayer, the dates and the amounts.
  3. Send the issue requestPOST to /2/dua/emissao, in production only. The response has the uuid of the slip.
  4. Get the resultWebmania notifies your URL when the slip is issued (pendente) or rejected (reprovado).
  5. PayWith the slip's payment code (linha digitável) or PIX, or in a CNAB 240 batch.

To issue, send a POST request to /2/dua/emissao. Issuing is asynchronous. The response returns the uuid of the slip with status: processando, and the result arrives by notification. For a debt registered as overdue tax debt (dívida ativa), use issuing by CDA.

DUA-ES Single Issuing
Accredited Agencies

Every DUA-e is issued for an agency accredited with SEFAZ/ES (the Espírito Santo state tax authority). The agency's CNPJ (company ID) is the starting point of the integration. You send it in cnpj_orgao when you issue, and in cnpj in the area/service and amount lookups.

The table below lists the accredited agencies. No endpoint returns this list: copy the CNPJ of the agency responsible for the service you need to pay.

CNPJ Agency (official name in Portuguese) Acronym
19481436000178State Water Resources Agency (Agência Estadual de Recursos Hídricos)AGERH
08673715000117Regulatory Agency for Sanitation and Road Infrastructure of ES (Agência Reguladora de Saneamento Básico e Infra-Estrutura Viária do ES)ARSI
01683866000107Espírito Santo Network Development Agency, a state company (Agência de Desenvolvimento em Redes do Estado do Espírito Santo S/A)ADERES
26064356000182Public Services Regulatory Agency (Agência de Regulação de Serviços Públicos)ARSP
07238404000167Espírito Santo Public Energy Services Agency (Agência de Serviços Públicos de Energia do Estado do Espírito Santo)ASPE
27064062000113Espírito Santo Food Supply Centers, a state company (Centrais de Abastecimento do Espirito Santo S/A)CEASA
28139012000110Espírito Santo State Housing and Urban Development Company (Companhia de Habitação e Urbanização do Estado do Espirito Santo)COHAB
02489503000106Military Fire Department (Corpo de Bombeiros Militar)CBMES
28162105000166State Department of Motor Vehicles (Departamento Estadual de Trânsito)DETRAN
04889717000197Espírito Santo State Highway Department (Departamento de Estradas de Rodagem do Estado do Espírito Santo)DER-ES
28161362000183Official Press Department (Departamento de Imprensa Oficial)DIO
35964162000124Public Service School (Escola de Serviços Públicos)ESESP
30965214000163Espírito Santo School of Music (Faculdade de Música do Espirito Santo)FAMES
07296722000184Science and Technology Support Foundation (Fundação de Apoio à Ciência e Tecnologia)FAPES
02133636000137Fire Department Re-equipment Special Fund (Fundo Especial de Reequip. Corpo Bombeiros)FUNREBOM
01449136000146Civil Police Re-equipment Special Fund (Fundo Especial de Reequipamento da POLICIA CIVIL)FUNREPOCI
18542218000133Special Fund of the Espírito Santo State Public Prosecutor's Office (Fundo Especial do Ministério Público do Estado do Espírito Santo)FUNEMP
20868995000114Special Fund of the Espírito Santo State Judiciary (Fundo Especial do Poder Judiciário do Estado do Espírito Santo)FUNPJ
20604213000130State Anti-Drug Fund (Fundo Estadual Anti Drogas)FESAD
01076895000100State Social Assistance Fund (Fundo Estadual de Assistência Social)FEAS
02504742000180State Science and Technology Fund (Fundo Estadual de Ciência e Tecnologia)FUNCITEC
27173272000140State Anti-Corruption Fund (Fundo Estadual de Combate a Corrupção)FECC
15833032000145State Fund to Fight and Eradicate Poverty (Fundo Estadual de Combate e Erradicação da Pobreza)FUNCOP
20310626000101State Culture Fund (Fundo Estadual de Cultura)FUNCULTURA
02397642000100State Consumer Protection Fund (Fundo Estadual de Defesa do Consumidor)FEDC
20355058000165Espírito Santo State Water Resources Fund (Fundo Estadual de Recursos Hídricos do Espírito Santo)FUNDAGUA
06893466000140State Health Fund (Fundo Estadual de Saúde)FES
20846927000154State Environment Fund (Fundo Estadual do Meio Ambiente)FUNDEMA
20516616000127State Prison Fund (Fundo Penitenciário Estadual)FUNPEN
31677776000174Prison System Revolving Fund (Fundo Rotativo do Sistema Penitenciário)FRSP
36388023000910Children and Adolescents Fund (Fundo da Infância e Adolescência)FIA
04937281000164Public Servant Development and Assistance Fund (Fundo de Desenvolvimento e Assistência ao Servidor Público)FUNDASPES
21902751000173Tourism Promotion Fund (Fundo de Fomento do Turismo)FUNTUR
20639872000101Espírito Santo Sports and Leisure Incentive Fund (Fundo de Incentivo ao Esporte e Lazer do Estado do Espírito Santo)PROESPORTE
19797818000105Fund for Modernizing and Encouraging Overdue Tax Debt Collection (Fundo de Modernização e Incentivo à Cobrança da Dívida Ativa)FUNCAD
37566095000115Military Social Protection Fund (Fundo de Proteção Social dos Militares)FPS
27273416000130Espírito Santo Institute for Agricultural Research, Technical Assistance and Rural Extension (Instituto Capixaba de Pesquisa, Assistência Técnica e Extensão Rural)INCAPER
05200358000181State Institute for the Environment and Water Resources (Instituto Estadual de Meio Ambiente e Recursos Hídricos)IEMA
08696369000192State Public Works Institute (Instituto Estadual de Obras Públicas)IOPES
08109446000160State Consumer Protection Institute (Instituto Estadual de Proteção e Defesa do Consumidor)PROCON
27316918000109Jones dos Santos Neves Institute (Instituto Jones dos Santos Neves)IJSN
30967111000132Espírito Santo Socio-Educational Institute for Young Offenders (Instituto de Atendimento Sócio-Educativo do Espírito Santo)IASES
02254666000100Agricultural and Forestry Defense Institute (Instituto de Defesa Agropecuária e Florestal)IDAF
29986312000106Jerônimo Monteiro Pension and Assistance Institute (Instituto de Previdência e Assistência Jerônimo Monteiro)IPAJM
28162790000120Information and Communication Technology Institute (Instituto de Tecnologia da Informação e Comunicação)ITI
28152080000110Espírito Santo State Commercial Registry (Junta Comercial do Estado do Espírito Santo)JUCEES
02304470000174Espírito Santo State Public Prosecutor's Office (Ministério Publico do Estado do Espirito Santo)MPES
27476100000145Judiciary (Poder Judiciário)TJES
27470897000173Civil Police (Policia Civil)PCES
01809448000113Military Police (Policia Militar)PMES
27080530000909State Attorney General's Office (Procuradoria Geral do Estado)PGE
36049641000188Espírito Santo Radio and Television (Rádio e Televisão Espírito Santo)RTV-ES
06656711000103Department of Science, Technology, Innovation, Professional Education and Economic Development (Secretaria da Ciência, Tecnologia, Inovação, Educação Profissional e Desenvolvimento Econômico)SECTIDES
01062213000100State Department of Culture (Secretaria de Estado da Cultura)SECULT
27080571000130State Finance Department, the state tax authority (Secretaria de Estado da Fazenda)SEFAZ
36388023000162State Department of Justice (Secretaria de Estado da Justiça)SEJUS
27080605000196State Department of Health (Secretaria de Estado da Saúde)SESA
27080555000147State Department of Agriculture, Supply, Aquaculture and Fisheries (Secretaria de Estado de Agricultura, Abastecimento, Aquicultura e Pesca)SEAG
31777550000145State Department of Control and Transparency (Secretaria de Estado de Controle e Transparência)SECONT
07162270000148State Department of Management and Human Resources (Secretaria de Estado de Gestão e Recursos Humanos)SEGER
31752645000104State Department of Environment and Water Resources (Secretaria de Estado de Meio Ambiente e Recursos Hídricos)SEAMA
27142025000186State Department of Public Security and Social Defense (Secretaria de Estado de Segurança Pública de Defesa Social)SESP
28414571000191Industrial Hub Projects Superintendency (Superintendência dos Projetos de Polarização Industrial)SUPPIN
28483014000122Espírito Santo State Court of Audit (Tribunal de Contas do Estado do Espírito Santo)TCEES

DUA-ES Single Issuing
Area and Service

Looks up the areas and services of an accredited agency. Each service has a revenue code (codigo_receita), the number that tells the state which tax or fee is paid. Use the returned codes in the codigo_area and codigo_servico fields when you issue.

To look them up, send a GET request to /2/dua/area-servico.

Request parameters:

ParameterRequiredTypeAccepted format and values
ambienteYesinteger1 (production); 2 is refused.
cnpjYesstringCNPJ of the agency, with 14 digits; see Accredited Agencies.

Request example:

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/area-servico?ambiente=1&cnpj=28161362000183"

Response fields: the agency's codes and values are returned as strings. When there is only one area or one service, that field can be an object. When there are several, it is a list.

FieldTypeFormat and meaning
ambienteintegerEnvironment queried: 1 for production.
data_retornostringDate and time of the response, in ISO 8601 format.
protocolostring36-character identifier of the response.
tempo_processamentointegerProcessing time reported by SEFAZ, in milliseconds.
codigo_retornointegerResult code; 101 means success in this lookup.
descricao_retornostringDescription of the result, as reported by SEFAZ.
orgaoobject or empty arrayAgency data; [] when no data is returned.
orgao.cnpjstringCNPJ of the agency, with 14 digits.
orgao.nome, orgao.siglastringName and acronym of the agency.
orgao.areaobject or arrayOne area or a list of areas; it may be missing.
area.cod, area.descstringCode and description of the area.
area.servicoobject or arrayOne service or a list of services of the area; it may be missing.
servico.cod, servico.desc, servico.codigo_receitastringCode and description of the service, and the revenue code.

Success example — HTTP 200: sample values.

{
  "ambiente": 1,
  "data_retorno": "2026-07-14T19:06:08",
  "protocolo": "00000000-aaaa-0000-aaaa-000000000000",
  "tempo_processamento": 121,
  "codigo_retorno": 101,
  "descricao_retorno": "Consulta Area e Servico realizada com sucesso",
  "orgao": {
    "cnpj": "28161362000183",
    "nome": "Departamento de Imprensa Oficial",
    "sigla": "DIO",
    "area": [
      {"cod": "269", "desc": "Outras Receitas", "servico": {"cod": "19442", "desc": "Outras receitas", "codigo_receita": "2411"}},
      {"cod": "278", "desc": "Venda de Jornais", "servico": [
        {"cod": "21849", "desc": "Jornal Atrasado", "codigo_receita": "4553"},
        {"cod": "21850", "desc": "Jornal do Dia", "codigo_receita": "4553"}
      ]}
    ]
  }
}

Error example: a request with ambiente=2 is refused before any lookup at SEFAZ-ES.

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/area-servico?ambiente=2&cnpj=28161362000183"

HTTP 422 response (error is the message and codigo identifies the refusal):

{
  "error": "A SEFAZ-ES não oferece ambiente de homologação para a DUA-e. Envie ambiente 1 (produção). Nada foi enviado à SEFAZ-ES.",
  "codigo": "dua_sem_ambiente_homologacao"
}

Common validation failures and communication failures can return HTTP 200 with {"error":"mensagem"}. Check the body, not only the HTTP code.

DUA-ES Single Issuing
City

Looks up the cities that SEFAZ-ES accepts. Use the returned code in the codigo_municipio field when you issue. In batch issuing, the API uses the destination city of the goods: the delivery city, when the invoice has one, or the recipient's city.

To look them up, send a GET request to /2/dua/municipio.

Request parameters:

ParameterRequiredTypeAccepted format and values
ambienteYesinteger1 (production); 2 is refused.

Request example:

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/municipio?ambiente=1"

Response fields:

FieldTypeFormat and meaning
ambienteintegerEnvironment queried: 1 for production.
data_retornostringDate and time of the response, in ISO 8601 format.
protocolostring36-character identifier of the response.
tempo_processamentointegerProcessing time reported by SEFAZ, in milliseconds.
codigo_retornointegerResult code; 103 means success in this lookup.
descricao_retornostringDescription of the result, as reported by SEFAZ.
municipioarrayList of returned cities; it can be empty.
municipio[].codstringCity code at SEFAZ-ES, with 4 or 5 digits.
municipio[].descstringCity name.

Success example — HTTP 200: sample values.

{
  "ambiente": 1,
  "data_retorno": "2026-07-14T19:20:14",
  "protocolo": "00000000-aaaa-0000-aaaa-000000000000",
  "tempo_processamento": 102,
  "codigo_retorno": 103,
  "descricao_retorno": "Consulta Municipio realizada com sucesso",
  "municipio": [
    {"cod": "56014", "desc": "AFONSO CLAUDIO"},
    {"cod": "57177", "desc": "AGUA DOCE DO NORTE"},
    {"cod": "57053", "desc": "VITORIA"}
  ]
}

Error example: a request with ambiente=2 is refused before any lookup at SEFAZ-ES.

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/municipio?ambiente=2"

HTTP 422 response (error is the message and codigo identifies the refusal):

{
  "error": "A SEFAZ-ES não oferece ambiente de homologação para a DUA-e. Envie ambiente 1 (produção). Nada foi enviado à SEFAZ-ES.",
  "codigo": "dua_sem_ambiente_homologacao"
}

Common validation failures and communication failures can return HTTP 200 with {"error":"mensagem"}. Check the body, not only the HTTP code.

DUA-ES Single Issuing
Service Amount

Looks up the amount of a service for a given agency and area, so you can send it in the valor field when you issue. In batch issuing, the API calculates the amounts of the slip.

To look it up, send a GET request to /2/dua/valor-servico.

Request parameters:

ParameterRequiredTypeAccepted format and values
ambienteYesinteger1 (production); 2 is refused.
cnpjYesstringCNPJ of the agency, with 14 digits; see Accredited Agencies.
codigo_areaYesstringNumeric area code with 1 to 6 digits, from the area and service lookup.
codigo_servicoYesstringNumeric service code with 1 to 6 digits, from the area and service lookup.
quantidadeNointegerWhole, non-negative quantity with 1 to 6 digits, when sent. Decimals are not accepted.

Request example:

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/valor-servico?ambiente=1&cnpj=27080571000130&codigo_area=297&codigo_servico=11092&quantidade=1"

Response fields: the codes and the service amount are returned as strings.

FieldTypeFormat and meaning
ambienteintegerEnvironment queried: 1 for production.
data_retornostringDate and time of the response, in ISO 8601 format.
protocolostring36-character identifier of the response.
tempo_processamentointegerProcessing time reported by SEFAZ, in milliseconds.
codigo_retornointegerResult code; 102 means success in this lookup.
descricao_retornostringDescription of the result, as reported by SEFAZ.
orgaoobjectData of the agency and of the service looked up.
orgao.cnpjstringCNPJ of the agency, with 14 digits.
orgao.nome, orgao.siglastringName and acronym of the agency.
orgao.areaobjectArea of the service looked up.
orgao.area.cod, orgao.area.descstringCode and description of the area.
orgao.area.servicoobjectData of the service looked up.
orgao.area.servico.cod, orgao.area.servico.desc, orgao.area.servico.codigo_receitastringCode and description of the service, and the revenue code.
orgao.area.servico.valorstringDecimal amount in Brazilian reais (R$), with a dot as the decimal separator.

Success example — HTTP 200: sample values.

{
  "ambiente": 1,
  "data_retorno": "2026-07-14T19:33:42",
  "protocolo": "00000000-aaaa-0000-aaaa-000000000000",
  "tempo_processamento": 154,
  "codigo_retorno": 102,
  "descricao_retorno": "Consulta Valor do Servico realizada com sucesso",
  "orgao": {
    "cnpj": "27080571000130",
    "nome": "Secretaria de Estado da Fazenda",
    "sigla": "SEFAZ",
    "area": {
      "cod": "297",
      "desc": "Requerimentos",
      "servico": {"cod": "11092", "desc": "Isencao de IPVA Para Deficiente", "codigo_receita": "2097", "valor": "73.03"}
    }
  }
}

Error example: a request with ambiente=2 is refused before any lookup at SEFAZ-ES.

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/valor-servico?ambiente=2&cnpj=27080571000130&codigo_area=297&codigo_servico=11092"

HTTP 422 response (error is the message and codigo identifies the refusal):

{
  "error": "A SEFAZ-ES não oferece ambiente de homologação para a DUA-e. Envie ambiente 1 (produção). Nada foi enviado à SEFAZ-ES.",
  "codigo": "dua_sem_ambiente_homologacao"
}

Common validation failures and communication failures can return HTTP 200 with {"error":"mensagem"}. Check the body, not only the HTTP code.

DUA-ES Single Issuing
Request Parameters

The fields below describe the slip: the agency, the area and the service you looked up in the previous sections, the taxpayer, the dates and the amounts.

Request parameters:

ParameterRequiredType and formatDescription
ambiente
Required
integerOnly 1, production.
url_notificacao
Required
string, URL, up to 500 charactersAddress that receives the result notification.
cnpj_orgao
Required
string, 14 digitsValid CNPJ (company ID) of the agency responsible for the service.
codigo_area
Required
string or number, 1 to 6 digitsCode of the agency's area.
codigo_servico
Required
string or number, 1 to 6 digitsCode of the service.
documento_contribuinte
Required
string, valid CPF or CNPJTaxpayer's document, with or without punctuation.
data_referencia
Required
string, YYYY-MMReference month, from 1991-01 onward.
data_vencimento
Required
string, YYYY-MM-DDDue date. It cannot be before the first day of the reference month.
data_pagamento
Required
string, YYYY-MM-DDPlanned payment date. It cannot be before today's date in São Paulo time.
codigo_municipio
Required
string or number, 4 to 5 digitsCity code provided by SEFAZ-ES.
informacoes_complementares
Required
string, up to 256 charactersAdditional information on the slip.
valor
Optional
number or numeric string, up to 10 integer digits and 2 decimalsRevenue amount.
valor_multa, valor_juros, valor_atualizacao
Optional
number or numeric string, up to 10 integer digits and 2 decimalsFine, interest and monetary adjustment amounts, in that order.
quantidade
Optional
integer, 1 to 6 digitsQuantity of the service.
referencia_interna
Optional
string, up to 30 charactersFree-form identifier for the request. It is not an idempotency key.
gerar_pix
Optional
booleantrue or 1 requests a PIX QR code; false or 0 does not.

When the service requires an amount, send it: without valor, the agency may refuse the request. See Service Amount.

DUA-ES Single Issuing
Request Example

Send a POST request in JSON to /2/dua/emissao. Replace the data and dates with those of your operation.

curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ambiente": 1,
    "url_notificacao": "https://seudominio.com.br/webhook/dua",
    "cnpj_orgao": "12345678000195",
    "codigo_area": 5,
    "codigo_servico": 3867,
    "documento_contribuinte": "12345678000195",
    "data_referencia": "2027-06",
    "data_vencimento": "2027-06-30",
    "data_pagamento": "2027-06-30",
    "codigo_municipio": 57053,
    "informacoes_complementares": "DUA EXEMPLO",
    "valor": 1.00,
    "quantidade": 1,
    "referencia_interna": "NFe XYZ",
    "gerar_pix": true
  }' \
  https://api.webmania.com.br/2/dua/emissao

Below is an example of the request body:

{
  "ambiente": 1,
  "url_notificacao": "https://seudominio.com.br/webhook/dua",
  "cnpj_orgao": "12345678000195",
  "codigo_area": 5,
  "codigo_servico": 3867,
  "documento_contribuinte": "12345678000195",
  "data_referencia": "2027-06",
  "data_vencimento": "2027-06-30",
  "data_pagamento": "2027-06-30",
  "codigo_municipio": 57053,
  "informacoes_complementares": "DUA EXEMPLO",
  "valor": 1.00,
  "quantidade": 1,
  "referencia_interna": "NFe XYZ",
  "gerar_pix": true
}

HTTP 200 response, received for processing:

{
  "status": "processando",
  "mensagem": "Emissão em processamento. Consulte novamente em alguns instantes.",
  "uuid": "00000000-aaaa-0000-aaaa-000000000000"
}

status is a tracking string. mensagem is a guidance message (here: the issue request is being processed; check again in a few moments). uuid is the UUID string of the slip. The immediate response does not confirm approval or payment. The result arrives by notification; see also the Status lookup.

After approval, the slip response can include the data returned by SEFAZ-ES: ambiente (integer), data_retorno and protocolo (strings), tempo_processamento and codigo_retorno (integers), descricao_retorno (string) and guia (object). Depending on the returned data, guia.numero_guia, guia.data_emissao, guia.linha_digitavel and guia.pix_copia_cola are strings, and guia.valor_total holds the total amount. These fields depend on the result and do not necessarily appear in the immediate response.

HTTP 422 error, test environment not available:

{
  "error": "A SEFAZ-ES não oferece ambiente de homologação para a DUA-e. Envie ambiente 1 (produção). Nada foi enviado à SEFAZ-ES.",
  "codigo": "dua_sem_ambiente_homologacao"
}

error is the readable message (here: SEFAZ-ES has no test environment for the DUA-e; send ambiente 1, production; nothing was sent to SEFAZ-ES). codigo is the text identifier of the error, when provided. If a request fails or the result is uncertain, look up the existing slip before you send it again: a new issue request can create another payable document.

DUA-ES Single Issuing
Overdue Tax Debt (CDA)

Issues a DUA-e for a debt registered as overdue tax debt (dívida ativa), based on the CDA (certificate of overdue tax debt). The certificate number identifies the debt, so you do not send the agency, area, service or amounts.

To issue, send a POST request to /2/dua/emissao-cda.

As with issuing by amount, issuing by CDA runs only in production and creates a real, payable document.

Request parameters:

ParameterRequiredType and formatDescription
ambiente
Required
integerOnly 1, production.
url_notificacao
Required
string, URL, up to 500 charactersAddress that receives the result notification.
documento_contribuinte
Required
string, valid CPF or CNPJTaxpayer's document, with or without punctuation.
numero_cda
Required
string, 1 to 9 digitsNumber of the CDA (certificate of overdue tax debt).

Request example. Replace the document and the certificate number with the data of your operation:

curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ambiente": 1,
    "url_notificacao": "https://seudominio.com.br/webhook/dua",
    "documento_contribuinte": "12345678000195",
    "numero_cda": "99992099"
  }' \
  https://api.webmania.com.br/2/dua/emissao-cda

HTTP 200 response, received for processing:

{
  "status": "processando",
  "mensagem": "Emissão em processamento. Consulte novamente em alguns instantes.",
  "uuid": "00000000-aaaa-0000-aaaa-000000000000"
}

status is a tracking string. mensagem is a guidance message. uuid is the UUID string of the slip. The immediate response does not confirm approval or payment. The result arrives by notification; see also the Status lookup.

After approval, the response can include ambiente (integer), data_retorno and protocolo (strings), tempo_processamento and codigo_retorno (integers), descricao_retorno (string) and the guia object. Depending on the result, guia.numero_guia, guia.data_emissao, guia.linha_digitavel and guia.pix_copia_cola are strings, and guia.valor_total holds the total amount. Whether these fields appear depends on the returned result.

HTTP 422 error, test environment not available:

{
  "error": "A SEFAZ-ES não oferece ambiente de homologação para a DUA-e. Envie ambiente 1 (produção). Nada foi enviado à SEFAZ-ES.",
  "codigo": "dua_sem_ambiente_homologacao"
}

error is the readable message and codigo is the text identifier of the error, when provided. If the result is not confirmed, look up the existing slip before you send another request.

Status Lookup

Returns the current status of a DUA-e by the slip's UUID, for the authenticated company only. Track slips day to day through notifications; use this lookup to get the full result of an issued slip, in the resultado field, or to spot-check a single slip. Use the UUID of the slip, not the UUID of the calculation.

Each slip has one of the statuses below:

StatusWhat it meansWhat to do
processandoThe slip is being issued.Wait for the notification. Do not issue again.
pendenteThe slip was issued and is waiting for payment.Pay with the payment code (linha digitável) or PIX, or in a batch with a CNAB 240 file (the standard Brazilian bank file layout).
pagoThe bank return file confirmed payment of the whole slip.Nothing to do.
reprovadoThe issue request was refused, including by SEFAZ.Read motivos_rejeicao before you issue again.
contingenciaThe issue request is waiting for a retry, or its result is uncertain.Read mensagem; see Processing and Contingency.

To look up a slip, send a GET request to /2/dua/status/{uuid}.

Request parameters:

ParameterRequiredTypeFormat and values
uuidYesstringIdentifier of the slip in the URL, in the 36-character UUID format (8-4-4-4-12).

Request example: replace the token with your company's token and the UUID with the slip's UUID.

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/status/00000000-aaaa-0000-aaaa-000000000000"

HTTP 200 response — slip being processed:

{
  "status": "processando",
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "numero_dua": null
}

HTTP 200 response — approved slip: the content of resultado depends on the issuing result. The declaration appears only when it is available.

{
  "status": "pendente",
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "numero_dua": "0000000000",
  "resultado": {
    "ambiente": 1,
    "data_retorno": "2026-10-29T10:00:00",
    "protocolo": "00000000-bbbb-0000-bbbb-000000000000",
    "tempo_processamento": 412,
    "codigo_retorno": 105,
    "descricao_retorno": "Dua emitido com sucesso",
    "guia": { "numero_guia": "0000000000" },
    "status": "pendente",
    "codigo_barra_48": null,
    "pix_copia_cola": null,
    "valor_total": null
  },
  "origem": "periodo",
  "guias": [{ "alocacao": "automatica", "classe": null, "complementos_aplicados": null }],
  "declaracao": {
    "ufs_com_inscricao": ["SP"],
    "texto_versao": "guias-declaracao-uf/v2",
    "atualizada_em": "2026-10-29T10:00:00-03:00"
  }
}

Example of an HTTP 200 response for a rejected slip. The reason is an example of a platform code: the slip could not be sent to SEFAZ within the retry limit, no slip was created by these attempts, and you should send the UUID to support so they can check the communication.

{
  "status": "reprovado",
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "numero_dua": null,
  "motivos_rejeicao": [
    {
      "codigo": "TRANSPORTE_PRE_ENVIO_ESGOTADO",
      "mensagem": "Não foi possível enviar a guia à SEFAZ após o limite de tentativas. Nenhuma guia foi gerada por estas tentativas. Informe o UUID ao suporte para verificar a comunicação."
    }
  ]
}

Example of an HTTP 404 error, for a slip that does not exist, belongs to another company or is of another type (the message means "slip not found"):

{
  "error": "Guia não encontrada."
}

Example of an HTTP 401 error, for a missing or invalid token (the message means "restricted access; token missing or invalid"):

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

The error field is a string that describes the error. Subscription failures can also return HTTP 403; see Response format.

Status Lookup
Result Fields

Some fields are always returned. The others depend on the status and on the available data.

FieldPresence / typeFormat, values and meaning
statusAlways / stringprocessando, pendente, pago, contingencia or reprovado.
uuidAlways / stringUUID of the slip, with 36 characters.
numero_duaAlways / string or nullDUA-e number when available; null while there is no number. For overdue tax debt (dívida ativa), it is not the CDA number.
resultadoOnly in pendente or pago / objectIssuing result, with content that varies according to SEFAZ/ES. ambiente (integer); data_retorno is a date and time string; protocolo is a 36-character string, different from the slip's UUID; tempo_processamento and codigo_retorno (integer); descricao_retorno and status are strings. guia is an object: numero_guia, data_emissao, valor_total, linha_digitavel and pix_copia_cola are strings when available. codigo_barra_48, pix_copia_cola and valor_total at the resultado level are strings or null. Payment details can be left out when they are not provided.
motivos_rejeicaoOnly in reprovado / arrayReasons for the refusal. When normalized, each object has codigo (string with a SEFAZ/ES or API code) and mensagem (descriptive string). See the Return codes; older responses may keep another format.
pagamentoWhen pago / objectdata_pagamento, valor, banco, autenticacao and registrado_em, as described in Slip status and payment. It does not appear on a slip that was only issued.
mensagemConditional / stringGuidance for an uncertain result, a contingency or an attempt that is still being processed.
origemConditional / stringOn slips created by the calculation: periodo or chaves, according to the selection.
notas, notas_ignoradasConditional / arrays of objectsDetails of the invoices and, when there are any, the subset of ignored ones. In each object, chave is the NF-e access key (string); valor_icms_st and valor_difal are decimal amounts as strings or null; motivo_ignorado is a string or null; receita is a string or null, and it is usually null in the DUA-ES.
guiasConditional / array of objectsDetails of the slip created by the calculation, when available. alocacao is the string automatica; classe is a string or null; complementos_aplicados is an array or null.
parcelas_recusadasConditional / array of objectsInstallments not included in the slip. Each object identifies the invoice in chave (string), plus receita, parcela, motivo, componente and mensagem (strings), valor (decimal string) and acao (string or null); guia_indicado can appear as a string.
declaracaoConditional / object or nullDeclaration used for the slip. ufs_com_inscricao is an array of state codes (UF) where the company declared, at the time of issuing, that it has a state registration (IE) or a special tax regime. texto_versao is the version of the declaration text, a string or null. atualizada_em is the date and time of the update, a string or null. The object can be null when the declaration is not available, and it can be missing on slips without a related calculation.

Status Lookup
Processing and Contingency

While the slip is in processando or contingencia, no notification is sent. In these cases:

  • processando: issuing is in progress. Wait, and do not create another issue request for the same obligation.
  • contingencia with a new attempt: the previous attempt created no slip, and the same request will be repeated automatically, as mensagem says. Track the same UUID and do not issue again. This slip does not appear in GET /2/guias?status=processando.
  • contingencia with an uncertain result: the slip may have been issued before a communication failure. Check with SEFAZ-ES and, if needed, send the UUID to support before you pay or issue by other means.

Example of an HTTP 200 response with an uncertain result. The message says that the slip may have been issued before the communication failure, that you must check SEFAZ manually, and that you must not resend the issue request before that check, to avoid a duplicate tax document:

{
  "status": "contingencia",
  "uuid": "00000000-aaaa-0000-aaaa-000000000000",
  "numero_dua": null,
  "mensagem": "Status incerto. A guia pode ter sido emitida antes da falha de comunicação. Consulte a SEFAZ manualmente. Não reenvie a emissão antes dessa confirmação, para evitar um documento fiscal em duplicidade."
}

Lookups

The services below look up at SEFAZ-ES an issued DUA-e, its PDF and the payments in a period. All of them use only ambiente 1 (production).

Lookups
DUA-e Lookup

Looks up a DUA-e already issued by the authenticated company. Send the slip number and the CPF or CNPJ of the taxpayer given when the slip was issued.

To look it up, send a POST request to /2/dua/consulta.

Request parameters:

ParameterRequiredTypeFormat and values
ambiente
Required
integer1 for production, the only environment available for the DUA-e.
numero_guia
Required
stringSlip number with 1 to 10 digits, without punctuation.
cpf
Required when cnpj is not sent
stringCPF (individual taxpayer ID) of the slip's taxpayer, with 11 digits. Send only the CPF or the CNPJ.
cnpj
Required when cpf is not sent
stringCNPJ (company ID) of the slip's taxpayer, with 14 digits. Send only the CNPJ or the CPF.

Request example:

curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ambiente": 1,
    "numero_guia": "1234567890",
    "cnpj": "00000000000000"
  }' \
  https://api.webmania.com.br/2/dua/consulta

HTTP 200 response: it includes the lookup result and the available data of the slip. The slip fields can be left out when SEFAZ-ES does not report them. The values below are samples.

{
  "ambiente": 1,
  "data_retorno": "2026-07-14T18:30:29",
  "protocolo": "00000000-aaaa-0000-aaaa-000000000000",
  "tempo_processamento": 186,
  "codigo_retorno": 104,
  "descricao_retorno": "Consulta Dua realizada com sucesso",
  "guia": {
    "numero_guia": "1234567890",
    "data_emissao": "2026-07-14T15:18:16",
    "linha_digitavel": "858700000006011200072027308110000000000000000000",
    "data_referencia": "2026-07",
    "data_vencimento": "2026-07-14",
    "data_pagamento": "2026-07-14",
    "valor_total": "1.12",
    "orgao": {"cnpj": "27080571000130", "nome": "Secretaria de Estado da Fazenda", "sigla": "SEFAZ", "codigo": "1"},
    "area": {"nome": "Receita de ICMS", "codigo": "1902"},
    "servico": {"nome": "ICMS - Diferencial de Alíquota", "codigo": "3867"},
    "receita": {"codigo": "3867", "valor": "1.00"},
    "contribuinte": {"cnpj": "00000000000000", "razao_social": "Empresa Exemplo LTDA"},
    "pagamento": {"codigo": "1", "data_autenticacao": "2026-07-14", "agencia": "0675", "autenticacao": "0675PIX-00000000000000", "forma": "1", "tipo_captura": "9", "banco": "021"}
  }
}

Response fields: ambiente, tempo_processamento and codigo_retorno are integers. The time is in milliseconds, and the code is in the return codes table. data_retorno is text in YYYY-MM-DDTHH:MM:SS format; protocolo and descricao_retorno are text. guia is an object, possibly empty.

Field of guiaTypeFormat and meaning
numero_guiastringSlip number, with up to 10 digits.
data_emissaostringIssue date and time in YYYY-MM-DDTHH:MM:SS.
linha_digitavelstringPayment code (linha digitável) with 48 digits.
pix_copia_colastringOptional; content of the PIX QR code.
data_referenciastringReference period in YYYY-MM.
data_vencimento, data_pagamentostringDates in YYYY-MM-DD.
valor_multa, valor_juros, valor_atualizacao, valor_credito, valor_totalstringDecimal amounts in Brazilian reais (R$), with a dot and up to two decimal places.
informacoes_complementaresstringOptional; additional text of the slip.
orgaoobjectcnpj (string, 14 digits), nome, sigla and codigo (strings) of the agency.
area, servicoobjectnome and codigo are strings that identify the area or service.
receitaobjectcodigo (the revenue code) is a string; valor is a decimal string in reais, with up to two decimal places.
contribuinteobjectcpf (11 digits) or cnpj (14 digits), as a string; razao_social (legal name) is an optional string.
pagamentoobjectStrings codigo, data_autenticacao (date in YYYY-MM-DD), agencia, autenticacao, forma, tipo_captura and banco, when available.

Errors: a slip that does not exist, belongs to another company or has a different taxpayer returns HTTP 404 (the message means "slip not found"):

{
  "error": "Guia não encontrada."
}

A lookup with ambiente 2 returns HTTP 422, and nothing is sent to SEFAZ-ES:

{
  "error": "A SEFAZ-ES não oferece ambiente de homologação para a DUA-e. Envie ambiente 1 (produção). Nada foi enviado à SEFAZ-ES.",
  "codigo": "dua_sem_ambiente_homologacao"
}

Other validation errors return HTTP 200 with error. A failed lookup at SEFAZ-ES can also return HTTP 200 with error, so always check the response body. In this example, the API could not process the SEFAZ-ES response:

{
  "error": "Falha ao processar resposta da SEFAZ-ES."
}

If the API cannot check that the slip belongs to the company, it returns HTTP 503 with error. Without a valid token, it returns HTTP 401.

Lookups
Get the PDF

Returns the PDF of a DUA-e issued by the authenticated company, encoded in base64.

To get the PDF, send a GET request to /2/dua/pdf/{numero_guia}.

Request parameters:

ParameterRequiredTypeLocation, format and values
numero_guia
Required
stringIn the URL path; 1 to 10 digits without punctuation.
ambiente
Required
integerIn the query string; 1 for production, the only environment available for the DUA-e.
cpf
Required when cnpj is not sent
stringIn the query string; CPF of the slip's taxpayer, with 11 digits. Send only the CPF or the CNPJ.
cnpj
Required when cpf is not sent
stringIn the query string; CNPJ of the slip's taxpayer, with 14 digits. Send only the CNPJ or the CPF.

Send the slip number in the path. If you also send it as numero_guia in the query string, it must be identical to the one in the path.

Request example:

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/pdf/1234567890?ambiente=1&cnpj=00000000000000"

HTTP 200 response example: the values are samples. Decode pdf_base64 to get the PDF you received.

{
  "ambiente": 1,
  "data_retorno": "2026-07-14T18:49:09",
  "protocolo": "00000000-aaaa-0000-aaaa-000000000000",
  "tempo_processamento": 613,
  "codigo_retorno": 106,
  "descricao_retorno": "PDF do Dua obtido com sucesso",
  "pdf_base64": "JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCAyMDAgMjAwXSAvQ29udGVudHMgNCAwIFIgPj4KZW5kb2JqCjQgMCBvYmoKPDwgL0xlbmd0aCAwID4+CnN0cmVhbQoKZW5kc3RyZWFtCmVuZG9iagp4cmVmCjAgNQowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1OCAwMDAwMCBuIAowMDAwMDAwMTE1IDAwMDAwIG4gCjAwMDAwMDAyMDIgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSA1IC9Sb290IDEgMCBSID4+CnN0YXJ0eHJlZgoyNTEKJSVFT0YK"
}
Response fieldTypeFormat and meaning
ambienteinteger1, production.
data_retornostringDate and time of the response in YYYY-MM-DDTHH:MM:SS.
protocolostringProtocol returned by SEFAZ-ES.
tempo_processamentointegerTime in milliseconds.
codigo_retornointegerResult code; 106 means the PDF was obtained. See return codes.
descricao_retornostringDescription of the lookup result.
pdf_base64stringPDF encoded in base64; it can be empty when there is no PDF.

Errors: a slip that does not exist, belongs to another company or has a different taxpayer returns HTTP 404 (the message means "slip not found"):

{
  "error": "Guia não encontrada."
}

A different number in the query string and in the path returns HTTP 422 (the message says the slip number in the URL differs from the one in the parameters):

{
  "error": "O número da guia informado na URL difere do informado nos parâmetros."
}

ambiente 2 also returns HTTP 422, and nothing is sent to SEFAZ-ES:

{
  "error": "A SEFAZ-ES não oferece ambiente de homologação para a DUA-e. Envie ambiente 1 (produção). Nada foi enviado à SEFAZ-ES.",
  "codigo": "dua_sem_ambiente_homologacao"
}

Other validation errors return HTTP 200 with error. A failed lookup at SEFAZ-ES can also return HTTP 200 with error, so always check the response body:

{
  "error": "Falha ao processar resposta da SEFAZ-ES."
}

If the API cannot check that the slip belongs to the company, it returns HTTP 503 with error. Without a valid token, it returns HTTP 401.

Lookups
Paid DUA-e

Lists the paid DUA-e of the authenticated company in a period, as recorded by SEFAZ-ES.

To look them up, send a POST request to /2/dua/pagos.

Request parameters:

ParameterRequiredTypeFormat and values
ambiente
Required
integer1 for production, the only environment available for the DUA-e.
compactar
Required
integer0 for an uncompressed list, or 1 for content compressed with gzip and encoded in base64.
cnpj
Required
stringCNPJ of the authenticated company itself, with 14 digits.
periodo
Required
objectHolds the start and end dates of the lookup.
periodo.data_inicio
Required
stringStart date in YYYY-MM-DD.
periodo.data_fim
Required
stringEnd date in YYYY-MM-DD; it cannot be before the start date.

Request example:

curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ambiente": 1,
    "compactar": 0,
    "cnpj": "00000000000000",
    "periodo": {
      "data_inicio": "2026-07-01",
      "data_fim": "2026-07-14"
    }
  }' \
  https://api.webmania.com.br/2/dua/pagos

HTTP 200 response example: one payment found, with sample values.

{
  "ambiente": 1,
  "data_retorno": "2026-07-14T18:30:10",
  "protocolo": "00000000-aaaa-0000-aaaa-000000000000",
  "tempo_processamento": 130,
  "codigo_retorno": 108,
  "descricao_retorno": "Pagamentos localizados",
  "pagamentos": [{
    "numero_guia": "1234567890",
    "tp_pess": "2",
    "documento_contribuinte": "00000000000000",
    "nome_orgao": "Secretaria de Estado da Fazenda",
    "nome_area": "Receita de ICMS",
    "nome_servico": "ICMS - Diferencial de Alíquotas",
    "codigo_receita": "3867",
    "nome_municipio": "Vitória",
    "valor_receita": "1.00",
    "valor_multa": "0.05",
    "valor_juros": "0.07",
    "valor_atualizacao": "0.00",
    "banco": "021",
    "agencia": "0675",
    "data_autenticacao": "2026-07-14",
    "forma_recebimento": "9",
    "informacoes_complementares": "DUA EXEMPLO"
  }]
}

The common fields are ambiente, tempo_processamento (milliseconds) and codigo_retorno (integers). data_retorno is a string in YYYY-MM-DDTHH:MM:SS; protocolo and descricao_retorno are strings. See the return codes. The pagamentos list can be empty. When the response is compressed, pagamentos_base64 is a base64 string: decode it and decompress the gzip content.

Fields of each item in pagamentos:

FieldTypeFormat and meaning
numero_guiastringDUA number with up to 10 digits.
tp_pessstring1 for CPF or 2 for CNPJ.
documento_contribuintestringCPF with 11 digits or CNPJ with 14 digits, according to tp_pess.
nome_orgao, nome_area, nome_servico, nome_municipiostringNames of the agency, area, service and city.
codigo_receitastringRevenue code, up to 6 digits.
valor_receita, valor_multa, valor_juros, valor_atualizacaostringDecimal amount in Brazilian reais (R$), with a dot and up to two decimal places.
banco, agenciastringOptional; bank and branch codes.
data_autenticacaostringPayment date in YYYY-MM-DD.
forma_recebimentostringPayment method, with one character. Examples: C check (cheque), D cash (dinheiro) or M mixed (misto).
informacoes_complementaresstringOptional; additional information about the payment.

Errors: if the CNPJ sent is not the authenticated company's CNPJ, the API returns HTTP 404 (the message means "slip not found"):

{
  "error": "Guia não encontrada."
}

ambiente 2 returns HTTP 422, and nothing is sent to SEFAZ-ES:

{
  "error": "A SEFAZ-ES não oferece ambiente de homologação para a DUA-e. Envie ambiente 1 (produção). Nada foi enviado à SEFAZ-ES.",
  "codigo": "dua_sem_ambiente_homologacao"
}

Other validation errors return HTTP 200 with error. A failed lookup at SEFAZ-ES can also return HTTP 200 with error, so always check the response body:

{
  "error": "Falha ao processar resposta da SEFAZ-ES."
}

Without a valid token, the API returns HTTP 401.

Error Codes

This section collects the error codes mentioned elsewhere on this page. For what to do about each calculation refusal, see Refusals. For the general format of error responses, see Response format.

Error Codes
Return Codes

The codes below are returned by SEFAZ/ES (the Espírito Santo state tax authority), grouped by service. In a lookup response, codigo_retorno is an integer or null, and descricao_retorno is a string or null. These fields identify the result reported by the authority, when available. The messages stay in Portuguese, as SEFAZ/ES returns them; the English meaning is shown below each one.

The authority's code and the HTTP code are different.

  • A lookup can return HTTP 200 with a success or a rejection codigo_retorno. Read the response fields, not only the HTTP code.
  • A communication failure in a lookup can return HTTP 200 with error instead of codigo_retorno. API validations and refusals can also use error and, when available, codigo.
  • Issuing can return processando; track the UUID in the status lookup. Receiving the request does not confirm the issue or the payment.
  • A lookup or PDF request with no slip linked to the company can return HTTP 404. If an issuing result is uncertain, confirm the status before you resend.

Success messages

Code SEFAZ/ES message and meaning Recommended action
101Consulta Área e Serviço realizada com sucesso
Area and service lookup completed successfully
None — use the returned area and service.
102Consulta Valor do Serviço realizada com sucesso
Service amount lookup completed successfully
None — use the returned amount.
103Consulta Município realizada com sucesso
City lookup completed successfully
None — use the returned cities.
104Consulta Dua realizada com sucesso
DUA lookup completed successfully
None — use the returned DUA data.
105Dua emitido com sucesso
DUA issued successfully
None — the DUA-e exists and can be paid. Pay it by the due date.
106PDF do Dua obtido com sucesso
DUA PDF obtained successfully
None — the PDF was generated.
108Pagamentos localizados
Payments found
None — review the returned payments.

Failures reported by SEFAZ/ES. Codes 201 to 212 show problems in the communication with the authority; 203 and 204 mean the service is stopped. Follow the recommended action below.

Generic error messages

Code SEFAZ/ES message and meaning Recommended action
201Dados não informados ao órgão
Data not sent to the authority
Contact support.
202Dados acima do tamanho permitido pelo órgão
Data larger than the size the authority allows
Contact support.
203Serviço paralisado momentaneamente
Service temporarily stopped
Wait until the service is back and repeat the operation.
204Serviço paralisado sem previsão de retorno
Service stopped, with no expected return date
Contact support to follow the restoration.
205Emissor não autorizado
Issuer not authorized
Contact support.
206Ambiente informado diverge do ambiente de recebimento
The environment sent differs from the receiving environment
Check the ambiente you sent (production = 1). If the error persists, contact support.
207Dados enviados em formato inválido
Data sent in an invalid format
Contact support.
208Resposta recebida em formato inválido
Response received in an invalid format
Contact support.
209Identificação da comunicação ausente
Communication identifier missing
Contact support.
210Versão da comunicação ausente
Communication version missing
Contact support.
211Versão dos dados não suportada
Data version not supported
Platform failure — contact support.
212Não há parâmetros ativos
No active parameters
Platform failure — contact support.

Error messages: Area and Service lookup

Code SEFAZ/ES message and meaning Recommended action
301Cnpj inválido
Invalid CNPJ
Check the agency's cnpj in the Accredited Agencies table.

Error messages: Service Amount lookup

Code SEFAZ/ES message and meaning Recommended action
401Quantidade informada deve ser valor inteiro
The quantity must be a whole number
Send quantidade as a whole number.
402Receita não permitida para emissão no serviço
Revenue code not allowed for issuing in this service
Check the cnpj/codigo_area/codigo_servico combination returned by the Area and Service lookup.
403Órgão não encontrado
Agency not found
Check the cnpj in the Accredited Agencies table.
404Área não encontrada
Area not found
Check the codigo_area in the response of the Area and Service lookup.
405A Área não pertence ao Órgão
The area does not belong to the agency
Use the cnpj + codigo_area combination returned by the Area and Service lookup.
406Serviço não encontrado (item)
Service not found (item)
Check the codigo_servico together with the area returned by the Area and Service lookup.
407Serviço não encontrado
Service not found
Check the codigo_servico together with the area returned by the Area and Service lookup.
408CNPJ do Órgão inválido
Invalid agency CNPJ
Check the agency's cnpj in the Accredited Agencies table.
409O serviço não é uma taxa
The service is not a fee (taxa)
See the note about taxa after this table.

About 406 and 407 — and, when issuing, 706 and 710. These four messages mean the same thing for your integration: the service (codigo_servico) was not found for the area and agency you sent. The qualifiers "(item)" and "(serviço)" are internal SEFAZ/ES distinctions, with no definition published in the manual. The fix is the same for all these codes: confirm cnpj_orgao/cnpj, codigo_area and codigo_servico exactly as returned by the Area and Service lookup.

What is a taxa? The Web Service separates services of the taxa (fee) type from the other services. A taxa has a fixed amount from a price table, published by SEFAZ/ES on the DUA-e portal. For the other services, the amount is calculated from the quantity (quantidade). Code 409 says that the service you looked up is not a taxa: check the cnpj/codigo_area/codigo_servico combination returned by the Area and Service lookup.

Error messages: DUA lookup

Code SEFAZ/ES message and meaning Recommended action
601Dua não encontrado
DUA not found
Check the numero_guia sent in the lookup.
602Dua não pertence ao cliente informado
The DUA does not belong to the customer provided
Check the customer identifier (cnpj/cpf) sent in the lookup.

Error messages: DUA issuing

Code SEFAZ/ES message and meaning Recommended action
701Quantidade informada deve ser valor inteiro
The quantity must be a whole number
Send quantidade as a whole number.
702Receita não permitida para emissão no serviço
Revenue code not allowed for issuing in this service
Check the cnpj_orgao/codigo_area/codigo_servico combination returned by the Area and Service lookup.
703Órgão não encontrado
Agency not found
Check the cnpj_orgao in the Accredited Agencies table.
704Área não encontrada
Area not found
Check the codigo_area in the response of the Area and Service lookup.
705A Área não pertence ao Órgão
The area does not belong to the agency
Use the cnpj_orgao + codigo_area combination returned by the Area and Service lookup.
706Serviço não encontrado (serviço)
Service not found (service)
Check the codigo_servico together with the area returned by the Area and Service lookup.
707CNPJ do Órgão inválido
Invalid agency CNPJ
Check the cnpj_orgao in the Accredited Agencies table.
708CPF/CNPJ do Cliente inválido
Invalid customer CPF/CNPJ
Check the taxpayer's documento_contribuinte.
709Município não encontrado
City not found
Check the codigo_municipio returned by the SEFAZ/ES city lookup.
710Serviço não encontrado (item)
Service not found (item)
Check the codigo_servico together with the area returned by the Area and Service lookup.
711Mês de Referência zero ou > 12 ou Ano de Referência zero ou < 1991
Reference month is zero or greater than 12, or reference year is zero or before 1991
Send data_referencia in the YYYY-MM format, with a month from 1 to 12 and a year from 1991 onward.
712Data de referência maior que vencimento
Reference date is after the due date
Send a data_vencimento on or after the first day of data_referencia.
713Data de pagamento menor que data atual
Payment date is before today
Send a data_pagamento from today onward — past dates are refused.

Error messages: Get PDF

Code SEFAZ/ES message and meaning Recommended action
801Dua não encontrado
DUA not found
Check the numero_guia you sent.
802Dua não pertence ao cliente informado
The DUA does not belong to the customer provided
Check the customer identifier (cnpj/cpf) you sent.

API refusal before sending

The API returns the refusal below before anything is sent to SEFAZ-ES, with HTTP 422 and the error and codigo fields, both strings. The reasons that refuse an invoice in the calculation are in Refusals.

CodeWhat to do
dua_sem_ambiente_homologacaoThe DUA-e uses production only. Send ambiente: 1; an issue request in production creates a real slip.

Example of the environment check in GET /2/dua/municipio. The ambiente query parameter is required and accepts only 1 (production); 2 causes the refusal shown:

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/municipio?ambiente=2"

HTTP 422 response (the message says that SEFAZ-ES has no test environment for the DUA-e, that you must send ambiente 1, production, and that nothing was sent to SEFAZ-ES):

{
  "error": "A SEFAZ-ES não oferece ambiente de homologação para a DUA-e. Envie ambiente 1 (produção). Nada foi enviado à SEFAZ-ES.",
  "codigo": "dua_sem_ambiente_homologacao"
}

With ambiente=1, a successful response can return HTTP 200:

curl -X GET \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  "https://api.webmania.com.br/2/dua/municipio?ambiente=1"
{
  "ambiente": 1,
  "data_retorno": "2026-07-14T19:20:14",
  "protocolo": "00000000-aaaa-0000-aaaa-000000000000",
  "tempo_processamento": 102,
  "codigo_retorno": 103,
  "descricao_retorno": "Consulta Municipio realizada com sucesso",
  "municipio": [{"cod": "56014", "desc": "AFONSO CLAUDIO"}]
}

In the response, ambiente is an integer; data_retorno is a date and time string; protocolo is a string that identifies the lookup; tempo_processamento and codigo_retorno are integers; and descricao_retorno is a string. These fields can be null when they are not available. municipio is an array of objects with cod and desc as strings: the city code and name. See also City lookup.

The actions in the tables on this page refer to the following request fields. For issuing, see the details and examples in DUA-ES single issuing. For lookups, use the services named in each table.

FieldType, format and whether it is required
ambienteRequired: integer 1, production.
cnpj, cnpj_orgaoCNPJ strings with 14 digits. Send the field that the lookup or the issue request requires.
cpf, documento_contribuinteString with an 11-digit CPF or a 14-digit CNPJ. Depending on the operation, send the taxpayer's CPF or CNPJ.
numero_guiaString with 1 to 10 digits, required to look up a slip or its PDF.
codigo_area, codigo_servicoStrings or numbers with 1 to 6 digits; required in the amount lookup and in issuing by amount.
quantidadeOptional: non-negative integer with up to 6 digits.
codigo_municipioRequired in issuing by amount: SEFAZ/ES code with 4 or 5 digits. It is not the IBGE code (the national statistics office's city code).
data_referenciaRequired in issuing by amount: YYYY-MM string, with a year from 1991 onward and a month from 01 to 12.
data_vencimento, data_pagamentoRequired in issuing by amount: YYYY-MM-DD strings. The due date cannot be before the first day of the reference month, and the payment date cannot be before today.

About the certificate codes. If you receive codes 901 to 904 or code 205, contact support.

Unexpected error (999)

Code SEFAZ/ES message and meaning Recommended action
999Erro inesperado
Unexpected error
See the retry policy below.

Retry policy for 999. For read operations (lookups), wait a few moments and repeat the request. For issue requests, the outcome arrives by notification: contact support before you resend. The DUA-e has no cancellation, so you must confirm that SEFAZ/ES created nothing before a new issue request.

Confirmation and Batch Payment Codes

A summary of the stable codes in the error responses of Confirm a calculation (fields error and codigo) and Batch payment (fields codigo_erro and mensagem). The full messages are in the linked sections.

CodeHTTPWhere
apuracao_ja_confirmada, apuracao_nao_confirmavel, apuracao_expirada, apuracao_substituida409Confirm a calculation
guia_prevista_invalida, selecao_obrigatoria, selecao_ambigua422Confirm a calculation
exportacao_indisponivel403Prepare an export
emissao_em_andamento409Prepare an export
exportacao_em_andamento, exportacao_falhou409Download the file
selecao_invalida404 (selection does not exist or belongs to another company)Prepare an export
dados_invalidos, selecao_invalida, banco_nao_habilitado, banco_nao_suportado, limite_exportacao, nenhuma_guia_elegivel422Prepare an export and Banks and restrictions
exportacao_falhou, exportacao_expirada200 (field codigo_erro)Get an export
exportacao_expirada410Download the file
banco_nao_arrecadador and the other exclusion codesno HTTP errorExport exclusions
exportacao_nao_encontrada404Send the bank return file
retorno_nao_encontrado404Get a bank return
exportacao_nao_concluida409Send the bank return file
arquivo_muito_grande413Send the bank return file
arquivo_invalido, retorno_nao_e_retorno, banco_divergente, pagador_divergente, cursor_invalido422Send the bank return file and Get a bank return
leiaute_bancario_alterado422 when sending; 200 (field codigo_erro) when gettingSend the bank return file and Get a bank return
retorno_expirado410Get a bank return
retorno_falhou, dependencia_indisponivel503Send the bank return file and Get a bank return

Infrastructure

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

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

Global anycast

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

Two AWS locations

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

Static IPs

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

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

Request limits

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

GET 15per second

Reading: lookups and lists.

POST No limit

Creating: issuing and other submissions.

PUT / DELETE 5per second

Changing and removing resources.

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

When the limit is exceeded

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

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

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

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

How to handle HTTP 429

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

Best practices

Use the notification URL

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

Send through a queue

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

Send valid credentials

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

Allow your server IP

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

Changelog

  1. v1.1.1 · November 17, 2026 · Documentation · Changed · Beta

    Right after the introduction, the documentation now shows a notice that the API is in beta, with a link to the Changelog.

    Changed section: introducao

  2. v1.1.0 · November 12, 2026 · Documentation · Added · Beta

    Payment slip calculation (apuração de guias) now brings together the parameters per state and per invoice, pending items, refusals, certified coverage and batch payment. Single issuing is still available.

    Changed sections: emissao-por-lote, apuracao-pendencias, pagamento-lote

  3. v1.0.2 · November 9, 2026 · Documentation · Added

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

Solutions

Fiscal IssuerFiscal MonitorTax ReconciliationArtificial Intelligence

Industries

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

Brazil tax guide

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

Company

AboutCustomersContactBook a demoPolicies and termsTrust Center

Developers

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

Offices

United States

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

São Paulo, Brazil

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

Curitiba, Brazil

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

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

Talk to our team

Quick access

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

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

Region and language

Brazil

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