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 →
  • NF-e REST API
  • Quick guide
    • Which invoice to issue
    • NF-e lifecycle
    • How to send the taxes
  • SDKs & LLMs
    • LLM-ready
    • Webmania SDKs
    • Modules
    • Examples
  • Authentication
  • Notifications
    • Notification fields
    • Notification example
  • Issuing an invoice
    • Invoice information
      • Dates
      • Referenced invoice
      • Commands
    • Customer information
      • Foreign customer
    • Product information
      • Export
      • Import
      • Traceability
      • Referenced tax document
      • Fuels
      • Medicines
      • Firearms
      • New vehicles
      • Basic food basket
    • Order information
      • Payment
      • Linked payments
    • Transport
      • Carrier
      • Trailer
      • Delivery location
      • Pickup location
    • Billing
    • Installments
    • Export
    • Agriculture and livestock
    • Government purchase
  • Tax Class
    • Create/edit product taxes
      • Scenarios
      • ICMS
      • MVA rate
      • ICMS rate
      • ICMS-ST rate
      • FCP rate
      • FCP-ST rate
      • Tax benefit
      • Presumed credit
      • IPI
      • PIS
      • COFINS
      • ISSQN
      • IBS/CBS
    • Create/edit service taxes
      • IBS/CBS
      • Abrasf
      • Cecam
      • DSF
      • Florianópolis
      • Governa
      • IMA
      • Osasco
      • National standard
      • SIGISS
    • Create/edit communication taxes
      • ICMS
      • PIS/COFINS
      • FUST/FUNTTEL
    • List
    • Delete
  • Taxes in the API
    • ICMS
      • Simples Nacional
      • Standard taxation
      • MVA
      • Fixed reference price
      • Transaction value
      • Presumed credit
    • IPI
    • PIS
    • COFINS
    • ISSQN
    • Tax withholding
    • Import
    • Tax calculation
  • Tax reform
    • IBS/CBS
    • IBS/CBS — Simples Nacional
    • State IBS
    • City IBS
    • CBS
    • CBS zero rate — ZFM/ALC
    • Single-phase taxation
    • Presumed credit
    • Credit transfer
    • Period adjustment
    • Credit reversal
  • Invoice types
    • Return/reversal
    • Adjustment
    • Complementary
      • Price and/or quantity
      • Complementary tax
      • Addition document
    • Credit
    • Debit
  • Events
    • Correction letter (CC-e)
    • Recipient acknowledgment (MDe)
    • IBS/CBS events
      • 110300 - Payment link
      • 112110 - Full payment
      • 112120 - ALC/ZFM import
      • 112130 - Goods lost (supplier)
      • 112140 - Supply not made
      • 112150 - Delivery date
      • 211110 - Presumed credit
      • 211124 - Goods lost (buyer)
      • 211128 - Debit acceptance
      • 211130 - Fixed asset
      • 211140 - Fuel credit
      • 211150 - Credit by activity
      • Cancellation
    • Financial reconciliation (ECONF)
  • Functions
    • Download XML and PDF
      • Access credentials
      • Token
    • SEFAZ status
    • A1 certificate expiry
    • Look up an invoice
    • Cancel an invoice
    • Void invoice numbers
    • Export reports
  • Update company
  • Contingency mode
    • Invoices in processing
  • Infrastructure
  • Request limits
  • Changelog
⚡ Follow in real time (in Portuguese): Status | SEFAZ Monitor | City Hall Monitor

Last updated: November 30, 2026 · v3.2.0

Region and language

Brazil

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

Electronic Invoice (NF-e) REST API

Issue invoices for goods (NF-e and NFC-e) and register their events (CC-e and MDe)

NF-e issued in just 2 seconds NF-e issued in just 2 seconds

The Webmania® REST API issues the NF-e (the electronic invoice for goods) and the NFC-e (the consumer receipt) with SEFAZ, the state tax authority. It generates the XML and the DANFE (the printed invoice summary), sends the result by notification and registers events such as the correction letter (CC-e) and the recipient acknowledgment (MDe). To start, read the Quick guide. To issue other document types, see all the APIs.

What are the NF-e and the NFC-e? They are the two models of invoice for goods that this API issues. Both use the same issuing endpoint, and the modelo parameter tells them apart. In the parameter tables, the NF-e and NFC-e columns show what applies to each one:

NF-e (model 55)

The electronic invoice (Nota Fiscal Eletrônica) records outgoing and incoming transactions, including exports and imports. It is the default model: send modelo = 1 or leave the parameter out. After authorization, Webmania generates the XML, the DANFE and two more versions: Simplified DANFE and Simplified DANFE - Label.

NFC-e (model 65)

The consumer receipt (Nota Fiscal do Consumidor Eletrônica) records a sale to a consumer. Send modelo = 2. When SEFAZ is down, the NFC-e is issued in offline contingency mode (a backup procedure), with the DANFE to hand to the consumer right away.

Brazilian tax terms you will see. Taxes and tax codes keep their Brazilian names in the JSON and on the invoice. In short, what each one is and where it goes:

CFOP (transaction code)

CFOP: the 4-digit code that says what kind of transaction each item is. First digit 5, 6 or 7 = outgoing inside the state, to another state or abroad (1, 2, 3 = incoming); 5102 = a sale inside the state. Goes in produtos[].impostos.icms.codigo_cfop or in the Tax Class.

NCM (product code)

NCM: the 8-digit product classification code of Mercosur, based on the international HS code. Required for every product; it sets the IPI rate and is used by many ICMS rules. Goes in produtos[].ncm.

CEST

CEST: the 7-digit code required on items of goods listed for ICMS tax substitution (ICMS-ST); it is linked to the NCM. Goes in produtos[].cest.

Origem (origin)

Origem: the 1-digit origin code of the goods, part of the ICMS group of each item. 0 = national goods; the other values identify imported goods or goods with imported content. Goes in produtos[].origem.

CST and CSOSN

CST: a code per tax (ICMS, IPI, PIS, COFINS, IBS/CBS) on each item that tells the tax authority how the tax applies: taxed, exempt, deferred, tax substitution… Simples Nacional companies use the 3-digit CSOSN (such as 101 or 102) instead of the ICMS CST. Goes in situacao_tributaria of each tax group.

cClassTrib

cClassTrib: the new code of the tax reform on each item that, together with the IBS/CBS CST, says how IBS and CBS apply (standard rate, reduced rate, exemption…). Goes in produtos[].impostos.ibs_cbs.classificacao_tributaria.

ICMS (state sales tax)

ICMS: the state tax on goods, transport and communication; each state sets its own rates and rules. Calculated on each item (tax base × rate), and the buyer can usually take it as a credit. Goes in produtos[].impostos.icms or comes from the Tax Class.

ICMS-ST, DIFAL and FCP

ICMS-ST (tax substitution): for goods listed by the states, one company in the chain, usually the manufacturer or importer, collects in advance the ICMS of the next sales.
DIFAL: on a sale to a final consumer in another state, the destination state receives the difference between its ICMS rate and the interstate rate.
FCP: a small extra ICMS percentage some states charge on certain goods, collected with the ICMS.

IPI

IPI: the federal tax on manufactured and imported goods, charged by manufacturers and importers. Its rate depends on the NCM of the product. Goes in produtos[].impostos.ipi.

PIS and COFINS

PIS and COFINS: federal contributions on the revenue of the company, shown on each item, each with its own CST. The CBS replaces them from 2027. Go in produtos[].impostos.pis and produtos[].impostos.cofins.

IBS, CBS and IS (tax reform)

CBS: the new federal value-added tax, which replaces PIS and COFINS from 2027. IBS: the new value-added tax shared by states and cities, which replaces ICMS and ISS gradually until 2033. Both are calculated on each item, shown separately from the price, and the buyer takes the tax paid on purchases as a credit; they go in produtos[].impostos.ibs_cbs. IS (Imposto Seletivo): the new federal tax on goods harmful to health or the environment, such as tobacco and alcoholic drinks.

These and the other Brazilian terms of the invoice, such as SEFAZ, CNPJ, IE and DANFE, are explained in the glossary of Brazilian tax terms.

Webmania® Taxes
Tax rules kept in sync with the state tax authorities (SEFAZ) for automatic calculations and rates, covering every federal and state tax.
Availability and security
High availability, scalability and redundant servers at the highest PCI DSS security level, on Amazon Web Services, the global leader in cloud computing.
Storage
Secure, encrypted and unlimited storage of your invoices on Amazon S3, which guarantees 99.999999999% durability of the XML files.
REST API integration
Works with every programming language through JSON. Low latency, with more than 200 points of presence on the Amazon Web Services network.
Invoice contingency
Keep issuing invoices when SEFAZ is offline: Webmania switches to contingency mode automatically. Offline issuing for the NFC-e, and the SEFAZ backup servers (SVC/SVRS) for the NF-e.
Automatic numbering
Issue invoices at the same time from the API, a point of sale, an online store and the Webmania® Panel. All the numbering is managed and audited automatically.
DANFE and email delivery
Automatic DANFE that works with all common and thermal printers, and secure delivery of the invoice by email.
Expert support
Our support team, the Weblovers, are experts in accounting and programming and are here to help you.

Quick guide

Send every API request over HTTPS to the base URL https://webmania.com.br/api/. The /1/ prefix means that this is version 1.0 of the API.

URL HTTP Verb Function
/1/nfe/emissao/ POST Issue an invoice
/1/nfe/devolucao/ POST Issue a return/reversal invoice
/1/nfe/ajuste/ POST Issue an adjustment invoice
/1/nfe/complementar/ POST Issue a complementary invoice
/1/nfe/cartacorrecao/ POST Issue a correction letter (CC-e)
/1/nfe/manifesta/ POST Recipient acknowledgment (MDe)
/1/nfe/evento-ibs-cbs/ POST IBS/CBS events
/1/nfe/conciliacao/ POST Financial reconciliation (ECONF)
/1/nfe/classe-imposto/ POST Create/edit a Tax Class
/1/nfe/empresa/ POST Update company
/1/nfe/relatorios/ POST Export CSV, XML and DANFE reports
/1/nfe/consulta/ GET Look up an invoice
/1/nfe/sefaz/ GET SEFAZ status
/1/nfe/certificado/ GET A1 certificate expiry
/1/nfe/classe-imposto/ GET List Tax Classes
/1/nfe/cancelar/ PUT Cancel an invoice
/1/nfe/inutilizar/ PUT Void invoice numbers
/1/nfe/evento-ibs-cbs/cancelar/ PUT Cancel an IBS/CBS event
/1/nfe/conciliacao/cancelar/ PUT Cancel a financial reconciliation
/1/nfe/classe-imposto/ DELETE Delete a Tax Class

Responses are in JSON; depending on the operation, they can be objects or lists. In every call, send the four access credentials of the company in the headers X-Consumer-Key, X-Consumer-Secret, X-Access-Token and X-Access-Token-Secret, and send Content-Type: application/json in calls with a body; see Authentication.

An HTTP 2xx status alone does not confirm that the operation succeeded or that the invoice was authorized. Validation errors can return HTTP 200 with the error field: always check the response body and, in tax operations, the status of the document or the event. If the Access Token or the Access Token Secret does not match, the API returns HTTP 401 (the message means “Access Token and Access Token Secret do not match”):

{
  "error": "Access Token e Access Token Secret não conferem."
}

How to integrate the NF-e:

  1. Send the credentials The four access credentials of the company go in the headers of every call.
  2. Set up the companyif needed Company data, series and numbering in /1/nfe/empresa/, and the A1 digital certificate (the file that signs each invoice) in the certificado parameter, in Base64. You can also set them up in the Webmania® Panel.
  3. Define the taxes For each product, send the saved classe_imposto (Tax Class) or the impostos object.
  4. Issue in the sandbox POST to /1/nfe/emissao/, with ambiente = 2 for tests in the sandbox (homologação). The response has the uuid of the invoice; save it in your system.
  5. Receive the result Webmania sends each status change of the invoice to your url_notificacao.
  6. Deliver the DANFE and store the XML When the invoice is aprovado, use the danfe and xml URLs of the response or of the notification.
  7. Look up the invoiceif needed By uuid, chave (access key) or ID, to check the status at any time.
  8. Cancel, correct or voidif needed Cancel the authorized invoice, register a correction letter (NF-e only) or void a range of invoice numbers.

Quick guide
Which invoice to issue

The normal NF-e records day-to-day transactions. To return, adjust or supplement an invoice, or to record a credit or a debit, use the invoice type made for each case:

SituationInvoice to issueHow to issue
Sale, purchase or other outgoing or incoming transactionNormal NF-e or NFC-ePOST /1/nfe/emissao/ with finalidade = 1
Return goods, or cancel the tax effects of an invoice issued beforeReturn/reversalPOST /1/nfe/devolucao/ with the chave or the uuid of the original invoice, which is referenced automatically; or POST /1/nfe/emissao/ with finalidade = 4
Accounting entries with no goods going out or coming in, such as an ICMS transfer, reimbursement or refund, for companies on the actual or presumed profit regime (Lucro Real or Lucro Presumido)AdjustmentPOST /1/nfe/ajuste/
Add price, quantity or taxes that were missing from the original invoiceComplementaryPOST /1/nfe/complementar/ with the chave or the uuid of the referenced invoice
Reduce amounts or record a credit linked to an NF-e already issued (IBS/CBS, the new taxes of the tax reform)CreditPOST /1/nfe/emissao/ with finalidade = 5 and tipo_credito
Create or settle an IBS/CBS debit, such as fines and interest, an advance payment or an inventory lossDebitPOST /1/nfe/emissao/ with finalidade = 6 and tipo_debito
Correct or cancel without issuing another invoice. To correct data on an NF-e that does not change amounts, sender, recipient, dates, series or number, register a correction letter; the NFC-e does not accept correction letters. To cancel an authorized invoice before the goods leave and within the deadline, cancel the invoice. After the deadline, or after the goods have moved, issue a return invoice.

Quick guide
NF-e lifecycle

Every invoice gets a uuid as soon as the API accepts the request. From then on, it goes through the statuses below, which appear in the response, in the lookup and in the notifications. The statuses are the same for the NF-e and the NFC-e:

Lifecycle of the NF-e and the NFC-e When it receives a POST /1/nfe/emissao/ request, Webmania generates the uuid of the invoice and sends the invoice to SEFAZ (the state tax authority). Until SEFAZ returns the result, the invoice stays in processamento and Webmania checks SEFAZ automatically. When SEFAZ is unavailable, the invoice stays in contingencia and Webmania resends it automatically. The result is aprovado, with the XML and the DANFE; reprovado, with the reason for the rejection; or denegado, when SEFAZ denies the use of the invoice. An approved invoice can be canceled with PUT /1/nfe/cancelar/ and becomes cancelado. If it is an NF-e, it can also receive a correction letter with POST /1/nfe/cartacorrecao/; the NFC-e does not accept correction letters. POST /1/nfe/emissao/ Processing processamento SEFAZ has not answered yet In contingency contingencia SEFAZ unavailable Authorized aprovado XML and DANFE available Rejected reprovado read the reason and fix it Use denied denegado SEFAZ denied its use Canceled cancelado PUT /1/nfe/cancelar/ Correction letter NF-e only · modelo = cce POST /1/nfe/cartacorrecao/ automatic resend
After authorization Authorized Waiting for the result: not a final status Rejected or denied Automatic retry
NF-e and NFC-e are handled differently when SEFAZ is unavailable: see Contingency. While the status is processamento or contingencia, follow the invoice through the lookup or the notification, without issuing it again.
StatusWhat it meansWhat to do
processamentoSEFAZ has not given the result of the invoice yet. Webmania checks SEFAZ automatically.Wait for the notification, or look up the invoice before you ship the product. Do not issue it again.
contingenciaSEFAZ is unavailable and the invoice was issued in contingency mode; it has not been sent to SEFAZ yet. Webmania sends it automatically.Follow the same uuid, without issuing again. See Contingency.
aprovadoSEFAZ authorized the invoice; the XML and the DANFE are available.Deliver the DANFE and store the XML. If needed, register a correction letter (NF-e only) or cancel the invoice.
reprovadoSEFAZ rejected the invoice; motivo has the response.Fix the data shown in motivo and issue a new invoice.
denegadoSEFAZ denied the use of the invoice; motivo has the response.Solve the problem shown in motivo before you issue a new invoice.
processando_cancelamentoCancellation waiting for confirmation from SEFAZ.The status is updated automatically when SEFAZ responds. Do not resend the cancellation.
canceladoSEFAZ approved the cancellation.Store the xml_cancelamento. Do not use this invoice in the transaction.

Quick guide
How to send the taxes

Each item of produtos needs its taxes, sent in one of these ways; at least one is required:

Tax Class

Save the rules of the item's state, federal and city taxes (ICMS, IPI, PIS, COFINS and ISS) once, at /1/nfe/classe-imposto/, and send the reference in produtos[].classe_imposto. Webmania calculates the taxes automatically. See Tax Class.

Taxes in the request

Send the groups of each tax in the produtos[].impostos object. Recommended for specific operations, such as ICMS-ST (tax substitution), for operations the Tax Class does not cover, or when you need more flexibility. See Taxes in the API.

What to sendWhereSee
ICMS, IPI, PIS, COFINS, ISSQN and Importprodutos[].impostosTaxes in the API
IBS and CBSprodutos[].impostos.ibs_cbsTax reform
Tax withholdingimpostos.retencao_tributos, at the root of the JSONTax withholding
Tax totals before issuingcalculo_impostosTax calculation

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

Modules

Official modules to issue invoices in one click from your online store, with no coding.

  • WooCommerce Official Webmania® module. Download
  • PrestaShop Official Webmania® module. Download
  • Magento Official Webmania® module. Download
  • OpenCart Official Webmania® module. Download

Examples

Test the 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

Authentication uses HTTP headers. In every request, send the four access credentials of the company: X-Consumer-Key, X-Consumer-Secret, X-Access-Token and X-Access-Token-Secret.

X-Consumer-Key: YOUR_CONSUMER_KEY
X-Consumer-Secret: YOUR_CONSUMER_SECRET
X-Access-Token: YOUR_ACCESS_TOKEN
X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET

In requests with a body, send JSON with the Content-Type header set to application/json.

Keep your access credentials safe. Never publish the credentials in the source code of a website, app or system where other people can easily read them.

For mobile apps (iOS and Android), we recommend issuing from your server (back end). The app code should only send the issuing request; the processing should happen on your server.

Notifications

To keep your platform up to date, Webmania® sends automatic notifications at every status change of the invoice, up to the final result. With them, you do not need to poll the API for each invoice: wait for the webhook and update the invoice in your system when it arrives.

The notification is sent by POST, as application/x-www-form-urlencoded, to the URL sent in url_notificacao when issuing. Without this parameter, it goes to the notification URL saved in the company settings.

Notified statusWhen it is sent
aprovadoSEFAZ authorized the invoice; the body has the chave, the xml and the danfe.
reprovadoSEFAZ rejected the invoice; the body has the motivo (reason).
denegadoSEFAZ denied the use of the invoice; the body has the motivo (reason).
canceladoSEFAZ approved the cancellation; the body has the log_cancelamento.

The correction letter is notified too, in the same format, with the body of the CC-e response and modelo = cce.

When there is no notification. The notification you can count on is the one with the final result. The processamento and contingencia statuses are not final and may not be notified: in these cases, do not issue the invoice again; wait for the next notification or check the result with the lookup. Without url_notificacao in the request and without a URL saved in the company settings, no notification is sent. A local URL, such as localhost or 127.0.0.1, does not receive notifications.

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

It is created as soon as our API accepts the request, that is, after our validations and before anything is sent to SEFAZ. So the UUID exists whatever the status of the invoice at SEFAZ: it applies to processamento, aprovado, reprovado, denegado, cancelado and contingencia.

Once created, the UUID is final: it does not change on retries, contingency mode (including EPEC, a contingency mode that registers a summary of the invoice in advance) or resends. The access key is a different field and it can change, for example when the invoice is issued in contingency mode. That is why the UUID, not the access key, should be your reference in your database.

Notifications
Notification fields

The notification body has the fields below. Conditional fields can be missing:

Parameter Type Description
uuid string Unique ID of the invoiceUse the UUID to find the invoice the notification is about.
status string Status of the invoice. See the lifecycle.
aprovado
reprovado
cancelado
denegado
processamento
contingencia
motivo string Reason for the status, as SEFAZ returns it
E.g.: Autorizado o uso da NF-e (use of the NF-e authorized)
nfe string Invoice number
Managed automatically by the issuing system.
serie string Invoice series
recibo string Receipt number, handled as text
- Returned when the status is aprovado and a receipt was registered.
- NF-e: no receipt is issued in the states PE, MG, MT, GO, AC, AL, AP, DF, ES, PB, PI, RJ, RN, RO, RR, SC, SE, TO and PA.
- NFC-e: no receipt is issued in any state.
- processamento: no receipt is issued when processing is synchronous.
chave string Access key that identifies the invoice at SEFAZ (44 characters; keep the value as text)
modelo string Invoice model
nfe
nfce
nfse
cce
epec boolean Issued through EPEC (contingency mode)
What is EPEC? (in Portuguese)
xml string URL of the invoice XML
danfe string URL of the invoice DANFE (printed invoice summary)
log string SEFAZ response log, serialized as JSON; can be empty
data string Issuing data, normalized and filtered, serialized as JSON; can be empty
log_cancelamento string Cancellation log serialized as JSON; present when a cancellation log was registered

Notifications
Notification example

The notification is sent with the POST method, in the application/x-www-form-urlencoded format. The structured fields are JSON strings: after you read the form, decode log, data and log_cancelamento when they are present and not empty.

-X POST \
-header "Content-Type: application/x-www-form-urlencoded" \

Example of the fields received for an approved invoice (this is not a JSON body; conditional fields can be missing):

["uuid"] = "43eace5c-8008-4f6c-b830-b6d52d7ff90c",
["status"] = "aprovado",
["motivo"] = "Autorizado o uso da NF-e",
["nfe"] = "25000",
["serie"] = "1",
["recibo"] = "000000000000000",
["chave"] = "00000000000000000000000000000000000000000000",
["modelo"] = "nfe",
["epec"] = false,
["xml"] = "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/",
["danfe"] = "http://nfe.seudominio.com.br/danfe/[chave|uuid]/",
["log"] = "[...]",
["data"] = "[...]",
["log_cancelamento"] = "[...]"

Issuing an invoice

Issuing sends the NF-e or the NFC-e to SEFAZ (the state tax authority) and, when the invoice is authorized, generates the XML and the DANFE. One request issues one invoice. The modelo parameter chooses between NF-e and NFC-e, and finalidade says whether the invoice is normal, an adjustment, a return, a credit or a debit (see Which invoice to issue).

To issue an invoice, send a POST request to the URL /1/nfe/emissao/.

How to build the request: the body is a JSON object with the groups below.

  1. Send the invoice data operacao, natureza_operacao, modelo, finalidade, ambiente (2 for tests in the sandbox, homologação) and, if you want, your own control ID and the url_notificacao.
  2. Identify the customer In the cliente object, with the CPF (individual taxpayer ID) or the CNPJ (company ID), the name or legal name, and the address. On the NFC-e, the customer is optional.
  3. List the products In produtos, with the data of each item and its taxes: classe_imposto or impostos.
  4. Send the order In the pedido object, with the payment, the buyer presence, the freight and the total.
  5. Send the transportif needed Carrier, trailer, and delivery or pickup locations, when there are any.
  6. Add the transaction groupsif needed Billing, installments, export, agriculture and livestock, and government purchase, when the transaction requires them.

Request example:

  curl -X POST \
  -H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
  -H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
  -H "X-Access-Token: YOUR_ACCESS_TOKEN" \
  -H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "ID":1337,
    "modelo":"1",
    "natureza_operacao":"Venda de produção do estabelecimento", 
    ...
  }' \
  https://webmania.com.br/api/1/nfe/emissao/

Example body of a sale to an individual, for illustration only. Replace the CPF, the CEP (postal code), the URL and the Tax Class with valid data of your integration; the example values are not a request ready to send:

{
  "ID": 1137,
  "url_notificacao": "http://meudominio.com/retorno.php",
  "operacao": 1,
  "natureza_operacao": "Venda de produção do estabelecimento",
  "modelo": 1,
  "finalidade": 1,
  "ambiente": 1,
  "cliente": {
    "cpf": "000.000.000-00",
    "nome_completo": "Nome do Cliente",
    "endereco": "Av. Brg. Faria Lima",
    "complemento": "Escritório",
    "numero": "1000",
    "bairro": "Itaim Bibi",
    "cidade": "São Paulo",
    "uf": "SP",
    "cep": "00000-000",
    "telefone": "(00) 0000-0000",
    "email": "nome@email.com"
  },
  "produtos": [
  {
    "nome": "Nome do produto",
    "codigo": "nome-do-produto",
    "ncm": "6109.10.00",
    "cest": "28.038.00",
    "quantidade": 3,
    "unidade": "UN",
    "peso": "0.800",
    "origem": 0,
    "subtotal": "44.90",
    "total": "134.70",
    "classe_imposto": "REF1000"
  },
  {
    "nome": "Nome do produto",
    "codigo": "nome-do-produto",
    "ncm": "6109.10.00",
    "cest": "28.038.00",
    "quantidade": "1",
    "unidade": "UN",
    "peso": "0.200",
    "origem": 0,
    "subtotal": "29.90",
    "total": "29.90",
    "classe_imposto": "REF1000"
  }
  ],
  "pedido": {
    "pagamento": 0,
    "presenca": 2,
    "modalidade_frete": 0,
    "frete": "12.56",
    "desconto": "10.00",
    "total": "174.60"
  }
}

Example of an HTTP 200 response for an approved invoice. The fields present depend on the result: validation failures return error, and processing responses can be shorter. uuid, status, motivo, nfe and serie identify the result when they are available. recibo comes only with an approval that has a registered receipt; xml and danfe are not returned for an NF-e in processing or in contingency mode. Keep chave as text; log holds structured data, not a JSON string. perfil_fabricacao_declarado appears only when the profile was declared explicitly per item when issuing (the perfil_fabricacao field sent in the product, in produtos[].perfil_fabricacao or produtos[].impostos.icms.perfil_fabricacao):

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique ID
  "status": "aprovado", // aprovado, reprovado, cancelado, denegado, processamento or contingencia
  "motivo": "Autorizado o uso da NF-e", // Reason for the status
  "nfe": "25000", // NF-e number
  "serie": "1", // Series number
  "modelo": "nfe", // Model issued by this endpoint: nfe or nfce
  "epec": false, // Issued through EPEC
  "recibo": "000000000000000", // Receipt number
  "chave": "00000000000000000000000000000000000000000000", // Access key number
  "xml": "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/",
  "danfe": "http://nfe.seudominio.com.br/danfe/[chave|uuid]/",
  "danfe_simples": "http://nfe.seudominio.com.br/danfe/simples/[chave|uuid]/", // Simplified DANFE
  "danfe_etiqueta": "http://nfe.seudominio.com.br/danfe/etiqueta/[chave|uuid]/", // Simplified DANFE - Label
  "log": {}, // SEFAZ response object; it can also be an array, even an empty one
  "perfil_fabricacao_declarado": [ // Neutral audit data: profiles declared per item (only when the client sent the field explicitly)
    {
      "item": 1,
      "perfil_fabricacao": "industrial"
    }
  ]
}

When you send the url_notificacao, the result also arrives by notification. The meaning of each status is in the NF-e lifecycle.

Issuing an invoice
Invoice information

The fields at the root of the JSON define the invoice: transaction type, model, purpose and environment. They work for outgoing, incoming, export and import invoices.

Fill in the fields for the purpose of the invoice. Some parameters have more details: click the name to open them.

Parameter NF-e NFC-e Type Size Description
ID
string 1-15 Purchase order number or processing ID
Tracks issuing requests by order or by processing ID. Learn more (in Portuguese)
operacao
integer 1 Transaction type of the invoice
1 - Outgoing
0 - Incoming
natureza_operacao
string 1-60 Nature of the transaction (a short text that describes it)
modelo
integer
string
1-4 Invoice model. Default: 1 (NF-e).
1 or nfe - NF-e
2 or nfce - NFC-e
finalidade
integer 1 Purpose of the invoice. Adjustment and Complementary invoices have their own issuing endpoints.
1 - Normal NF-e
3 - Adjustment/Reversal
4 - Return
5 - Credit
6 - Debit
ambiente
integer 1 SEFAZ environment
1 - Production
2 - Sandbox (homologação)
tipo_credito
Required when finalidade = 5 (Credit)
integer 1 Credit note type, required only for finalidade = 5. Type 2 is accepted only from 2029. Type 6 depends on technical note NT 2025.002 v1.36 being in force for the environment and issue date.
1 - Fines and interest
2 - Use of the presumed IBS credit on the balance due in the Manaus Free Trade Zone (ZFM) (art. 450, § 1º, LC 214/25)
3 - Return after a full refusal at delivery, or because the recipient was not found at the delivery attempt
4 - Reduction of values
5 - Credit transfer in a business succession
6 - Return after a partial refusal at delivery
tipo_debito
Required when finalidade = 6 (Debit)
integer 1 Debit note type, required only for finalidade = 6.
1 - Credit transfer to cooperatives
2 - Credit reversal for immune or exempt outgoing transactions
3 - Debits from invoices not processed in the tax assessment
4 - Fines and interest
5 - Credit transfer in a business succession
6 - Advance payment
7 - Inventory loss (spoilage, loss, theft, robbery)
8 - Removal from the Simples Nacional (SN) regime
url_notificacao
string --- Notification URL for every status update of the invoice
cliente
object --- Customer information
produtos
array (objects) 1-500 Information on all products purchased. The API accepts at most 500 items per request
pedido
object --- Order information
transporte
object --- Transport information
fatura
object --- Billing information for the invoice
parcelas
array (objects) 0-120 Installments of the invoice
impostos
object --- Invoice taxes sent at the root of the JSON. It currently accepts only the retencao_tributos object (tax withholding).
Do not confuse it with the impostos parameter of each product, which sets ICMS, IPI, PIS, COFINS, ISSQN and IBS/CBS for the item.
exportacao
object --- Export information
agropecuarioNEW
object --- Agriculture and livestock information, when technical note NT 2024.003 is in force for the environment and issue date
compra_governamentalNEW
object --- Group for government purchase transactions. Valid only for NF-e model 55.
See the Government purchase section.
inscricao_suframa
string 8-9 SUFRAMA registration of the issuer (ISUF tag). If you omit it, the API uses the company registration on file.
Used in transactions with the zero CBS rate benefit in the ZFM/ALC, the Manaus Free Trade Zone and Free Trade Areas (see CBS zero rate — ZFM/ALC).
codigo_indicador_operacao
string 6 Code that indicates where the transaction takes place (cIndOp tag in the XML).
Not allowed in the NFC-e. Only 010104 and 010105 are accepted today. The API silently drops any other value, because the field is optional.

Send the invoice dates if you need them. The API fills in the values automatically, but you can change them as needed:

Dates
Parameter NF-e NFC-e Type Size Description
data_emissao
string 19 Issue date and time.
Format:
YYYY-MM-DD HH:MM:SS
data_entrada_saida
string 19 Date and time of entry or exit, when it differs from the issue date.
Format:
YYYY-MM-DD HH:MM:SS
data_previsao_entrega
string 10 Expected date of delivery, or of availability of the goods. It cannot be earlier than the entry/exit date (or the issue date), and it cannot be more than 90 days after that date.
Format: YYYY-MM-DD. The API adds it to the XML only for a normal NF-e or a return, and only when the freight mode is not 1, 4 or 9.
data_servico
string 10 Date the service was provided, in transactions with ISSQN (city service tax)
Format:
YYYY-MM-DD
{
  "operacao": 1,
  "natureza_operacao": "Venda de produção do estabelecimento",
  "modelo": 1,
  "finalidade": 1,
  "ambiente": 1,
  "data_emissao": "2026-10-01 10:00:00", // Example: use a valid date for the transaction
  "data_entrada_saida": "2026-10-01 10:30:00",
  "cliente": { ... },
  "produtos": [ ... ],
  "pedido": { ... }
}

To reference an invoice issued earlier, send the 44-digit NF-e access key. To reference a rural producer invoice (NF de Produtor Rural), send all the required parameters.

Referenced Invoice
Parameter NF-e NFC-e Type Size Description
nfe_referenciada
string
array
44 Access key of a document issued earlier, as a 44-character string or an array of strings.
Required for credit (finalidade 5), except type 6, which needs a reference per item. For credit types 3 and 4, the state (UF) in the key must be the issuer's state. Credit type 3 also accepts an NFC-e key. For a return, send this key in the header or produtos[].dfe_referenciado in each product, never both. From November 16, 2026 in production (November 9, 2026 in the sandbox), the header accepts a single document. For credit type 6, do not send this reference at the root: use produtos[].dfe_referenciado, as the section for that transaction explains.
cte_referenciada
string
array
44 Access key of the referenced CT-e (freight bill).
You can send more than one referenced CT-e in an array.
ecf_referenciada
array (objects) --- Tax receipt (Cupom Fiscal) printed by a fiscal printer (ECF)
nf_rural_referenciada
object
array (objects)
--- Rural producer invoice information
{
  "operacao": 1,
  "natureza_operacao": "Venda de produção do estabelecimento",
  "modelo": 1,
  "finalidade": 1,
  "ambiente": 1,
  "nfe_referenciada": [
    "00000000000000000000000000000000000000000000",
    "00000000000000000000000000000000000000000000"
  ],
  "cliente": { ... },
  "produtos": [ ... ],
  "pedido": { ... }
}
Referenced tax receipt (Cupom Fiscal, ECF)
Parameter NF-e NFC-e Type Size Description
modelo
string 2 Tax document model
2B = Cupom Fiscal issued by a cash register (not an ECF)
2C = Cupom Fiscal from a point of sale (PDV)
2D = Cupom Fiscal (issued by an ECF)
n_ecf
integer 1-3 Sequential number of the ECF
Send the sequential number of the ECF that issued the Cupom Fiscal linked to the NF-e
n_coo
integer 1-6 Operation Order Counter number (COO)
Send the Operation Order Counter number (COO) linked to the NF-e
{
"operacao": 1,
"natureza_operacao": "Venda de produção do estabelecimento",
"modelo": 1,
"finalidade": 1,
"ambiente": 1,
"ecf_referenciada": [
  {
    "modelo": "2D",
    "n_ecf": 123,
    "n_coo": 123456
  }
],
"cliente": { ... },
"produtos": [ ... ],
"pedido": { ... }
}
Referenced rural producer invoice
Parameter NF-e NFC-e Type Size Description
uf
string 2 State of the rural producer
XX
data
string 10 Issue date of the producer invoice
Format:
YYYY-MM-DD
cpf
string 11 CPF (individual taxpayer ID) of the issuer, required when you do not send the CNPJ. Send a valid 11-digit CPF; punctuation is accepted.
000.000.000-00 (illustrative format)
cnpj
string 14 CNPJ (company ID) of the issuer, required when you do not send the CPF. Send a valid CNPJ; punctuation is accepted.
00.000.000/0000-00 (illustrative format)
ie
string 2-14 Required in every rural reference.
State registration (IE) of the issuer, with 2 to 14 digits; punctuation is removed.
If the issuer has no registration, send ISENTO (exempt) explicitly. The field cannot be empty.
More information: sintegra.gov.br (in Portuguese)
modelo
string 2 Tax document model
04 = Producer invoice (NF de Produtor)
01 = Invoice (NF)
serie
integer / string 1-3 Series of the tax document, from 0 to 999. Send 0 when there is no series. Leading zeros are normalized.
numero
integer 1-9 Tax document number

Illustrative example: replace the CNPJ and the state registration with the valid data of the referenced invoice. The values below are not valid test documents.

{
  "operacao": 1,
  "natureza_operacao": "Venda de produção do estabelecimento",
  "modelo": 1,
  "finalidade": 1,
  "ambiente": 1,
  "nf_rural_referenciada": [
    {
      "uf": "PR",
      "data": "2020-01-12",
      "cnpj": "00.000.000/0000-00",
      "ie": "000000",
      "modelo": "04",
      "serie": "1",
      "numero": "100"
    }
  ],
  "cliente": { ... },
  "produtos": [ ... ],
  "pedido": { ... }
}

Commands trigger features that can help your ERP and financial system. For example: get the tax calculation before the customer pays, get a preview of the DANFE (printed invoice summary), and issue invoices at large scale.

Commands
Parameter NF-e NFC-e Type Size Description
calculo_impostos
boolean --- Returns the invoice totals before the invoice is issued
previa_danfe
boolean --- Returns the DANFE URL before the invoice is issued
assincrono
boolean --- Asynchronous processing, with the result sent to the notification URL. The issuing system decides whether to use it.
It does not guarantee asynchronous sending: in sandbox, processing is synchronous. For the NFC-e, the issuing system makes the choice; the parameter sent by the client does not enable this mode.
{
  "operacao": 1,
  "natureza_operacao": "Venda de produção do estabelecimento",
  "modelo": 1,
  "finalidade": 1,
  "ambiente": 1,
  "previa_danfe": true, // Get a DANFE preview before issuing
  "cliente": { ... },
  "produtos": [ ... ],
  "pedido": { ... }
}

Issuing an invoice
Customer information

Send the customer data in the cliente object:

  • In an NF-e with a Brazilian recipient, identify the recipient with cpf and nome_completo (individual) or with cnpj and razao_social (company). Never send CPF and CNPJ together. The other customer fields follow the table below.
  • In the NFC-e, when you send endereco, also send a valid bairro (neighborhood) and cep (postal code).
  • For import and export invoices, send the foreign customer data.
Parameter NF-e NFC-e Type Size Description
cpf
Individual
string 11 CPF number (individual taxpayer ID)
000.000.000-00
nome_completo
Individual
string 2-60 Full name
cnpj
Company
string 14 CNPJ (company ID)
00.000.000/0000-00
razao_social
Company
string 2-60 Legal name
ie
Company
Individual
string 2-14 *Required if the customer has a state registration
State registration (IE) number
More information: sintegra.gov.br (in Portuguese)
suframa
Company
string 8-9 SUFRAMA registration (Manaus Free Trade Zone)
substituto_tributario
Company
Individual
string 2-14 State registration (IE) of the tax substitute in the destination state of the goods, when ICMS-ST (ICMS tax substitution) is withheld for the destination state.
More information: sintegra.gov.br (in Portuguese)
tipo_atividade NEW
string / null --- Activity of the recipient: comerciante (reseller) or industria (manufacturer). Used in the Basic food basket (cesta básica) calculation.
consumidor_final
Company
Individual
integer 1 Final consumer indicator. The Webmania® issuing system sets it automatically. The CFOP (transaction code) classification can override the value you send.
0 - Normal
1 - Final consumer
contribuinte
Company
Individual
integer 1 ICMS taxpayer indicator. The Webmania® issuing system sets it automatically, and you can change it manually if you prefer.
1 - ICMS taxpayer
2 - Taxpayer exempt from registration in the ICMS taxpayer registry
9 - Non-taxpayer, which may or may not have a state registration in the ICMS taxpayer registry.
microcervejaria
boolean --- Microbrewery indicator.
For companies classified as a microbrewery, which have specific tax benefits in each state. Learn more (in Portuguese).
endereco
string 2-60 Customer street address
complemento
string 1-60 Address complement of the customer (for example, suite or floor)
numero
string 1-60 Street number of the customer address. If you omit it, the API uses S/N (no number).
bairro
string 2-60 Neighborhood of the customer address
cidade
string 2-60 City of the customer address
uf
string 2 Individual / Company
State of the customer address
XX
cep
string 8 CEP (postal code) of the customer address
00000-000
telefone
string 6-14 Customer phone number
email
string 1-60 Customer email address, used to send the NF-e
To send more than one email address, separate them with commas.

E.g.: nome@email.com, nome@email.com

Illustrative example of an individual customer: replace the CPF, CEP and phone number with the recipient's valid data. The values below are not valid test data.

{
  ...
  "cliente": {
     "cpf": "000.000.000-00",
     "nome_completo": "Nome do Cliente",
     "endereco": "Av. Brg. Faria Lima",
     "complemento": "Escritório",
     "numero": "1000",
     "bairro": "Itaim Bibi",
     "cidade": "São Paulo",
     "uf": "SP",
     "cep": "00000-000",
     "telefone": "(00) 0000-0000",
     "email": "nome@email.com"
  },
  ...
}

Issuing an invoice > Customer information
Foreign customer

For import and export invoices, send the foreign customer inside the cliente object. Send cod_pais and nome_pais. If you omit one of them, the issuing system tries to fill it in from the country database, and returns an error if it cannot. The tax address is set to the city EXTERIOR (abroad) and the state (UF) EX. A missing number is filled in with S/N (no number).

Parameter NF-e Type Size Description
id_estrangeiro
string 5-20 ID of the foreign recipient. Required in a domestic sale to a foreigner, as identified by the issuing system.
Passport number or another legal document that identifies a foreign person.
nome_estrangeiro
string 2-60 Recipient name
cod_pais
string 2-4 Country code (BACEN standard, the Central Bank of Brazil list). Required if the country name does not identify a single country in the country database.
E.g.: United States = 2496
View the BACEN table (in Portuguese)
nome_pais
string 2-60 Country name. Required if the code you send cannot be resolved to a foreign country in the country database.
endereco
string 2-60 Customer street address
bairro
string 2-60 Neighborhood of the customer address
numero
string 1-60 Street number of the customer address
complemento
string 1-60 Address complement of the customer

Example of how to send a foreign customer when you issue an invoice:

{
  ...
  "cliente": {
     "nome_estrangeiro": "Nome do Cliente",
     "cod_pais": "2496", // BACEN code
     "nome_pais": "Estados Unidos", // Country name
     "endereco": "Endereço do cliente",
     "bairro": "Bairro do cliente"
  }
  ...
}

Issuing an invoice > Product information
Products

Each product is an object in the produtos array. It has the fields below and the taxes of the item (classe_imposto or impostos; see How to send the taxes). Import and export invoices need extra fields in the product.

Parameter NF-e / NFC-e Type Size Description
ID
string / integer 1-15 Purchase order ID for each product
NOTE: xPed tag of the XML. Accepts text. When omitted, the API uses the order ID, if one was sent.
item
string / integer 1-6 Item number in the purchase order
For the issuer's own B2B control. Not used in import transactions.
nome
string 1-120 Product name
codigo
string 1-60 Product code
NOTE: cProd tag of the XML
ncm
string 8 NCM (Nomenclatura Comum do Mercosul), the 8-digit product classification code of Mercosur, based on the international HS code. Required for every product: it sets the IPI rate and is used by many state ICMS rules.
quantidade
string 11v4 Quantity of items
quantidade_tributavel
string / number 11v4 Taxable quantity of the product, with up to 4 decimal places. When omitted, the API uses quantidade.
unidade
string 1-6 Commercial/taxable unit of the product
Example:
UN - Unit
KG - Kilogram
unidade_tributavel
string 1-6 Taxable unit of the product
Example:
UN - Unit
KG - Kilogram
peso
string 12v3 Product weight
Weight in kilograms (KG)
E.g.: 0.800 = 800 grams
origem
integer 1 Origem (origin) of the goods, a 1-digit code that goes in the ICMS group of the item: 0 = national goods; the other values identify imported goods or goods with imported content. Required, except for items with ISSQN (city service tax) or invoices with finalidade 5 or 6.
0 - Domestic, except as indicated in codes 3, 4, 5 and 8
1 - Foreign - Direct import, except as indicated in code 6
2 - Foreign - Bought in the domestic market, except as indicated in code 7
3 - Domestic, goods or assets with Import Content above 40% and up to 70%
4 - Domestic, produced in line with the basic production processes set by the laws cited in the Ajustes (tax agreements)
5 - Domestic, goods or assets with Import Content of 40% or less
6 - Foreign - Direct import, with no domestic equivalent, on the CAMEX (foreign trade chamber) list, and natural gas
7 - Foreign - Bought in the domestic market, with no domestic equivalent, on the CAMEX list, and natural gas
8 - Domestic, goods or assets with Import Content above 70%
desconto
string 13v2 Discount amount for this product
0.00

By default, send the discount in the pedido object. If needed, you can apply a separate discount to each product.
subtotal
string 11v10 Unit price of the product
0.00 (full amount before discounts)
subtotal_tributavel
string 11v10 Taxable unit price of the product
0.00 (full amount before discounts)
total
string 13v2 Total price (quantity x unit price)
0.00 (full amount before discounts)
ind_valor_total
integer 1 Indicates whether the item amount is part of the invoice total
0 - Item amount is not part of the total
1 - Item amount is part of the total
ind_bem_movel_usado
integer 1 Flags the supply of used movable goods. Use it only when the used goods were bought from an individual who is not a taxpayer or who is registered as an MEI (individual micro-entrepreneur). Applies only to the NF-e (model 55), not to the NFC-e.
1 - Used movable goods
The boolean value true is also accepted and converted to 1.
impostos.icms_previsto
string / number 13v2 ICMS expected in the advance payment (technical note NT 2026.008). Optional and only for the NF-e (model 55). Use it only in a debit note of type 06 (advance payment) or in a government purchase with tipo_operacao_governamental = 4. Accepted from December 14, 2026 in the sandbox (homologação) and in production. Before that date, the API returns "Parâmetro indisponível" (parameter unavailable). It replaces the ICMS group of the item. It does not apply to a service item (ISSQN). Send 0.00 when the supply has no ICMS.
Required in these cases from March 1, 2027 in production and February 1, 2027 in the sandbox.
The system generates the XML fields vUnComLiq, vProdLiq and vProdLiqTot automatically from December 14, 2026 in sandbox and production.
classe_imposto
string --- Automatic tax setup. Reference of a saved Tax Class (classe de imposto), which holds the CFOP, CST and rates of ICMS, IPI, PIS, COFINS and ISS for each scenario; Webmania calculates the taxes of the item from it. Send classe_imposto or impostos; at least one is required. The Tax Class must belong to the authenticated company.
REF0000 (example reference; replace it with a registered Tax Class)
impostos
object --- Taxes set in the API. Required when you do not send classe_imposto. Use it for specific transactions, such as ICMS-ST, or when you need more flexibility.
dfe_referenciado
object --- Reference to the original invoice, per item. In a return (finNFe=4), it is an alternative to nfe_referenciada in the header. Required in a credit note of type 06 when that rule is in force, and in a debit note of type 03 or 04. Not allowed in the other credit note types. See the conditions and fields in Referenced tax document.
cest
string 7 CEST (Código Especificador da Substituição Tributária), the 7-digit code required on items of goods listed for ICMS tax substitution (ICMS-ST); it is linked to the NCM. Validation ignores dots and spaces.
beneficio_fiscal
string 8 Tax benefit code in the state (UF)
Use the same code as in the EFD (digital tax bookkeeping) and other filings, in the states that require it.
informacoes_adicionais
string 1-500 Additional product information.
ind_escala
string 1 Relevant scale indicator
S - Produced at Relevant Scale
N - Produced at NON-Relevant Scale

NOTE: Required for products whose NCM is listed in Annex XXVII of Agreement (Convênio) 52/2017
cnpj_fabricante
string 14 CNPJ (company ID) of the manufacturer of the goods
00.000.000/0000-00 (example format; send a valid CNPJ)

NOTE: Required when ind_escala = N, except in transactions identified as imports.
gtin
string 8-14 Product GTIN, formerly the EAN code, or barcode
gtin_tributavel
string 8-14 Taxable GTIN of the product, formerly the EAN code, or barcode
cod_barras
string 3-30 Your own or a third party's barcode that is different from the GTIN standard
cod_barras_tributavel
string 8-14 Your own or a third party's taxable barcode that is different from the GTIN standard
nve
string 6 NVE code (customs valuation and statistics code)
Required only for imported products whose NCM requires the NVE. Ask your accountant.
nrecopi
string 20 Number of the RECOPI group (Recognition and Control of Transactions with Tax-Immune Paper)
Only for NFC-e
ativo_permanente
boolean --- Flags the product as a fixed asset or for the customer's own use or consumption.
Used in ICMS-ST (tax substitution) transactions to identify goods that enter the taxpayer's establishment and are not linked to a later sale or service.
veiculo_usado
string 13v2 Only for sales of used vehicles. Send the value of the used vehicle shown on its purchase invoice.
0.00
ex_ipi
string 2-3 Exception code of the NCM when the product falls under a different IPI rate.
000
combustiveis
object --- Specific details for fuels.
Learn more
medicamento
object --- Specific details for medicines and pharmaceutical raw materials.
Learn more
armamentos
object --- Specific details for firearms.
Learn more
veiculos_novos
object --- Specific details for new vehicles.
Learn more

Issuing an invoice > Product information
Export

There are three types of export: direct, indirect and drawback. Indirect export requires the export registration and the access key of the export NF-e. Drawback requires the number of the concession act (ato concessório). Direct export, with no intermediaries, needs no extra fields in the product.

The export information is added to each product inside the produtos array.

Parameter NF-e Type Size Description
drawback
string 1-20 Drawback Export
Number of the Drawback concession act
The number of a Suspension concession act must have 11 digits (AAAANNNNNND). The number of a Drawback Exemption concession act must have 9 digits (AANNNNNND).
reg_exportacao
string 12 Indirect Export
Export Registration number
nfe_exportacao
string 44 Indirect Export
Access key of the NF-e received for export
NF-e received for the specific purpose of export. For a transaction with CFOP 3.503, send the access key of the NF-e that carried out the export.
qtd_exportacao
string 11v4 Indirect Export
Quantity of the item actually exported
This quantity uses the commercial unit of this item. For a transaction with CFOP 3.503, send the quantity of goods returned.

Example of an indirect export in the exportacao array of each product. The ellipses mark a fragment. Replace the zeros with the real registrations and keys:

{
  ...
  "produtos": [
     {
        ...
          "exportacao": [
             {
                "reg_exportacao": "000000000000",
                "nfe_exportacao": "00000000000000000000000000000000000000000000",
                "qtd_exportacao": "5"
             },
             {
                "reg_exportacao": "000000000000",
                "nfe_exportacao": "00000000000000000000000000000000000000000000",
                "qtd_exportacao": "5"
             }
          ]
     }
  ],
  ...
}

Issuing an invoice > Product information
Import

For an import, you must send the import document, the customs clearance location and the addition (adição). Take this information from the DI (Import Declaration).

The import information is added to each product inside the produtos array.

Parameter NF-e Type Size Description
subtotal
string 11v10 Unit price of the product
0.00 (full amount before discounts)

Note
For imported products, send the customs subtotal price (product value + freight + insurance).
total
string 13v2 Total price (quantity x unit price)
0.00 (full amount before discounts)

Note
For imported products, send the customs total price (total product value + freight + insurance).
ndoc_importacao
string 1-15 Import document number (DI, DSI, DIRE, DUImp)
ddoc_importacao
string 10 Registration date of the document
Format: YYYY-MM-DD
local_desembaraco
string 1-60 Customs clearance location
uf_desembaraco
string 2 Abbreviation of the state (UF) where customs clearance took place
data_desembaraco
string 10 Customs clearance date
Format: YYYY-MM-DD
via_transporte
string 1-2 International transport mode stated in the Import Declaration (DI) or in the Single Import Declaration (DUImp)
1 - Sea
2 - River
3 - Lake
4 - Air
5 - Postal
6 - Rail
7 - Road
8 - Pipeline / Transmission grid
9 - Own means
10 - Fictitious entry / exit
11 - Courier
12 - By hand
Values accepted by the API: 1 to 12
intermediacao
string 1 Import type, by intermediation
1 - Import on own account
2 - Import on behalf of a third party
3 - Import to order
adicao
string 1-3 Addition number (adição)
seq_adicao
string/integer 1-3 Sequence number of the item within the addition. When omitted, the API uses 1.
fabricante
string 1-60 Foreign manufacturer code
Number set by the importer. Check the manufacturer's registration number in your ERP/system. In the addition, when omitted, the API uses 1.
desc_di
string 13v2 Discount amount of the item in the addition.
afrmm
string 13v2 AFRMM amount (Additional Freight Charge for the Renewal of the Merchant Navy)
Must be sent when the transport mode is by sea.
cnpj_terceiro
string 14 CNPJ (company ID) of the buyer or of the party that ordered the import
With intermediacao=2 or 3, send a valid CNPJ or cpf_terceiro, never both. Include the leading zeros.
cpf_terceiro NEW
string 11 CPF (individual taxpayer ID) of the buyer or of the party that ordered the import
With intermediacao=2 or 3, send a valid CPF or cnpj_terceiro, never both. Send the 11 digits without punctuation.
uf_terceiro
string 2 State (UF) abbreviation of the buyer or of the party that ordered the import
Required for imports on behalf of a third party, or to order. Does not accept the value "EX".
cod_exportador
string 1-60 Exporter code
Number set by the importer. Check the exporter's registration number in your ERP/system. When omitted, the API uses 0.
nfci
string 36 Control number of the FCI (import content form).
Related to Federal Senate Resolution 13/2012. Format: digits, uppercase letters "A" to "F" and the hyphen character. Example: B01F70AF-10BF-4B1F-848C-65FF57F616FE.

Example of import data per product. The ellipses stand for omitted fields. Use the real data of the import document:

{
  ...
  "produtos": [
     {
        ...
        "ndoc_importacao": "000000001",
        "ddoc_importacao": "2018-06-01",
        "local_desembaraco": "Aeroporto Internacional de São Paulo",
        "uf_desembaraco": "SP",
        "data_desembaraco": "2018-06-01",
        "via_transporte": "4",
        "intermediacao": "1",
        "adicao": "1",
        "seq_adicao": "1",
        "fabricante": "000000001",
     }
  ],
  ...
}

Issuing an invoice > Product information
Traceability

Send traceability data for products under health regulations and for recall cases. It also applies to pesticides, veterinary and dental products, medicines, beverages, bottled water, packaging, etc. It is required for medicines and pharmaceutical products.

The data goes inside the rastro array of objects. A single object is also accepted, as shown in the Product information table.

Parameter NF-e Type Size Description
lote
string 1-20 Product batch number
quantidade
string 8v3 Quantity of product in the batch
data_fabricacao
string 10 Manufacturing/production date
Format:
YYYY-MM-DD
data_validade
string 10 Expiration date
Format:
YYYY-MM-DD
codigo_agregacao
string --- Aggregation code

Example of how to add traceability data to each product:

{
  ...
  "produtos": [
     {
        ...
        "rastro": {
           "lote": "000001", 
           "quantidade": "100",
           "data_fabricacao": "2018-01-01",
           "data_validade": "2020-01-01"
        }
     }
  ],
  ...
}

Issuing an invoice > Product information
Referenced tax document

In a return invoice (finalidade=4), you can reference the original invoice in two ways: in the header, with the nfe_referenciada parameter, or per item, with the dfe_referenciado object inside each product. Choose only one way per invoice: a request that sends both at the same time is rejected.

When to use each way:
nfe_referenciada — in the header of the invoice. From November 16, 2026 in production (November 9, 2026 in the sandbox), a return referenced in the header accepts only one original document, counting all header parameters together.
dfe_referenciado — inside each product of the produtos array. Use it when the returned items come from more than one invoice. With no reference in the header (nfe_referenciada, nf_rural_referenciada, cte_referenciada or ecf_referenciada), every product needs dfe_referenciado, except products with CFOP 5921 and 6921. All referenced invoices must have the same issuer. You also cannot send these header parameters together with dfe_referenciado.
Endpoint /1/nfe/devolucao/ — automatic:
Besides the other required parameters of the transaction, send the chave (or uuid) of the original invoice. In a partial return, also send the produtos array with the returned items. The per-item reference is filled in automatically — you do not need to build the dfe_referenciado object. You do not need to change how you build this reference. If you send the quantidade array, it must have the same length and the same order as the produtos array.
Endpoint /1/nfe/emissao/ with finalidade=4:
Send nfe_referenciada with the access key of the original invoice, or add the dfe_referenciado object with chave (44 digits) to each returned product. Also send item (the item number in the original invoice, from 1 to 999). It becomes optional from November 16, 2026 in production (November 9, 2026 in the sandbox). Until then, it is still required.
Parameter NF-e Type Size Description
chave
string 44 Access key of the original NF-e.
item
integer 1-999 Item number in the original NF-e. In a return, optional from November 16, 2026 in production (November 9, 2026 in the sandbox).

Example of an item of the produtos array with dfe_referenciado filled in, in a return issued through the /1/nfe/emissao/ endpoint (finalidade=4). The values are examples. Replace them with the real data of the original invoice and the product:

{
  "nome": "Produto 1",
  "codigo": "8",
  "ncm": "61091000",
  "quantidade": "2.00",
  "unidade": "UN",
  "origem": "0",
  "subtotal": "5.0000",
  "total": "10.00",
  "codigo_cfop": "2201",
  "dfe_referenciado": {
    "chave": "00000000000000000000000000000000000000000000",
    "item": 1
  },
  "impostos": { ... }
}

Issuing an invoice > Product information
Fuels

Fuel-specific details. Send this information inside the combustiveis object, as shown in the Product Information table.

Parameter NF-e Type Size Description
codigo_anp
string 9 Product code from the ANP (national petroleum agency)
descricao_anp
string 1-95 Product description as registered with the ANP
uf_consumo
string 2 State where the fuel is consumed
XX
percentual_glp
string/number 3v2 Percentage of petroleum-derived LPG (GLP) in the LPG product
0.00
percentual_gnn
string/number 3v2 Percentage of domestic natural gas (GLGNn) in the LPG product
0.00
percentual_gni
string/number 3v2 Percentage of imported natural gas (GLGNi) in the LPG product
0.00
percentual_biodiesel
string/number 3v4 Blend percentage of biodiesel (B100) in diesel oil B (Technical Note NT 2023.001 v1.40)
A number greater than 0 and less than or equal to 100, with up to 4 decimal places. Example: 12.3456
partida
string/number 13v2 Starting value (valor de partida)
Enter the value per kilogram, without ICMS, in this field
codif
string 1-21 CODIF authorization/registration code
qtd_temperatura
string/number 12v4 Fuel quantity billed at ambient temperature
Only if the product quantity sent in the quantidade parameter was adjusted to a temperature other than ambient temperature.
bc_cide
string/number 12v4 Tax base of the CIDE (federal fuel levy), as a quantity. The API formats the value with two decimal places.
0.00
valor_cide
string/number 13v2 CIDE rate amount in reais. Required when bc_cide is sent.
0.00
bico
string/integer 1-3 ID number of the nozzle used for refueling
Required when you send the nozzle, pump, tank or totalizer readings (encerrantes). Provided by the sales control equipment of the fuel station.
bomba
integer --- ID number of the pump the nozzle is connected to
Provided by dedicated hardware attached to the fuel pump, as set in the sales control of the fuel station.
tanque
string/integer 1-3 ID number of the tank the nozzle is connected to
Required when you send the nozzle, pump, tank or totalizer readings (encerrantes). Provided by the sales control equipment of the fuel station.
encerrante_inicio
string/number 12v3 Pump totalizer reading (encerrante) at the start of refueling. Required when the group has a nozzle (bico).
Provided by dedicated hardware attached to the fuel pump, as set in the sales control of the fuel station.
encerrante_final
string/number 12v3 Pump totalizer reading (encerrante) at the end of refueling. Required when the group has a nozzle (bico).
Provided by dedicated hardware attached to the fuel pump, as set in the sales control of the fuel station.
origem
array --- Group that indicates the origin of the fuel

Illustrative example of fuel details per product. Replace the ANP code and the description with the real product data:

{
  ...
  "produtos": [
     {
        ...
        "combustiveis": {
           "codigo_anp": "000000001",
           "descricao_anp": "Descrição do produto conforme ANP",
           "uf_consumo": "SP",
           "percentual_biodiesel": "12.3456"
        }
     }
  ],
  ...
}

Issuing an invoice > Product information > Fuels
Origin

Send the origin in the origem array, inside the combustiveis object of each product. When you fill in an origin, send all three fields below. See Product Information.

Parameter NF-e Type Size Description
indicador_importacao
string 1 Fuel import indicator 0 - Domestic
1 - Imported
uf_origem
string 2 Two-letter code of the state (UF) of origin of the producer or importer. XX
percentual_originario
string/number 3v4 Origin percentage for the state (UF)
0.00

Example of how to add the fuel origin details:

{
  ...
  "produtos": [
     {
        ...
        "combustiveis": {
          ...
           "origem": [
              {
                "indicador_importacao": "0",
                "uf_origem": "SP",
                "percentual_originario": "17"
              }
           ]
        }
     }
  ],
  ...
}

Issuing an invoice > Product information
Medicines

Specific details for medicines and pharmaceutical raw materials. Send this information inside the medicamento object, as shown in the Product Information table.

Parameter NF-e Type Size Description
codigo_anvisa
string 13 Product code from ANVISA (national health regulatory agency)
pmc
string/number 13v2 Maximum consumer price
0.00

Illustrative example of medicine details per product. Replace the ANVISA code and the batch data with the real data:

{
  ...
  "produtos": [
     {
        ...
        "medicamento": {
           "codigo_anvisa": "0000000000001",
           "pmc": "20.00"
        },
        "rastro": {
           "lote": "000001", 
           "quantidade": "100",
           "data_fabricacao": "2018-01-01",
           "data_validade": "2020-01-01"
        }
     }
  ],
  ...
}

Issuing an invoice > Product information
Firearms

Firearm-specific details. Send this information inside the armamentos object, as shown in the Product information table.

Parameter NF-e Type Size Description
tipo
integer 1 Firearm type indicator
0 - Permitted use
1 - Restricted use
serie_arma
string 1-15 Serial number of the firearm
serie_cano
string 1-15 Serial number of the barrel
descricao
string 1-256 Full description of the firearm
Caliber, brand, capacity, type of action, length and any other details that fully identify it.

Example of how to add firearm details to each product:

{
  ...
  "produtos": [
     {
        ...
        "armamentos": {
           "tipo": "0", 
           "serie_arma": "00000001",
           "serie_cano": "00000001",
           "descricao": "Descrição completa da arma"
        }
     }
  ],
  ...
}

Issuing an invoice > Product information
New vehicles

Details specific to new vehicles. Send this information inside the veiculos_novos object, as shown in the Product Information table.

Parameter NF-e Type Size Description
tipo_operacao
integer 1 Transaction type
1 - Dealership sale
2 - Direct billing to the end consumer
3 - Direct sale to large buyers (fleet owner, government)
0 - Other
chassi
string 17 Vehicle chassis number
cor
string 1-4 Color
Each manufacturer's own code
cor_descricao
string 1-40 Color description
cv
string 1-4 Engine power (CV, metric horsepower).
cilindrada
string 1-4 Engine displacement.
peso_liquido
string 1-9 Net weight
0.0000 (in metric tons, with 4 decimal places)
peso_bruto
string 1-9 Total gross weight
0.0000 (in metric tons, with 4 decimal places)
serie
string 1-9 Serial number
tipo_combustivel
integer 1-2 Fuel type
Use the RENAVAM table (national vehicle registry, v2.0)
01 - Ethanol
02 - Gasoline
03 - Diesel
04 - Producer gas
05 - Methane gas
06 - Electric/Internal source
07 - Electric/External source
08 - Gasoline/Natural gas fuel
09 - Ethanol/Natural gas fuel
10 - Diesel/Natural gas fuel
11 - See field/Note
12 - Ethanol/CNG (GNV)
13 - Gasoline/CNG
14 - Diesel/CNG
15 - CNG
16 - Ethanol/Gasoline
17 - Gasoline/Ethanol/CNG
18 - Gasoline/Electric
numero_motor
string 1-21 Engine number
cmt
string 1-9 Maximum traction capacity
0.0000 (in metric tons, with 4 decimal places)
dist
string 1-4 Wheelbase (distance between axles)
ano_modelo
string 4 Model year
XXXX
ano_fabricacao
string 4 Year of manufacture
XXXX
tipo_pintura
string 1 Paint type
tipo_veiculo
integer 1-2 Vehicle type
Use the RENAVAM table, as in the examples below:
02 - Moped
03 - Motor scooter
04 - Motorcycle
05 - Tricycle
06 - Car
07 - Minibus
08 - Bus
10 - Trailer
11 - Semi-trailer
13 - Light truck
14 - Truck
17 - Truck tractor
22 - Special/Bus
23 - Mixed/Truck
24 - Cargo/Truck
especie_veiculo
integer 1 Vehicle category
Use the RENAVAM table
1 - Passenger
2 - Cargo
3 - Mixed
4 - Racing
5 - Traction
6 - Special
vin
string 1 VIN condition
Indicates whether the vehicle's VIN (chassis number) was re-stamped.
R - Re-stamped
N - Normal
condicao_veiculo
integer 1 Vehicle condition
1 - Finished
2 - Unfinished
3 - Semi-finished
marca_modelo
integer 1-6 Make/model code
Use the RENAVAM table
cor_denatran
integer 1-2 Color code of the DENATRAN (national traffic department)
01 - Yellow
02 - Blue
03 - Beige
04 - White
05 - Gray
06 - Gold
07 - Maroon
08 - Orange
09 - Brown
10 - Silver
11 - Black
12 - Pink
13 - Purple
14 - Green
15 - Red
16 - Custom (multicolor)
lotacao
integer 1-3 Maximum seating capacity
restricao
integer 1 Restriction
0 - None
1 - Fiduciary lien
2 - Lease (leasing)
3 - Retention of title
4 - Vehicle pledge
9 - Other

Example of how to add new vehicle details to each product:

{
  ...
  "produtos": [
     {
        ...
        "veiculos_novos": {
           "tipo_operacao": "1", 
           "chassi": "00000000000000000",
           "cor": "A1",
           "cor_descricao": "Descrição da Cor",
           "cv": "100",
           "cilindrada": "1000",
           "peso_liquido": "2.5000",
           "peso_bruto": "2.5000",
           "serie": "00001",
           "tipo_combustivel": "16",
           "numero_motor": "00001",
           "cmt": "2.0000",
           "dist": "150",
           "ano_modelo": "2019",
           "ano_fabricacao": "2018",
           "tipo_pintura": "S",
           "tipo_veiculo": "06",
           "especie_veiculo": "1",
           "vin": "N",
           "condicao_veiculo": "1",
           "marca_modelo": "00001",
           "cor_denatran": "04",
           "lotacao": "5",
           "restricao": "0"
        }
     }
  ],
  ...
}

Issuing an invoice > Product information
Basic food basket (cesta básica)

Specific details for basic food basket goods (cesta básica, a list of essential food items). For the automatic calculation of ICMS (state sales tax) and ICMS-ST (ICMS tax substitution), send the business activity of the issuing company, the recipient's data and, in each qualifying product, the cesta_basica field inside the icms object of impostos.

Parameter NF-e Type Size Description
cesta_basica
boolean / null --- Send true in produtos[].impostos.icms.cesta_basica for each basic food basket item, also when you use classe_imposto. Without true, the item keeps the current calculation.

Compatibility

Currently, the calculation supports the state of Pernambuco (PE), as set by Annex 45 of RICMS-PE, the Pernambuco ICMS regulation (in Portuguese): an outgoing NF-e within PE with normal purpose (finalidade: 1), an issuer in the standard tax regime (CRT 3) and a goods exit date between October 1, 2026 and December 31, 2032.

What to send

Issuing company. Set the business activity of the establishment once, in tipo_atividade: industria or produtor.

Recipient. It depends on what the goods are for:

RecipientCustomerCST
Purchase for resale tipo_atividade: "comerciante", active ie, contribuinte: 1 and consumidor_final: 0 70
Purchase for manufacturingtipo_atividade: "industria"20
End consumerconsumidor_final: 1, without tipo_atividade20
Not an ICMS taxpayercontribuinte: 9, without tipo_atividade20

If the item's ICMS-ST was already paid before, use CST 60, whatever the recipient.

Products. In each qualifying item, send impostos.icms.cesta_basica: true. With classe_imposto (Tax Class), set the ICMS data below in the Tax Class and send only "impostos": {"icms": {"cesta_basica": true}} in the item. When you send the taxes in the item, send the fields below, plus IPI, PIS, COFINS and, when required, IBS/CBS.

FieldValue
ncmFull NCM (product code), with eight digits.
impostos.icms.situacao_tributariaCST based on the recipient (table above).
impostos.icms.aliquotaPE intrastate rate (20.50).
impostos.icms.aliquota_stWith CST 70: PE intrastate rate (20.50).
impostos.icms.motivo_desoneracaoRequired with CST 70.
impostos.icms.deducao_desoneracaoWith CST 70: 0, so the relieved ICMS (desonerado) is not deducted from the invoice total.
impostos.icms.aliquota_mvaDoes not change the calculation. You can omit it in the item. In a Tax Class with CST 70, the setup still requires the MVA (added value margin) per state (UF).

To use the automatic calculation, do not send these in qualifying items: aliquota_reducao, aliquota_reducao_st, aliquota_efetiva_icms, aliquota_efetiva_icms_st, valor_st other than zero, or valor (not even "0.00"). These values replace the calculation. If there is an ICMS-ST fixed reference price (pauta fiscal), send the unit value in pauta_fiscal. Use majoracao only for a normative value (valor normativo) of the issuer's own ICMS.

Example

Excerpt of a free-goods shipment (bonificação) for resale (CST 70), with the taxes sent in the item. Include the other required fields of the issue request, such as the recipient's address, IPI, PIS, COFINS and the order data.

{
  "operacao": 1,
  "natureza_operacao": "Bonificação",
  "modelo": 1,
  "finalidade": 1,
  "ambiente": 2,
  "cliente": {
    "cnpj": "CNPJ_DO_DESTINATARIO",
    "razao_social": "Destinatário",
    "ie": "IE_DO_DESTINATARIO",
    "tipo_atividade": "comerciante",
    "contribuinte": 1,
    "consumidor_final": 0,
    "uf": "PE"
  },
  "produtos": [
    {
      "nome": "Fubá de milho para cuscuz",
      "ncm": "11022000",
      "quantidade": "100",
      "subtotal": "10.00",
      "total": "1000.00",
      "impostos": {
        "icms": {
          "codigo_cfop": "5910",
          "situacao_tributaria": "70",
          "cesta_basica": true,
          "aliquota": "20.50",
          "aliquota_st": "20.50",
          "motivo_desoneracao": "9",
          "deducao_desoneracao": "0"
        }
      }
    }
  ]
}

The classification of the products and activities is the company's own declaration. Check it with your accountant.


Issuing an invoice > Order information
Order

Order data goes in the pedido object, at the root of the JSON: payment, buyer presence, freight, discounts and total.

Parameter NF-e / NFC-e Type Size Description
presenca
integer 1 Shows whether the buyer was present at the business at the time of the transaction
0 - Not applicable (for example, a complementary or adjustment invoice)
1 - In-person transaction
2 - Remote transaction, over the internet
3 - Remote transaction, by telephone
4 - NFC-e for a transaction with home delivery
5 - In-person transaction, outside the business premises
9 - Remote transaction, other
intermediador
integer 1 Intermediary/marketplace indicator
0 - Transaction without an intermediary (on your own website or platform)
1 - Transaction on a third-party website or platform (intermediaries/marketplaces)
cnpj_intermediador
string 14 *Required for a transaction with an intermediary
CNPJ (company ID) of the transaction intermediary
Agent, delivery platform, marketplace or a similar service or business platform.
id_intermediador
string --- *Required for a transaction with an intermediary
ID registered with the intermediary
User name or ID of the seller profile on the intermediary's website.
pedido.pagamentos_vinculadosNEW
array 1-99 Links the invoice to payment transactions. Send it only inside the pedido object; it is not a root parameter.
modalidade_frete
integer 1 Freight terms
0 - Freight contracted by the sender (CIF)
1 - Freight contracted by the recipient (FOB)
2 - Freight contracted by a third party
3 - Own transport by the sender
4 - Own transport by the recipient
9 - No transport
frete
string 13v2 Total freight
Default: 0.00

IMPORT NF-E
For an import invoice, do not send the freight amount. You can report the amount only in the informacoes_fisco field (information for the tax authority).
desconto
string 13v2 Total discount
Default: 0.00
total
string 13v2 Total order amount paid by the customer
The tax total includes products, freight, insurance, expenses, discounts and applicable taxes.
0.00

AUTOMATIC
The tax total is calculated automatically. The amount you send replaces this total only in import or export transactions (CFOP, the transaction code, from 7000 to 7999).
despesas_acessorias
string 13v2 Other ancillary expenses
0.00
despesas_aduaneiras
string 13v2 Required for an import invoice:
Amount of customs expenses (Siscomex, the foreign trade system)
0.00
informacoes_fisco
string 1-2000 Information for the tax authority
informacoes_complementares
string 1-5000 Additional information for the consumer
observacoes_contribuinte
array --- Free-form notes from the taxpayer
NOTE: Array with at most 10 objects; each object must have campo (1-20 characters) and texto (1-60 characters).
observacoes_fisco
array --- Free-form notes for the tax authority
NOTE: The array must have the parameters campo and texto, with at most 10 items (campo with 1 to 20 characters and texto with 1 to 60 characters). Fill it in only when the law or the tax authority requires it.
pedido_compraNEW
string 1-60 Purchase order ID.
Available only for the NF-e model
contratoNEW
string 1-60 ID of the purchase contract linked to the order.
Available only for the NF-e model
nota_empenhoNEW
string 1-22 ID of the commitment note (Nota de Empenho), for public procurement.
Available only for the NF-e model

Example of how to add the order information:

{
  ...
  "pedido": {
     "pagamento": 0,
     "presenca": 2,
     "modalidade_frete": 0,
     "frete": "12.56",
     "desconto": "10.00",
     "total": "174.60"
  }
}

Issuing an invoice > Order information
Payment

Payment information for the NF-e and NFC-e goes inside the pedido object. If you do not send forma_pagamento, the API uses 99 - Other and a default description. For adjustment or return invoices, the XML uses 90 - No payment and the amount 0.00.

For one payment method, send scalar values that match the type of each field. For several methods, send arrays, with the data of each payment at the same index. The pagamento, forma_pagamento and valor_pagamento arrays accept at most 100 items.

Parameter NF-e NFC-e Type Size Description
pagamento
integer or array 1 Payment terms indicator
0 - Immediate payment (default)
1 - Deferred payment. With more than one installment, the API uses 1.
forma_pagamento
string or array 2 Payment method. Default when missing: 99 - Other.
01 - Cash
02 - Check
03 - Credit card
04 - Debit card
05 - Store card (private label), digital store credit, other store credit plans
10 - Food voucher
11 - Meal voucher
12 - Gift voucher
13 - Fuel voucher
14 - Trade bill (Duplicata Mercantil)
15 - Bank payment slip (Boleto Bancário)
16 - Bank deposit
17 - Instant payment (PIX) - Dynamic
18 - TED (bank wire transfer)
19 - Loyalty program, cashback, virtual credit
20 - Instant payment (PIX) - Static
21 - Store credit
22 - Electronic payment not reported - hardware failure of the issuing system
23 - Instant payment (PIX) - Automatic
24 - TEF - Book Transfer
90 - No payment
91 - Deferred payment
99 - Other
desc_pagamento
string or array --- Description of the payment method for 99 - Other. We recommend sending it; when it is not required, a missing description is filled in automatically. For other methods, it is not included in the XML.
data_pagamentoNEW
string or array 10 Payment date
Format: YYYY-MM-DD
cnpj_transacional_pagNEW
string or array 14 *Required if uf_estabelecimento_pag is set
Transactional CNPJ of the payment CNPJ of the establishment where the payment was processed, transacted and/or received, when the tax document is issued by a different establishment
uf_estabelecimento_pagNEW
string or array 2 *Required if cnpj_transacional_pag is set
State (UF) of the establishment. State (UF) of the CNPJ of the establishment where the payment was processed, transacted and/or received.
tipo_integracao
integer or array 1 Payment integration type
1 - Payment integrated with the company's automation system (e.g.: TEF terminal, e-commerce, integrated POS)
2 - Payment not integrated with the company's automation system (e.g.: standalone POS terminal)

Default: 2; when forma_pagamento is omitted, the API uses 1.
valor_pagamento
decimal or array 13v2 *Required for cash; in an NFC-e with several payment methods, each amount must be non-zero. In the NF-e, the amounts you send are also validated. When no amount is sent, the API uses pedido.total; the automatic fill of the XML uses the tax total. With forma_pagamento 91 (Deferred payment), valor_pagamento is sent as 0.00 and does not take the total.
0.00 (format)
cnpj_credenciadora
string or array 14 *Required in the NFC-e for methods 03 (credit), 04 (debit) or 17 (dynamic PIX), with tipo_integracao = 1:
CNPJ of the payment institution
CNPJ of the payment institution, acquirer or sub-acquirer. If the transaction intermediary processes the payment, send the CNPJ of the intermediary.
bandeira
string or array 2 *Required in the NFC-e for methods 03 (credit), 04 (debit) or 17 (dynamic PIX), with tipo_integracao = 1:
Brand of the credit and/or debit card
01 - Visa
02 - Mastercard
03 - American Express
04 - Sorocred
05 - Diners Club
06 - Elo
07 - Hipercard
08 - Aura
09 - Cabal
10 - Alelo
11 - Banes Card
12 - CalCard
13 - Credz
14 - Discover
15 - GoodCard
16 - GreenCard
17 - Hiper
18 - JCB
19 - Mais
20 - MaxVan
21 - Policard
22 - RedeCompras
23 - Sodexo
24 - ValeCard
25 - Verocheque
26 - VR
27 - Ticket
99 - Other
autorizacao
string or array 1-128 *Required in the NFC-e for methods 03 (credit), 04 (debit) or 17 (dynamic PIX), with tipo_integracao = 1:
Authorization number of the transaction for cards, PIX, boletos (bank payment slips) and other electronic payments.
cnpj_beneficiarioNEW
string or array 14 *Required in the NFC-e for methods 03 (credit), 04 (debit) or 17 (dynamic PIX), with tipo_integracao = 1:
CNPJ of the establishment that receives the payment (beneficiary)
id_terminal_pagNEW
string or array 1-40 *Required in the NFC-e for methods 03 (credit), 04 (debit) or 17 (dynamic PIX), with tipo_integracao = 1:
ID of the terminal where the payment was made

Example of a customer who paid with two payment methods: the first in cash and the second by credit card:

{
    "pedido": {
        ...
        ...
        "forma_pagamento": ["01","03"], // cash and credit card
        "valor_pagamento": ["25.00","50.00"] // total amount of R$ 75.00
    }
}

Issuing an invoice > Order information
Linked payments

To link payment transactions when you issue an NF-e (model 55) or NFC-e (model 65), send pedido.pagamentos_vinculados. The list is optional. When you fill it in, it must have 1 to 99 transactions. A missing field, a null value or an empty list creates no link on the invoice. The field is accepted only inside pedido; there is no equivalent parameter at the root.

Available in the sandbox (homologação) from October 5, 2026 and in production from December 14, 2026. The current server date (UTC-3) applies, not the issue date you send. Before activation in each environment, a filled list returns an unavailable-parameter error, and the invoice is not issued.

Linking does not replace the payment data or the intermediary data. Send the payment data under the rules of the previous section, such as pedido.forma_pagamento and pedido.valor_pagamento, and the intermediary data, when applicable.
Fields of each item of pedido.pagamentos_vinculados
Parameter Type Size Description
n_pag integer or string 1-3 after normalization Required. Payment number from 1 to 990, with no decimal places or scientific notation. Numeric strings are converted to integers. The value cannot repeat in the list.
id_transacao string 2-35 Required. ID of the payment transaction, kept exactly as sent. Use text of 2 to 35 characters from the Latin-1 character set, with no control characters and no leading or trailing spaces. Do not send it as a number. The value cannot repeat in the list; uppercase and lowercase letters are different.
tp_meio_pagamento string or integer 2 Required. Payment method. Only the codes below are accepted:
15 - Bank payment slip (Boleto Bancário)
17 - Instant payment (PIX) - Dynamic
18 - TED (bank wire transfer)
20 - Instant payment (PIX) - Static
23 - Instant payment (PIX) - Automatic
24 - TEF - Book Transfer
cnpj_recebedor string or integer 14 Required. Valid CNPJ of the payment receiver, not necessarily the issuer. Prefer text; non-negative integers are padded with leading zeros to 14 digits before validation.
cnpj_base_psp string or integer 8 Required. CNPJ base (first 8 characters) of the payment service provider (PSP): text of 8 digits or uppercase letters; non-negative integers are padded with leading zeros to 8 digits. Alphanumeric CNPJs and bases are accepted only when enabled for the environment.

Partial example of the issuing JSON. Keep the other required fields of the invoice:

{
  "pedido": {
    "forma_pagamento": "17",
    "valor_pagamento": "100.00",
    "pagamentos_vinculados": [
      {
        "n_pag": 1,
        "id_transacao": "TRANSACAO-0001",
        "tp_meio_pagamento": "17",
        "cnpj_recebedor": "11222333000181",
        "cnpj_base_psp": "12345678"
      }
    ]
  }
}

A return does not inherit the link: when you create a return invoice from another invoice, pedido.pagamentos_vinculados is ignored. A new tax document does not inherit the payment links of the original invoice. Reissuing or recovering the same document keeps its links.

To link a transaction after the invoice is authorized, see event 110300 - Payment link.


Issuing an invoice
Transport

Transport data goes in the transporte object, at the root of the JSON.

Parameter NF-e / NFC-e Type Size Description
volume
string 1-15 Number of packages carried: an integer of up to 15 digits. Send 0 if the shipment has no packages. As a rule, when you send a positive gross or net weight, also send the number of packages.
especie
string 1-60 Type of the packages carried
peso_bruto
string 12v3 Gross weight of the packages carried. Send it together with the net weight when either weight is positive.
Weight in kilograms (KG)
E.g.: 50.210 = 50 KG and 210 grams
peso_liquido
string 12v3 Net weight of the packages carried. Send it together with the gross weight when either weight is positive.
Weight in kilograms (KG)
E.g.: 50.210 = 50 KG and 210 grams
marca
string 1-60 Marking (brand) of the packages carried
numeracao
string 1-60 Numbering of the packages carried
lacres
array of strings 1-60 per item Seal numbers of the packages carried. Example: ["LACRE001", "LACRE002"]. A single string does not create seals in the XML.

Example of how to add the transport information:

{
  ...
  "pedido": {
     ...
  },
  "transporte": {
     "volume": "2",
     "especie": "CAIXA",
     "peso_bruto": "2.500",
     "peso_liquido": "2.500"
  }
}

Issuing an invoice > Transport
Carrier

Identify the carrier that will transport the products. The carrier information goes inside the transporte object, as a complement.

Important: you do not need to send the carrier for shipments by Correios, the Brazilian postal service.
Parameter NF-e / NFC-e Type Size Description
cnpj
string 14 Company
CNPJ (company ID)
00.000.000/0000-00
razao_social
string 2-60 Company
Legal name. Required when you send the CNPJ of the carrier.
ie
string 2-14 Company
State registration (IE) number
0 - Exempt, or the state registration number
cpf
string 11 Individual
CPF (individual taxpayer ID). Do not send it together with cnpj.
000.000.000-00
nome_completo
string 2-60 Individual
Full name. Required when you send the CPF of the carrier.
endereco
string 1-60 Full address of the carrier company
uf
string 2 State code (UF)
When a CPF or CNPJ is sent, the UF is required if there is a non-exempt IE. Send "EX" for abroad.
cidade
string 1-60 City
cep
string 8 CEP (postal code)
00000-000
placa
string 7 Vehicle license plate
Use one of these formats: XXX9999, XXX999, XX9999 or XXXX999.
uf_veiculo
string 2 State code (UF) where the vehicle is registered
Send "EX" for abroad.
rntc
string 1-20 National Registry of Road Cargo Carriers (ANTT, the national land transport agency)
seguro
string 13v2 Insurance amount
0.00

Example of how to add the carrier information:

{
  ...
  "pedido": {
     ...
  },
  "transporte": {
     "volume": "2",
     "especie": "CAIXA",
     "peso_bruto": "2.500",
     "peso_liquido": "2.500",
     "cnpj": "00.000.000/0000-00",
     "razao_social": "Nome da empresa LTDA",
     "ie": "00000000",
     "endereco": "Av. Brg. Faria Lima",
     "uf": "SP",
     "cidade": "São Paulo",
     "cep": "00000-000"
  }
}

Issuing an invoice > Transport
Trailer

Trailer information goes in the reboque array, as a complement of the transporte object.

Parameter NF-e / NFC-e Type Size Description
placa
string 7 Vehicle license plate
Use one of these formats: XXX9999, XXX999, XX9999 or XXXX999.
uf_veiculo
string 2 State code (UF) where the vehicle is registered
Send "EX" for abroad.
rntc
string 1-20 National Registry of Road Cargo Carriers (ANTT)
vagao
string 1-20 Railroad car ID
balsa
string 1-20 Barge ID

Example of how to add the trailer information:

{
  ...
  "pedido": {
     ...
  },
  "transporte": {
     ...
     "reboque": [
       {
         "placa": "AAA000",
         "uf_veiculo": "SP",
         "rntc": "0000000000000000"
       }
     ]
  }
}

Issuing an invoice > Transport
Delivery location

The details that identify the delivery location go in the entrega object, as a complement of the transporte object.

Parameter NF-e Type Size Description
cnpj
Company
string 14 CNPJ (company ID)
00.000.000/0000-00
razao_social
Company
string 2-60 Legal name
ie
Company
string 2-14 State registration (IE) number
cpf
Individual
string 11 CPF (individual taxpayer ID) number
000.000.000-00
nome_completo
Individual
string 2-60 Full name
nome_estrangeiro
Foreign
string 2-60 Name of the foreign recipient, required when there is no CPF or CNPJ. In that case, the delivery group is not included in the XML.
cod_pais
Foreign
string 4 Country code (BACEN standard, from the Central Bank of Brazil)
E.g.: United States = 2496
View the BACEN table (in Portuguese)
pais
Foreign
string 1-60 Name of the delivery country
uf
Company
Individual
Foreign
string 2 State of the delivery address. Required when you do not send nome_estrangeiro.
Send "EX" for abroad
cep
Company
Individual
string 8 CEP (postal code) of the delivery address. Required when you do not send nome_estrangeiro. Send it as text to keep leading zeros.
endereco
string 2-60 Street address for delivery of the products
numero
string 1-60 Street number for delivery of the products
complemento
string 1-60 Additional details (complement) of the delivery address
bairro
string 2-60 Neighborhood of the delivery address
cidade
string 2-60 City of the delivery address
telefone
string 6-14 Phone number, as text; punctuation is removed when the XML is built.
email
string 1-60 Email

Example of how to add the delivery location information:

{
  ...
  "pedido": {
     ...
  },
  "transporte": {
     ...
     "entrega": {
         "cnpj": "00.000.000/0000-00",
         "razao_social": "Nome da empresa LTDA",
         "ie": "0000000000",
         "endereco": "Av. Brg. Faria Lima",
         "numero": "1000",
         "complemento": "Escritório",
         "bairro": "Itaim Bibi",
         "cidade": "São Paulo",
         "cep": "00000-000",
         "uf": "SP",
         "telefone": "(00) 0000-0000",
         "email": "nome@email.com"
     }
  }
}

Issuing an invoice > Transport
Pickup location

The details that identify the pickup location go in the retirada object, as a complement of the transporte object.

Parameter NF-e Type Size Description
cnpj
Company
string 14 CNPJ (company ID)
00.000.000/0000-00
razao_social
Company
string 2-60 Legal name
ie
Company
string 2-14 State registration (IE) number
cpf
Individual
string 11 CPF (individual taxpayer ID) number
000.000.000-00
nome_completo
Individual
string 2-60 Full name
nome_estrangeiro
Foreign
string 2-60 Name of the shipper, required when there is no CPF or CNPJ. Without a CPF/CNPJ, the pickup group is not included in the XML.
cod_pais
Foreign
string 4 Country code (BACEN standard, from the Central Bank of Brazil)
E.g.: United States = 2496
View the BACEN table (in Portuguese)
pais
Foreign
string 1-60 Name of the pickup country
uf
Company
Individual
Foreign
string 2 State of the pickup address, required when there is no nome_estrangeiro.
Send "EX" for abroad
cep
Company
Individual
string 8 CEP (postal code) of the pickup address, required when there is no nome_estrangeiro. Send it as text to keep leading zeros.
endereco
string 2-60 Street address for pickup of the products
numero
string 1-60 Street number for pickup of the products
complemento
string 1-60 Additional address details (complement) for pickup of the products
bairro
string 2-60 Neighborhood for pickup of the products
cidade
string 2-60 City for pickup of the products
telefone
string 6-14 Phone number
email
string 1-60 Email

Example of how to add the pickup location information:

{
  ...
  "pedido": {
     ...
  },
  "transporte": {
     ...
     "retirada": {
         "cnpj": "00.000.000/0000-00",
         "razao_social": "Nome da empresa LTDA",
         "ie": "0000000000",
         "endereco": "Av. Brg. Faria Lima",
         "numero": "1000",
         "complemento": "Escritório",
         "bairro": "Itaim Bibi",
         "cidade": "São Paulo",
         "cep": "00000-000",
         "uf": "SP",
         "telefone": "(00) 0000-0000",
         "email": "nome@email.com"
     }
  }
}

Issuing an invoice
Billing

Send the billing data in the object fatura, at the root of the JSON, with the fields numero, valor, desconto and valor_liquido.

Parameter NF-e Type Size Description
numero
string 1-60 Bill number
E.g.: 12345
valor
string 13v2 Original amount of the bill
0.00
desconto
string 13v2 Discount amount
0.00
valor_liquido
string 13v2 Net amount of the bill
0.00

Example with the billing data:

{
  ...
  "pedido": {
     ...
  },
  "fatura": {
     "numero": "000001",
     "valor": "100.00",
     "desconto": "0.00",
     "valor_liquido": "100.00"
  }
}

Issuing an invoice
Installments

In layout version 4.00, installments replaced the old trade bills (duplicatas). Send them in the array parcelas, with one object per installment. Each object needs the fields vencimento and valor. The installment number is generated automatically in the sequence 001, 002 and so on. Since September 3, 2018, you must send the billing data (fatura) together with the installments.

Parameter NF-e Type Size Description
vencimento
string 10 Due date
Format: YYYY-MM-DD
valor
string 13v2 Installment amount
0.00

Example with the installments:

{
  ...
  "pedido": {
     ...
  },
  "fatura": {
     "numero": "000001",
     "valor": "100.00",
     "desconto": "0.00",
     "valor_liquido": "100.00"
  },
  "parcelas": [
     {
        "vencimento": "2018-06-01",
        "valor": "50.00"
     },
     {
        "vencimento": "2018-07-01",
        "valor": "50.00"
     }
  ]
}

Issuing an invoice
Export

Send the export data in the object exportacao, as shown in the Invoice Information table.

Parameter NF-e Type Size Description
uf_embarque
string 2 Abbreviation of the state (UF) where the goods are shipped or cross the border
local_embarque
string 1-60 Description of the place where the goods are shipped or cross the border
local_despacho
string 1-60 Description of the customs clearance place (the customs-bonded area)

Example with the export data:

{
  ...
  "pedido": {
     ...
  },
  "exportacao": {
     "uf_embarque": "SP",
     "local_embarque": "Aeroporto Internacional de São Paulo"
  }
}

Issuing an invoice
Agriculture and livestock NEW

Use the group agropecuario to send data about agricultural and livestock products in an NF-e or NFC-e. Send only one of the blocks below: the pesticide prescriptions or the matching transit permit.

Parameter NF-e / NFC-e Type Size Description
defensivos
array 1-20 List of agricultural pesticide prescriptions. Required when there is no transit permit. Do not send both blocks together.
guia_transito
object --- Data of the agricultural transit permit. Required when there is no defensivos. Do not send both blocks together.

Agricultural pesticides

Parameter NF-e / NFC-e Type Size Description
numero_receituario
string 1-30 Number of the pesticide prescription.
cpf_responsavel_tecnico
string 11 Valid CPF (individual taxpayer ID) of the technical officer responsible for the prescription.
Send it as text; punctuation is removed before the XML is generated.

Agricultural transit permit

Parameter NF-e / NFC-e Type Size Description
tipo
integer or numeric string 1 after normalization Permit type:1 - GTA;
2 - TTA;
3 - DTA;
4 - ATV;
5 - PTV;
6 - GTV;
7 - Forest permit (Guia Florestal: DOF, SisFlora-PA/MT, SIAM-MG).
uf
string 2 State (UF) that issued the transit permit, normalized to the uppercase abbreviation.
serie
string 1-9 Permit series.
When applicable.
numero
string 1-9 Permit number.
Digits only.

Example with a pesticide prescription:

{
  ...
  "agropecuario": {
    "defensivos": [
      {
        "numero_receituario": "123456789",
        "cpf_responsavel_tecnico": "01234567890"
      }
    ]
  }
}

Example with a transit permit:

{
  ...
  "agropecuario": {
    "guia_transito": {
      "tipo": 1,
      "uf": "PR",
      "serie": "001",
      "numero": "123456"
    }
  }
}

Issuing an invoice
Government purchase NEW

For purchases made by government entities, add the object compra_governamental at the root of the payload. Valid only for NF-e (model 55).

Parameter NF-e Type Size Description
tipo_ente_governamental
string 1 Type of government entity.
1 - Federal Government
2 - State
3 - Federal District
4 - City
5 - Public consortium
6 - IBS Management Committee (Comitê Gestor do IBS)
percentual_redutor
string 3v0-4 Percentage that reduces the effective IBS/CBS rate in a government purchase.
0 to 100, with up to 4 decimal places. It reduces the effective rate of the item (pAliqEfet) and fills the group gTribCompraGov in the XML.
tipo_operacao_governamental
string 1 Type of transaction with the government entity.
1 - Supply with later payment
2 - Receipt of payment for a supply already made
3 - Supply with payment already made
4 - Receipt of payment with later supply

Attention: when 2, the invoice carries only IBS/CBS. Do not send ICMS, ISSQN, IPI, PIS or COFINS in the products, and codigo_cfop is required for each product.
dfes_anteriores
string or array (strings) 44 per key Access keys of earlier tax documents.
Do not send keys when tipo_operacao_governamental = 1. Exactly 1 key when the type = 2. One or more keys when the type = 3. Optional when the type = 4.

Example of the Government Purchase group:

"compra_governamental": {
  "tipo_ente_governamental": "1",
  "percentual_redutor": "5.0000",
  "tipo_operacao_governamental": "1"
}

Tax Class

There are two ways to set the taxes of an invoice: with a registered Tax Class or directly in the API (see How to send the taxes).

A Tax Class groups the tax settings of ICMS (state sales tax), IPI (federal manufacturing tax), PIS, COFINS (federal revenue taxes) and ISS (city service tax), so the taxes are calculated automatically. You set it up once. It makes issuing easier for MEI (individual micro-entrepreneur), Simples Nacional (small business regime), Lucro Presumido (presumed profit) and standard regime (regime normal) companies.

You can create, edit, list and delete a Tax Class in the Webmania® Panel or through the API. When you issue an invoice, send the reference of the Tax Class in classe_imposto on each product:

{
  "produtos": [
    {
      "nome": "Nome do produto",
      "codigo": "nome-do-produto",
      "classe_imposto": "REF000000"
    },
    {
      "nome": "Nome do produto",
      "codigo": "nome-do-produto",
      "classe_imposto": "REF000000"
    }
  ]
}

Tax Class
Create/edit product taxes

A product Tax Class sets the ICMS, IPI, PIS, COFINS, ISSQN and IBS/CBS used to issue an NF-e (electronic invoice for goods) and an NFC-e (consumer receipt).

To create or edit a Tax Class, send a POST request to the URL /1/nfe/classe-imposto/.

The body is a JSON object with the parameters below. To create a class, do not send referencia. With referencia, the Tax Class of the authenticated company is updated with the new data. Leaving out an optional field does not guarantee that the saved value is removed. In the edit example, replace REF000000 with a real reference of the company.

The parameters icms, ipi, pis, cofins, issqn must be sent as an array, and each object is one specific tax scenario.

Parameter NF-e / NFC-e Type Size Description
referencia
string --- Reference of an existing Tax Class.
When sent, the Tax Class of the authenticated company is updated with the new parameters; optional fields you leave out can keep their saved value.
descricao
string --- Description of the Tax Class
icms
array (objects) --- ICMS tax scenarios. The ICMS is the state sales tax, calculated on each item (tax base × rate); each state sets its own rates and rules.
ipi
array (objects) --- IPI tax scenarios. The IPI is the federal tax on manufactured and imported goods; its rate depends on the NCM of the product.
pis
array (objects) --- PIS tax scenarios. PIS and COFINS are federal contributions on the revenue of the company, each with its own CST on the item; the CBS replaces them from 2027.
cofins
array (objects) --- COFINS tax scenarios
issqn
array (objects) --- ISSQN tax scenarios. The ISSQN (ISS) is the city tax on services; each city sets its rate.
ibs_cbs
array (objects) --- IBS/CBS tax scenarios. IBS and CBS are the new value-added taxes of the tax reform, calculated on each item from a CST and a cClassTrib.
informacoes_fisco
string --- Information for the tax authority
informacoes_complementares
string --- Additional information for the consumer

Example of a Tax Class for Simples Nacional, for outbound sales of resale products:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "referencia" : "REF000000",
  "descricao": "Classe de impostos para Saída de produtos de revenda",
  "icms": [
      {
        "tipo_tributacao": "simples_nacional",
        "cenario": "saida_dentro_estado",
        "tipo_pessoa": "fisica",
        "codigo_cfop": "5102",
        "situacao_tributaria": "102"
      },
      {
        "tipo_tributacao": "simples_nacional",
        "cenario": "saida_fora_estado",
        "tipo_pessoa": "fisica",
        "codigo_cfop": "6102",
        "situacao_tributaria": "102"
      },
      {
        "tipo_tributacao": "simples_nacional",
        "cenario": "saida_dentro_estado",
        "tipo_pessoa": "juridica",
        "codigo_cfop": "5102",
        "situacao_tributaria": "102"
      },
      {
        "tipo_tributacao": "simples_nacional",
        "cenario": "saida_fora_estado",
        "tipo_pessoa": "juridica",
        "codigo_cfop": "6102",
        "situacao_tributaria": "102"
      }
    ],
    "ipi": [
      {
        "cenario": "padrao",
        "tipo_pessoa": "fisica",
        "situacao_tributaria": "99",
        "codigo_enquadramento": "999",
        "aliquota": "0.00"
      },
      {
        "cenario": "padrao",
        "tipo_pessoa": "juridica",
        "situacao_tributaria": "99",
        "codigo_enquadramento": "999",
        "aliquota": "0.00"
      }
    ],
    "pis": [
      {
        "cenario": "padrao",
        "tipo_pessoa": "fisica",
        "situacao_tributaria": "99",
        "aliquota": "0.00"
      },
      {
        "cenario": "padrao",
        "tipo_pessoa": "juridica",
        "situacao_tributaria": "99",
        "aliquota": "0.00"
      }
    ],
    "cofins": [
      {
        "cenario" : "padrao",
        "tipo_pessoa": "fisica",
        "situacao_tributaria": "99",
        "aliquota": "0.00"
      },
      {
        "cenario" : "padrao",
        "tipo_pessoa": "juridica",
        "situacao_tributaria": "99",
        "aliquota": "0.00"
      }
    ]
}' \
https://webmania.com.br/api/1/nfe/classe-imposto/

On creation, a successful response is a JSON object with referencia, descricao and data, as in the illustrative example below. On edit, it returns referencia and msg with the message "Classe de imposto atualizada." (Tax Class updated). Validation failures return error; check the response body.

{
  "referencia": "REF0000000",
  "descricao": "Classe de impostos para Saída de produtos de revenda",
  "data": "0000-00-00 00:00:00"
}

Tax Class
Scenarios

Each Tax Class has a unique reference number (e.g. REF00000). It lets you set tax scenarios for the transactions and recipient types that each tax accepts.

We recommend that the scenarios of each Tax Class share the same nature of the transaction, such as in-state and interstate outbound sales to individuals and companies.

Rates in the Tax Class use a dot as the decimal separator (e.g. 5.00). When a required rate is zero, send "0.00": the values 0 and "0" are treated as not sent.

What each scenario means:

Scenario Recipient Description
padrao Individual
Company
Foreign
Default scenario for every inbound/outbound variation and every recipient type: individual, company or foreign.
Scenario not available for ICMS
saida_dentro_estado Individual
Company
Scenario for outbound transactions inside the state.
saida_fora_estado Individual
Company
Scenario for outbound interstate transactions.
entrada_dentro_estado Individual
Company
Scenario for inbound transactions inside the state.
entrada_fora_estado Individual
Company
Scenario for inbound interstate transactions.
saida_exterior Foreign Scenario for export transactions.
entrada_exterior Individual
Company
Scenario for import transactions.
ICMS
Parameter NF-e / NFC-e Type Size Description
tipo_tributacao
string --- Tax type of the ICMS scenario. For a Simples Nacional company above the sublimit, use tributacao_normal.
simples_nacional
tributacao_normal
cenario
string --- Tax scenario
saida_dentro_estado
saida_fora_estado
saida_exterior
entrada_dentro_estado
entrada_fora_estado
entrada_exterior
tipo_pessoa
string --- Person type
fisica
juridica
estrangeiro
nao_contribuinte
boolean --- Send true when the scenario applies only to an individual or a company that does not pay ICMS, is exempt from state registration (IE) or is the final consumer.
codigo_cfop
string --- CFOP (transaction code), the 4-digit code that says what kind of transaction the item is: first digit 5 = inside the state, 6 = to another state, 7 = abroad (5102 = a sale inside the state).
0.000
situacao_tributaria
string 2-3 ICMS CST or CSOSN (tax status code): tells the tax authority how the ICMS applies to the item (taxed, exempt, deferred, tax substitution…). CST (2 digits) for standard taxation, CSOSN (3 digits) for Simples Nacional.
Simples Nacional:
101 - Taxed with credit allowed
102 - Taxed without credit allowed
103 - ICMS exemption for the gross revenue bracket
201 - Taxed with credit allowed and with ICMS collected by tax substitution
202 - Taxed without credit allowed and with ICMS collected by tax substitution
203 - ICMS exemption for the gross revenue bracket and with ICMS collected by tax substitution
300 - Immune
400 - Not taxed
500 - ICMS already collected by tax substitution (substituted) or in advance
900 - Other

Standard taxation:
00 - Fully taxed
10 - Taxed and with ICMS collected by tax substitution
20 - With tax base reduction
30 - Exempt or not taxed and with ICMS collected by tax substitution
40 - Exempt
41 - Not taxed
50 - Suspension
51 - Deferral
60 - ICMS already collected by tax substitution
70 - With tax base reduction and ICMS collected by tax substitution
90 - Other
aliquota_importacao
string 3v2 *Required for an import invoice:
ICMS rate on imports.
0.00
aliquota_credito
string 3v2 *Required for CST 101 or 201:
Rate used to calculate the credit.
0.00
aliquota_reducao_destino
string 3v2 Percentage of the ICMS tax base reduction in the destination state (DIFAL, interstate rate difference: on a sale to a final consumer in another state, the destination state receives the difference between its ICMS rate and the interstate rate), different from the reduction in the origin state. When you create or edit the class, it is normalized to 2 decimal places for codes 20, 70, 90, 201, 202, 203 and 900. How this field is handled when you issue directly or import an XML does not replace the normalization of the class.
aliquota_mva
array (objects) --- Percentage of the original MVA (added value margin, also called original IVA) used to calculate ICMS-ST (ICMS tax substitution: one company in the chain, usually the manufacturer or importer, collects in advance the ICMS of the next sales, on a base estimated with this margin). Required for codes 10, 30, 70, 201, 202 and 203; optional for 90 and 900; sent per state (UF). The adjusted MVA is set automatically for each scenario.
aliquota_icms
array (objects) --- (Optional) Webmania® calculates the ICMS and its tax base automatically.
aliquota_icms_st
array (objects) --- (Optional) Webmania® calculates the ICMS-ST and its tax base automatically.
aliquota_fcp
array (objects) --- (Optional) Webmania® calculates the FCP (Fundo de Combate à Pobreza, a small extra ICMS percentage some states charge on certain goods, collected with the ICMS) and its tax base automatically.
aliquota_fcp_st
array (objects) --- (Optional) Webmania® calculates the FCP-ST and its tax base automatically.
aliquota_diferimento
string 3v4 Deferral percentage. Required for code 51 when you create or edit the class; normalized to 4 decimal places.
0.0000
aliquota_diferimento_fcp
string 3v4 Deferral percentage of the ICMS that goes to the poverty fund (FCP). Optional for code 51; normalized to 4 decimal places in the class.
0.0000
aliquota_reducao
string 3v2 Percentage of the ICMS tax base reduction, normalized to 2 decimal places in the class. Applies to codes 20, 70, 90, 201, 202, 203 and 900.
0.00
aliquota_reducao_st
string 3v2 Percentage of the ICMS-ST tax base reduction, normalized to 2 decimal places in the class. Applies to codes 10, 30, 70, 90, 201, 202, 203 and 900.
0.00
aliquota_efetiva_icms
string3v2Effective ICMS burden, normalized to 2 decimal places and saved for codes 20, 70, 90, 201, 202, 203 and 900.
aliquota_efetiva_icms_st
string3v4Effective ICMS-ST burden, normalized to 4 decimal places and saved for codes 10, 30, 70, 90, 201, 202, 203 and 900. Acceptance in the class does not exempt the invoice from the tax rules applied when it is issued.
codigo_beneficio_reducao_bc
string8 or 10Tax benefit code of the tax base reduction in the deferral. It must be a string with exactly 8 or 10 characters after removing spaces at both ends. Saved only for code 51.
motivo_desoneracao
string 1-2 Code of the reason for the ICMS relief (desoneração), for codes 20, 30, 40, 41, 50, 51, 70 and 90. Reasons 10 and 11 are accepted only for code 20.
3 - Use in agriculture and livestock
9 - Other
10 - Disabled driver (Convênio ICMS 38/12) NEW
11 - Disabled non-driver (Convênio ICMS 38/12) NEW
12 - Agricultural development agency
deducao_desoneracao NEW
string 1 Says whether the relieved ICMS must be deducted from the item amount and from the NF-e total. Saved only with motivo_desoneracao for codes 20, 30, 40, 41, 50, 51, 70 and 90.
0 - No
1 - Yes
motivo_desoneracao_st
string 1-2 Code of the reason for the ICMS-ST relief, saved for codes 20, 40, 41, 50, 51, 70 and 90.
3 - Use in agriculture and livestock
9 - Other
12 - Agricultural development agency
beneficio_fiscal
array (objects) --- Tax benefit code in the state (UF). Send it separately for each state that requires it.
Use the same code used in the EFD and other tax returns, in the states that require it.
credito_presumido
array (objects) --- Specific breakdown of the presumed credit.
Learn more
{
  "icms": [
    {
      "tipo_tributacao": "simples_nacional",
      "cenario": "saida_dentro_estado",
      "tipo_pessoa": "juridica",
      "codigo_cfop": "5102",
      "situacao_tributaria": "101",
      "aliquota_credito": "2.00"
    },
    {
      "tipo_tributacao": "simples_nacional",
      "cenario": "saida_fora_estado",
      "tipo_pessoa": "juridica",
      "codigo_cfop": "6102",
      "situacao_tributaria": "101",
      "aliquota_credito": "2.00"
    }
  ]
}
ICMS > MVA rate
Parameter Required Type Size Description
estado
string 2 State abbreviation (UF)
e.g. PR
aliquota
string 3v2 Rate value
0.00
{
  "icms": [
    {
      ...
      "aliquota_mva" : [
        {
          "estado" : "PR",
          "aliquota" : "32.00"
        },
        {
          "estado" : "SC",
          "aliquota" : "32.00"
        },
        {
          "estado" : "RS",
          "aliquota" : "32.00"
        }
      ]
    }
  ]
}
ICMS > ICMS rate
Parameter Required Type Size Description
estado
string 2 State abbreviation (UF)
e.g. PR
aliquota
string 3v2 Rate value
0.00
{
  "icms": [
    {
      ...
      "aliquota_icms" : [
        {
          "estado" : "PR",
          "aliquota" : "32.00"
        },
        {
          "estado" : "SC",
          "aliquota" : "32.00"
        },
        {
          "estado" : "RS",
          "aliquota" : "32.00"
        }
      ]
    }
  ]
}
ICMS > ICMS-ST rate
Parameter Required Type Size Description
estado
string 2 State abbreviation (UF)
e.g. PR
aliquota
string 3v2 Rate value
0.00
{
  "icms": [
    {
      ...
      "aliquota_icms_st" : [
        {
          "estado" : "PR",
          "aliquota" : "32.00"
        },
        {
          "estado" : "SC",
          "aliquota" : "32.00"
        },
        {
          "estado" : "RS",
          "aliquota" : "32.00"
        }
      ]
    }
  ]
}
ICMS > FCP rate
Parameter Required Type Size Description
estado
string 2 State abbreviation (UF)
e.g. PR
aliquota
string 3v2 Rate value
0.00
{
  "icms": [
    {
      ...
      "aliquota_fcp" : [
        {
          "estado" : "PR",
          "aliquota" : "32.00"
        },
        {
          "estado" : "SC",
          "aliquota" : "32.00"
        },
        {
          "estado" : "RS",
          "aliquota" : "32.00"
        }
      ]
    }
  ]
}
ICMS > FCP-ST rate
Parameter Required Type Size Description
estado
string 2 State abbreviation (UF)
e.g. PR
aliquota
string 3v2 Rate value
0.00
{
  "icms": [
    {
      ...
      "aliquota_fcp_st" : [
        {
          "estado" : "PR",
          "aliquota" : "32.00"
        },
        {
          "estado" : "SC",
          "aliquota" : "32.00"
        },
        {
          "estado" : "RS",
          "aliquota" : "32.00"
        }
      ]
    }
  ]
}
ICMS > Tax benefit
Parameter NF-e / NFC-e Type Size Description
estado
string 2 State abbreviation (UF)
DF, ES, GO, PR, RJ, RS, SC or SP
codigo
string --- Tax benefit code
{
  "icms": [
    {
      "tipo_tributacao": "tributacao_normal",
      "cenario": "saida_dentro_estado",
      "tipo_pessoa": "juridica",
      "codigo_cfop": "5102",
      "situacao_tributaria": "20",
      "beneficio_fiscal" : [
        {
          "estado" : "PR",
          "codigo" : "AA0000"
        },
        {
          "estado" : "SC",
          "codigo" : "AA0000"
        },
        {
          "estado" : "RS",
          "codigo" : "AA0000"
        }
      ]
    }
  ]
}
ICMS > Presumed credit
Parameter NF-e / NFC-e Type Size Description
estado
string 2 State abbreviation (UF)
e.g. PR
codigo_beneficio_fiscal
string 8 or 10 Presumed credit tax benefit code in the state (UF), with exactly 8 or 10 characters (9 is not accepted).
aliquota
string 3v4 Presumed credit rate
0.0000
{
  "icms": [
    {
      "tipo_tributacao": "tributacao_normal",
      "cenario": "saida_dentro_estado",
      "tipo_pessoa": "juridica",
      "codigo_cfop": "5102",
      "situacao_tributaria": "20",
      "credito_presumido" : [
        {
          "estado" : "PR",
          "codigo_beneficio_fiscal" : "EFDBHNT5",
          "aliquota" : "6.0000"
        },
        {
          "estado" : "SC",
          "codigo_beneficio_fiscal" : "5H3FVBNJKM",
          "aliquota" : "8.0000"
        }
      ]
    }
  ]
}
IPI
Parameter Required Type Size Description
cenario
string --- Tax scenario
padrao
saida_dentro_estado
saida_fora_estado
saida_exterior
entrada_dentro_estado
entrada_fora_estado
entrada_exterior
tipo_pessoa
string --- Person type
fisica
juridica
estrangeiro
situacao_tributaria
string 2 IPI CST (tax status code)
00 - Inbound with credit recovery
01 - Inbound taxed at zero rate
02 - Inbound exempt
03 - Inbound not taxed
04 - Inbound immune
05 - Inbound with suspension
49 - Other inbound
50 - Outbound taxed
51 - Outbound taxed at zero rate
52 - Outbound exempt
53 - Outbound not taxed
54 - Outbound immune
55 - Outbound with suspension
99 - Other outbound
codigo_enquadramento
string 1-3 Legal framework code (código de enquadramento). For CST 52, the generic code 999 is not accepted; send the specific framework code.
aliquota
string 3v2 IPI rate
0.00
{
  "ipi": [
    {
      "cenario": "padrao",
      "tipo_pessoa": "fisica",
      "situacao_tributaria": "99",
      "codigo_enquadramento": "999",
      "aliquota": "0.00"
    },
    {
      "cenario": "padrao",
      "tipo_pessoa": "juridica",
      "situacao_tributaria": "99",
      "codigo_enquadramento": "999",
      "aliquota": "0.00"
    }
  ]
}
PIS
Parameter Required Type Size Description
cenario
string --- Tax scenario
padrao
saida_dentro_estado
saida_fora_estado
saida_exterior
entrada_dentro_estado
entrada_fora_estado
entrada_exterior
tipo_pessoa
string --- Person type.
fisica
juridica
estrangeiro
situacao_tributaria
string 2 PIS CST (tax status code)
01 - Taxable transaction - Tax base = transaction amount, standard rate (cumulative/non-cumulative)
02 - Taxable transaction - Tax base = transaction amount (differentiated rate)
03 - Taxable transaction - Tax base = quantity sold x rate per product unit
04 - Taxable transaction - Single-phase taxation - (zero rate)
05 - Taxable transaction - (tax substitution)
06 - Taxable transaction (zero rate)
07 - Transaction exempt from the contribution
08 - Transaction outside the scope of the contribution
09 - Transaction with the contribution suspended
49 - Other outbound transactions
50 - Transaction with right to credit - linked only to taxed revenue in the domestic market
51 - Transaction with right to credit - linked only to non-taxed revenue in the domestic market
52 - Transaction with right to credit - linked only to export revenue
53 - Transaction with right to credit - linked to taxed and non-taxed revenue in the domestic market
54 - Transaction with right to credit - linked to taxed revenue in the domestic market and export revenue
55 - Transaction with right to credit - linked to non-taxed revenue in the domestic market and export revenue
56 - Transaction with right to credit - linked to taxed and non-taxed revenue in the domestic market, and export revenue
60 - Presumed credit - purchase linked only to taxed revenue in the domestic market
61 - Presumed credit - purchase linked only to non-taxed revenue in the domestic market
62 - Presumed credit - purchase linked only to export revenue
63 - Presumed credit - purchase linked to taxed and non-taxed revenue in the domestic market
64 - Presumed credit - purchase linked to taxed revenue in the domestic market and export revenue
65 - Presumed credit - purchase linked to non-taxed revenue in the domestic market and export revenue
66 - Presumed credit - purchase linked to taxed and non-taxed revenue in the domestic market, and export revenue
67 - Presumed credit - other transactions
70 - Purchase without right to credit
71 - Purchase with exemption
72 - Purchase with suspension
73 - Purchase at zero rate
74 - Purchase outside the scope of the contribution
75 - Purchase by tax substitution
98 - Other inbound transactions
99 - Other transactions
aliquota
string 3v2 PIS rate
0.00
{
  "pis": [
    {
      "cenario": "padrao",
      "tipo_pessoa": "fisica",
      "situacao_tributaria": "99",
      "aliquota": "0.00"
    },
    {
      "cenario": "padrao",
      "tipo_pessoa": "juridica",
      "situacao_tributaria": "99",
      "aliquota": "0.00"
    }
  ]
}
COFINS
Parameter Required Type Size Description
cenario
string --- Tax scenario
padrao
saida_dentro_estado
saida_fora_estado
saida_exterior
entrada_dentro_estado
entrada_fora_estado
entrada_exterior
tipo_pessoa
string --- Person type
fisica
juridica
estrangeiro
situacao_tributaria
string 2 COFINS CST (tax status code)
01 - Taxable transaction - Tax base = transaction amount, standard rate (cumulative/non-cumulative)
02 - Taxable transaction - Tax base = transaction amount (differentiated rate)
03 - Taxable transaction - Tax base = quantity sold x rate per product unit
04 - Taxable transaction - Single-phase taxation - (zero rate)
05 - Taxable transaction - (tax substitution)
06 - Taxable transaction (zero rate)
07 - Transaction exempt from the contribution
08 - Transaction outside the scope of the contribution
09 - Transaction with the contribution suspended
49 - Other outbound transactions
50 - Transaction with right to credit - linked only to taxed revenue in the domestic market
51 - Transaction with right to credit - linked only to non-taxed revenue in the domestic market
52 - Transaction with right to credit - linked only to export revenue
53 - Transaction with right to credit - linked to taxed and non-taxed revenue in the domestic market
54 - Transaction with right to credit - linked to taxed revenue in the domestic market and export revenue
55 - Transaction with right to credit - linked to non-taxed revenue in the domestic market and export revenue
56 - Transaction with right to credit - linked to taxed and non-taxed revenue in the domestic market, and export revenue
60 - Presumed credit - purchase linked only to taxed revenue in the domestic market
61 - Presumed credit - purchase linked only to non-taxed revenue in the domestic market
62 - Presumed credit - purchase linked only to export revenue
63 - Presumed credit - purchase linked to taxed and non-taxed revenue in the domestic market
64 - Presumed credit - purchase linked to taxed revenue in the domestic market and export revenue
65 - Presumed credit - purchase linked to non-taxed revenue in the domestic market and export revenue
66 - Presumed credit - purchase linked to taxed and non-taxed revenue in the domestic market, and export revenue
67 - Presumed credit - other transactions
70 - Purchase without right to credit
71 - Purchase with exemption
72 - Purchase with suspension
73 - Purchase at zero rate
74 - Purchase outside the scope of the contribution
75 - Purchase by tax substitution
98 - Other inbound transactions
99 - Other transactions
aliquota
string 3v2 COFINS rate
0.00
{
  "cofins": [
    {
      "cenario": "padrao",
      "tipo_pessoa": "fisica",
      "situacao_tributaria": "99",
      "aliquota": "0.00"
    },
    {
      "cenario": "padrao",
      "tipo_pessoa": "juridica",
      "situacao_tributaria": "99",
      "aliquota": "0.00"
    }
  ]
}
ISSQN
Parameter Required Type Size Description
cenario
string --- Tax scenario
padrao
saida_dentro_estado
saida_fora_estado
saida_exterior
entrada_dentro_estado
entrada_fora_estado
entrada_exterior
tipo_pessoa
string --- Person type
fisica
juridica
estrangeiro
codigo_cfop
string --- CFOP (transaction code)
0.000
exigibilidade
string 1 ISS enforceability indicator
1 - Due
2 - Not applicable
3 - Exemption
4 - Export
5 - Immunity
6 - Suspended by court decision
7 - Suspended by administrative proceeding
item_servico
string --- Item of the service list that classifies the service in the ABRASF standard
00.00
incentivo_fiscal
string 1 Tax incentive indicator
1 - Yes
2 - No
aliquota
string 3v2 ISSQN rate
0.00
municipio
string --- City where the tax is due
codigo_servico
string 1-20 Code of the service provided in the city
{
  "issqn": [
    {
      "cenario": "padrao",
      "tipo_pessoa": "fisica",
      "codigo_cfop": "5.933",
      "exigibilidade": "1",
      "item_servico": "00.00",
      "incentivo_fiscal": "2",
      "aliquota": "5.00"
    },
    {
      "cenario": "padrao",
      "tipo_pessoa": "juridica",
      "codigo_cfop": "5.933",
      "exigibilidade": "1",
      "item_servico": "00.00",
      "incentivo_fiscal": "2",
      "aliquota": "5.00"
    }
  ]
}
IBS/CBS
Parameter Required Type Size Description
cenario
string --- Tax scenario
padrao
saida_dentro_estado
saida_fora_estado
saida_exterior
entrada_dentro_estado
entrada_fora_estado
entrada_exterior
tipo_pessoa
string --- Person type
padrao
fisica
juridica
estrangeiro
situacao_tributaria
string 3 IBS and CBS CST (tax status code).
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
classificacao_tributaria
string 6 cClassTrib (tax classification code) of IBS and CBS, the new code of the tax reform that, together with the IBS/CBS CST, says how IBS and CBS apply to the item (standard rate, reduced rate, exemption…).
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
situacao_tributaria_regular
string 3 IBS and CBS CST (tax status code) in the regular regime.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed in the regular regime.
classificacao_tributaria_regular
string 6 IBS and CBS cClassTrib (tax classification code) in the regular regime.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed in the regular regime.
codigo_atividade_sn NEW
string 2 Simples Nacional activity code used on the items with this class. 01, 02, 03, 04 or 90, as a string. The meaning of each code and the priority order are in IBS/CBS — Simples Nacional. The three Simples Nacional fields are checked when the invoice is issued. Send null or "" to clear the saved value.
aliquota_ibs_sn NEW
string 3v4 IBS rate under Simples Nacional, in %. From 0 to 100, with a dot and up to four decimal places. The rate sent on the invoice item takes priority.
aliquota_cbs_sn NEW
string 3v4 CBS rate under Simples Nacional, in %. From 0 to 100, with a dot and up to four decimal places. The rate sent on the invoice item takes priority.
ibs_estadual
object --- Deferral data of the state IBS. Optional when the tax status allows deferral; ignored in other cases.
ibs_municipal
object --- Deferral data of the city IBS. Optional when the tax status allows deferral; ignored in other cases.
cbs
object --- Deferral data of the CBS. Optional when the tax status allows deferral; ignored in other cases.
credito_presumido
object --- Presumed credit data. Optional when the cClassTrib (tax classification) allows a presumed credit; ignored in other cases.
IBS/CBS > Deferral
Parameter Required Type Size Description
aliquota_diferimento
number 3v4 Deferral rate of the state IBS, city IBS or CBS, when sent.
IBS/CBS > Presumed credit
Parameter Required Type Size Description
classificacao
string 1-2 Classification code of the presumed credit, sent as a string from "1" to "13".
aliquota_ibs
number 3v4 Presumed credit percentage for the IBS. Required when the credit classification code applies to the IBS.
aliquota_cbs
number 3v4 Presumed credit percentage for the CBS. Required when the credit classification code applies to the CBS.
{
  "ibs_cbs": [
    {
      "cenario": "saida_dentro_estado",
      "tipo_pessoa": "juridica",
      "situacao_tributaria": "000",
      "classificacao_tributaria": "000001"
    },
    {
      "cenario": "saida_fora_estado",
      "tipo_pessoa": "juridica",
      "situacao_tributaria": "510",
      "classificacao_tributaria": "510001",
      "ibs_estadual": {
        "aliquota_diferimento": 2.5
      },
      "ibs_municipal": {
        "aliquota_diferimento": 1.5
      },
      "cbs": {
        "aliquota_diferimento": 0.9
      }
    },
    {
      "cenario": "saida_dentro_estado",
      "tipo_pessoa": "fisica",
      "situacao_tributaria": "000",
      "classificacao_tributaria": "000003",
      "credito_presumido": {
        "classificacao": "3",
        "aliquota_ibs": 2.5,
        "aliquota_cbs": 1.5
      }
    }
  ]
}

Tax Class
Create/edit service taxes

A service Tax Class sets the taxes used to issue an NFS-e (service invoice).

To create or edit a service Tax Class, send a POST request to the URL /1/nfe/classe-imposto/.

The body is a JSON object with the parameters below. With referencia, the matching class is updated with the new data; without it, a new class is created.

Note: The parameters to create the Tax Class can vary by provider (the system used by each city hall). Check the provider of your city when you look up the status. Learn more
Parameter NFS-e Type Size Description
referencia
string --- Reference of an existing Tax Class.
When sent, the matching Tax Class is replaced with the new parameters.
descricao
string --- Description of the Tax Class
tipo
string --- Type of the Tax Class
nfse
ibs_cbs
object --- IBS/CBS tax data
iss
number 1-100 ISS rate
0.00
pis
number 1-100 PIS rate
0.00
cofins
number 1-100 COFINS rate
0.00
inss
number 1-100 INSS rate
0.00
ir
number 1-100 IR rate
0.00
csll
number 1-100 CSLL rate
0.00

Example of a Tax Class for the Abrasf provider:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "referencia" : "REF000000",
  "descricao": "Classe de impostos para prestação de serviço",
  "tipo": "nfse",
  "codigo_servico": "01.01",
  "natureza_operacao": 1,
  "exigibilidade_iss": 1,
  "iss_retido": 2,
  "iss": 2
}' \
https://webmania.com.br/api/1/nfe/classe-imposto/

On creation, the response is a JSON object with referencia, descricao and data, as in the example below. On edit, the response has referencia and msg, with the message "Classe de imposto atualizada." (Tax Class updated).

{
  "referencia": "REF0000000",
  "descricao": "Classe de impostos para prestação de serviço",
  "data": "0000-00-00 00:00:00"
}
IBS/CBS
Parameter Required Type Size Description
situacao_tributaria
string 3 IBS and CBS CST (tax status code).
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
classificacao_tributaria
string 6 IBS and CBS cClassTrib (tax classification code).
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
situacao_tributaria_regular
string 3 IBS and CBS CST (tax status code) in the regular regime.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed in the regular regime.
classificacao_tributaria_regular
string 6 IBS and CBS cClassTrib (tax classification code) in the regular regime.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed in the regular regime.
ibs_estadual
object --- Deferral data of the state IBS. Required when the tax status allows deferral; ignored in other cases.
ibs_municipal
object --- Deferral data of the city IBS. Required when the tax status allows deferral; ignored in other cases.
cbs
object --- Deferral data of the CBS. Required when the tax status allows deferral; ignored in other cases.
credito_presumido
string 2 Classification code of the presumed credit. Required when the cClassTrib (tax classification) allows a presumed credit; ignored in other cases.
See the table of classifications
IBS/CBS > Deferral
Parameter Required Type Size Description
aliquota_diferimento
number 3v2 Deferral rate of the state IBS, city IBS or CBS, from 0 to 100, normalized to two decimal places.
Abrasf
Parameter Required Type Size Description
codigo_servico
string 3-5 Service code
00.00
natureza_operacao
string 1 Code of the nature of the transaction (natureza da operação)
1 - Taxed in the city
2 - Taxed outside the city
3 - Exemption
4 - Immune
5 - Suspended by court decision
6 - Suspended by administrative proceeding
exigibilidade_iss
string 1 ISS enforceability
1 - Due
2 - Not applicable
3 - Exemption
4 - Export
5 - Immunity
6 - Suspended by court decision
7 - Suspended by administrative proceeding
iss_retido
string 1 ISS withholding
1 - Yes
2 - No
responsavel_retencao
string 1 Party responsible for withholding the ISS. Required when ISS is withheld.
1 - Service buyer
2 - Intermediary
codigo_cnae
string Up to 9 CNAE code (economic activity code).
codigo_tributacao_municipio
string 1-20 City tax code.
codigo_nbs
string9NBS code of the service (Brazilian service classification), with exactly 9 digits after removing non-numeric characters.
Cecam
Parameter Required Type Size Description
codigo_cnae
string Up to 7 CNAE code, with at most 7 characters.
codigo_servico
string 3-5 Service code
00.00
local_prestacao
string 1 Place where the service is provided
1 - Provider's head office
2 - Property (civil construction)
3 - Public road
4 - Outside the city
cep_local_prestacao
string 8 CEP (postal code) of the place where the service is provided. Required when local_prestacao is 4; checked as 8 digits after removing the formatting.
00000-000
iss_retido
string 1 ISS withholding
1 - Yes
2 - No
DSF
Parameter Required Type Size Description
codigo_servico
string 3-5 Service code
00.00
tipo_tributacao
string 1 Tax type
C - Exempt from ISS
E - ISS not applicable in the city
F - Immune
K - Suspended by court decision or administrative proceeding
N - Not taxable
T - Taxable
G - Taxable, fixed amount
H - Taxable, Simples Nacional
M - Individual micro-entrepreneur (MEI)
iss_retido
string 1 ISS withholding
1 - Yes
2 - No
responsavel_retencao
string 1 Party responsible for withholding the ISS. Required when ISS is withheld.
1 - Service buyer
2 - Intermediary
codigo_cnae
string Up to 9 CNAE code, with at most 9 characters.
Florianópolis
Parameter Required Type Size Description
cfps
array (objects) --- ISS tax scenarios
id_cnae
string 4-5 ID of the service provided

Note: the CNAE ID is not the same as the CNAE code. Check the table published by the city to find the CNAE ID of the service provided.
situacao_tributaria
string 1-2 CST (tax status code) of the ISS
00 - Fully taxed
1 - Fully taxed and under the Simples Nacional regime
2 - Fully taxed with ISS withheld at source
3 - Fully taxed, under the Simples Nacional regime and with ISS withheld at source
4 - Fully taxed and under the tax substitution regime
5 - Fully taxed and under the tax substitution regime by the agent or intermediary of the service
6 - Fully taxed, under the Simples Nacional regime and under tax substitution
7 - Fully taxed with the ISS already withheld by the tax substitute
8 - Taxed with a reduced tax base or rate
9 - Taxed with a reduced tax base or rate and with ISS withheld at source
10 - Taxed with a reduced tax base or rate and under the tax substitution regime
11 - Taxed with a reduced tax base or rate and with the ISS already withheld by the tax substitute
12 - Exempt or immune
13 - Not taxed
14 - Taxed by a fixed tax
15 - Not taxed because of the destination of the goods or objects - goods for manufacturing or resale
16 - Not taxed because the service is deferred
iss_retido
string 1 ISS withholding
1 - Yes
2 - No
Florianópolis - CFPS
Parameter Required Type Size Description
cenario
string 1 Tax scenario
1 - Outbound to the same city
2 - Outbound inside the state
3 - Outbound to another state
4 - Outbound abroad
codigo_cfps
string 4 Service tax code (CFPS)
Governa
Parameter Required Type Size Description
codigo_servico
string 3-5 Service code
00.00
regime_recolhimento
string 2 Collection regime code
00 - Activity
02 - Code accepted by the API; check the classification with the city
03 - Exempt
04 - Immune
07 - Not applicable
08 - Estimate
09 - Liberal professional company
11 - Simples Nacional
12 - Individual micro-entrepreneur (MEI)
forma_recolhimento
string 2 Collection method code
00 - Normal
01 - Withheld at source
02 - Paid in advance
03 - Simples Nacional
04 - Fixed/Yearly
05 - No payment
06 - Due to another city
07 - Fixed/Monthly
IMA
Parameter Required Type Size Description
codigo_servico
string 3-5 Service code
00.00
iss_retido
string 1 ISS withholding
1 - Yes
2 - No
responsavel_retencao
string 1 Party responsible for withholding the ISS. Required when ISS is withheld.
1 - Service buyer
2 - Intermediary
codigo_cnae
string Up to 9 CNAE code, with at most 9 characters.
codigo_tributacao_municipio
string Up to 20 City tax code, with at most 20 characters.
tributacao
array (objects) --- Data about how the service is taxed, according to the scenarios below.
codigo_nbs
string9NBS code of the service, with exactly 9 digits after removing the formatting.
IMA > Taxation
Parameter Required Type Size Description
cenario
number 1 Tax scenario
1 - With ISS withholding
2 - Without ISS withholding
exigibilidade_iss
string 1 ISS enforceability
1 - Due
2 - Not applicable
3 - Exemption
4 - Export
5 - Immunity
6 - Suspended by court decision
7 - Suspended by administrative proceeding
deducoes
string 13v2 Deduction from the tax base
0.00
iss
string 3v2 ISS rate
0.00
pis
string 3v2 PIS rate
0.00
cofins
string 3v2 COFINS rate
0.00
inss
string 3v2 INSS rate
0.00
ir
string 3v2 IR rate
0.00
csll
string 3v2 CSLL rate
0.00
Osasco
Parameter Required Type Size Description
codigo_servico
string 3-5 Service code
00.00
iss_retido
string 1 ISS withholding
1 - Yes
2 - No
responsavel_retencao
string 1 Party responsible for withholding the ISS. Required when ISS is withheld.
1 - Service buyer
2 - Intermediary
National standard (Padrão Nacional)
Parameter Required Type Size Description
tipo_emissao
string 1 NFS-e issue type
1 - Normal
2 - Simplified, available for a company set up for the national standard (Padrão Nacional) or an MEI, with the login and password of the national portal (Portal Nacional)
codigo_servico
string 6 digits Service code, checked after removing the formatting and looked up in the national standard catalog.
00.00.00
codigo_tributacao_municipio
string 3-9 City tax code for normal issuing (tipo_emissao equal to 1).
tributacao_iss
number 1 How ISSQN applies to the service. Optional when the class for normal issuing is validated; if you send it, use one of the codes below.
1 - Taxable transaction
2 - Immunity
4 - Not applicable
tipo_imunidade
number 1 Type of ISSQN immunity, optional when the class is validated. Codes 1 to 5 are checked when tributacao_iss is 2.
0 - Immunity (type not stated on the source invoice)
1 - Assets, income or services of one government entity to another (CF88, Art 150, VI, a)
2 - Temples of any religion (CF88, Art 150, VI, b)
3 - Assets, income or services of political parties, including their foundations, of workers' unions, and of non-profit education and social assistance institutions that meet the legal requirements (CF88, Art 150, VI, c)
4 - Books, newspapers, periodicals and the paper used to print them (CF88, Art 150, VI, d)
5 - Music recordings and music videos produced in Brazil with musical or literary-musical works by Brazilian authors and/or works in general performed by Brazilian artists, and the physical media or digital files that contain them, except at the stage of industrial replication of laser-read optical media. (CF88, Art 150, VI, e)
retencao_iss
string 1 ISS withholding, optional when the class for normal issuing is validated, and checked when tributacao_iss is sent.
1 - Not withheld
2 - Withheld by the service buyer
3 - Withheld by the intermediary
cst_pis_cofins
string 2 PIS/COFINS CST (tax status code), optional for normal issuing. The API does not fill in this field automatically.
00 - None
01 - Taxable transaction at the basic rate
02 - Taxable transaction at a differentiated rate
03 - Taxable transaction at a rate per product unit of measure
04 - Single-phase taxable transaction - resale at zero rate
05 - Taxable transaction by tax substitution
06 - Taxable transaction at zero rate
07 - Transaction exempt from the contribution
08 - Transaction outside the scope of the contribution
09 - Transaction with the contribution suspended
49 - Other outbound transactions
50 - Transaction with right to credit - linked only to taxed revenue in the domestic market
51 - Transaction with right to credit - linked only to non-taxed revenue in the domestic market
52 - Transaction with right to credit - linked only to export revenue
53 - Transaction with right to credit - linked to taxed and non-taxed revenue in the domestic market
54 - Transaction with right to credit - linked to taxed revenue in the domestic market and export revenue
55 - Transaction with right to credit - linked to non-taxed revenue in the domestic market and export revenue
56 - Transaction with right to credit - linked to taxed and non-taxed revenue in the domestic market and export revenue
60 - Presumed credit - purchase linked only to taxed revenue in the domestic market
61 - Presumed credit - purchase linked only to non-taxed revenue in the domestic market
62 - Presumed credit - purchase linked only to export revenue
63 - Presumed credit - purchase linked to taxed and non-taxed revenue in the domestic market
64 - Presumed credit - purchase linked to taxed revenue in the domestic market and export revenue
65 - Presumed credit - purchase linked to non-taxed revenue in the domestic market and export revenue
66 - Presumed credit - purchase linked to taxed and non-taxed revenue in the domestic market and export revenue
67 - Presumed credit - other transactions
70 - Purchase without right to credit
71 - Purchase with exemption
72 - Purchase with suspension
73 - Purchase at zero rate
74 - Purchase outside the scope of the contribution
75 - Purchase by tax substitution
98 - Other inbound transactions
99 - Other transactions
retencao_pis_cofins
number 1 PIS/COFINS withholding. Required for normal issuing when cst_pis_cofins is sent, including for code 00.
0 - PIS/COFINS/CSLL not withheld
1 - PIS/COFINS withheld (legacy code)
2 - Code accepted by the API; check the classification with the city
3 - PIS/COFINS/CSLL withheld
4 - PIS/COFINS withheld, CSLL not withheld
5 - PIS withheld, COFINS/CSLL not withheld
6 - COFINS withheld, PIS/CSLL not withheld
7 - PIS not withheld, COFINS/CSLL withheld
8 - PIS/COFINS not withheld, CSLL withheld
9 - COFINS not withheld, PIS/CSLL withheld
ibs_cbs
object --- IBS/CBS tax object of the service class, with the fields below.
codigo_interno
string1-20Internal code of the taxpayer, with letters and numbers only. Validation removes spaces at both ends and accepts a numeric value, converted to a string.
consumidor_final
number1Final consumer indicator, normalized to an integer.
0 - No
1 - Yes
informacoes_complementares
stringUp to 2000Additional information. Spaces at both ends are removed before the length is checked.
codigo_nbs
string9NBS code for simplified issuing (tipo_emissao equal to 2), with 9 digits after removing the formatting, checked against the service catalog.
discriminacao
string---Description of the service, required for simplified issuing (tipo_emissao equal to 2).
cp
number2 decimal placesSocial security contribution for normal issuing; numeric value normalized to two decimal places.
IBS/CBS
Parameter Required Type Size Description
situacao_tributaria
string 3 IBS/CBS CST (tax status code) of the service Tax Class.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
classificacao_tributaria
string 6 IBS/CBS cClassTrib (tax classification code) of the service Tax Class.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
situacao_tributaria_regular
string 3 IBS/CBS CST (tax status code) in the regular regime of the service Tax Class.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed in the regular regime.
classificacao_tributaria_regular
string 6 IBS/CBS cClassTrib (tax classification code) in the regular regime of the service Tax Class.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed in the regular regime.
ibs_estadual
object --- Deferral data of the state IBS in the service Tax Class. Required when the tax status allows deferral; ignored in other cases.
Send aliquota_diferimento from 0 to 100, normalized to two decimal places.
ibs_municipal
object --- Deferral data of the city IBS in the service Tax Class. Required when the tax status allows deferral; ignored in other cases.
Send aliquota_diferimento from 0 to 100, normalized to two decimal places.
cbs
object --- Deferral data of the CBS in the service Tax Class. Required when the tax status allows deferral; ignored in other cases.
Send aliquota_diferimento from 0 to 100, normalized to two decimal places.
credito_presumido
string 2 Classification code of the presumed credit of the service Tax Class (01-13), from the table of presumed credit classifications. Required when the cClassTrib (tax classification) allows a presumed credit; ignored in other cases.
SIGISS
Parameter Required Type Size Description
codigo_servico
string 3-5 Service code
00.00
codigo_nbs
string 9 NBS code of the service. Send 9 digits; punctuation is removed before validation.
tributacao
number 1 Tax type
1 - Taxed at the provider
2 - Taxed at the service buyer
3 - Exempt
4 - Immune
5 - Not taxed
iss_retido
string 1 ISS withholding
1 - Yes
2 - No
responsavel_retencao
string 1 Party responsible for withholding the ISS. Required when ISS is withheld.
1 - Service buyer
2 - Intermediary

Tax Class
Create/edit communication taxes

The communication Tax Class is used to issue an NFCom (telecom invoice).

To create or edit a communication Tax Class, send a POST request to the URL /1/nfe/classe-imposto/.

The body is a JSON object with the parameters below and nfcom in the parameter tipo. With referencia, the matching class is updated with the new data; without it, a new class is created.

Unlike the product Tax Class, the parameters icms, pis and cofins are objects (not a list of scenarios). The tax bases and tax amounts are calculated automatically from the amount of each item when the invoice is issued.

Parameter Required Type Size Description
referencia
string --- Reference of an existing Tax Class.
When sent, the matching Tax Class is replaced with the new parameters.
descricao
string --- Description of the Tax Class
tipo
string --- Type of the Tax Class
nfcom
codigo_classificacao
string 6-7 Classification code of the NFCom item. See the table of classifications
Send it without the leading zero. E.g. 0100101 must be sent as 100101; codes that start with 1 or 5 (e.g. 1000101, 5900101) are sent with 7 digits.
icms
object --- ICMS data
pis
object --- PIS data
cofins
object --- COFINS data
fust
object --- Telecommunications Services Universalization Fund (FUST)
funttel
object --- Telecommunications Technology Development Fund (FUNTTEL)

Example of a communication Tax Class for a taxed telephone service subscription:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "referencia" : "REF000000", // Send only to edit
  "descricao": "Assinatura de serviços de telefonia",
  "tipo": "nfcom",
  "codigo_classificacao": "100101", // Telephone service subscription (0100101)
  "icms": {
    "origem": "0",
    "situacao_tributaria": "00",
    "codigo_cfop": "5307",
    "aliquota": 18
  },
  "pis": {
    "situacao_tributaria": "01",
    "aliquota": 1.65
  },
  "cofins": {
    "situacao_tributaria": "01",
    "aliquota": 7.60
  },
  "fust": {
    "aliquota": 1
  },
  "funttel": {
    "aliquota": 0.5
  }
}' \
https://webmania.com.br/api/1/nfe/classe-imposto/

Example of a communication Tax Class with exempt ICMS, for internet access:

{
  "descricao": "Provimento de acesso à internet",
  "tipo": "nfcom",
  "codigo_classificacao": "400401", // Unmetered service - Internet access (0400401)
  "icms": {
    "origem": "0",
    "situacao_tributaria": "40",
    "codigo_cfop": "5307"
  },
  "pis": {
    "situacao_tributaria": "07"
  },
  "cofins": {
    "situacao_tributaria": "07"
  }
}

On creation, the response is a JSON object with referencia, descricao and data:

{
  "referencia": "REF0000000", // Reference of the Tax Class
  "descricao": "Assinatura de serviços de telefonia", // Description
  "data": "0000-00-00 00:00:00" // Creation date
}

On edit, the response has referencia and msg:

{
  "referencia": "REF0000000",
  "msg": "Classe de imposto NFCom atualizada."
}

To use the Tax Class when you issue the NFCom, send the returned reference in the parameter classe_imposto of each item. Learn more

Note: The IBS/CBS group does not come from the communication Tax Class. When you use classe_imposto, send the object impostos.ibs_cbs, when required, at the root of the NFCom issue JSON, outside itens. Learn more
ICMS
Parameter Required Type Size Description
situacao_tributaria
string 2 ICMS CST (tax status code)
00 - Fully taxed
20 - With tax base reduction
40 - Exempt
51 - Deferral
60 - ICMS already collected by tax substitution
90 - Other
origem
string 1 Origem (origin) of the goods/service (0 to 8)
Default: 0 - Domestic
codigo_cfop
string 4 CFOP (transaction code)
Inbound: 1000 to 2999
Outbound: 5000 to 6999
e.g. 5307
aliquota
number 0-100 ICMS rate. Required for CST 00, 20 and 90.
0.00
percentual_reducao
number 0-100 Percentage of the tax base reduction. Required for CST 20.
0.00
aliquota_fcp
number 0-100 FCP (poverty fund surcharge) rate
0.00
PIS/COFINS
Parameter Required Type Size Description
situacao_tributaria
string 2 PIS and COFINS CST (tax status code)
01 - Taxable transaction at the basic rate
02 - Taxable transaction at a differentiated rate
06 - Taxable transaction at zero rate
07 - Transaction exempt from the contribution
08 - Transaction outside the scope of the contribution
09 - Transaction with the contribution suspended
49 - Other outbound transactions
aliquota
number 0-100 PIS or COFINS rate. Required for CST 01, 02 and 49.
0.00
FUST/FUNTTEL
Parameter Required Type Size Description
aliquota
number 0-100 FUST or FUNTTEL rate, from 0 to 100, formatted with 2 decimal places. Required when the object is sent.
The class does not save a default rate when the object is not sent.

Tax Class
List

The list returns the registered Tax Classes, with the references used to issue invoices.

To list the Tax Classes, send a GET request to the URL /1/nfe/classe-imposto/.

  curl -X GET \
  -H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
  -H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
  -H "X-Access-Token: YOUR_ACCESS_TOKEN" \
  -H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
  -H "Content-Type: application/json" \
  https://webmania.com.br/api/1/nfe/classe-imposto/

Example of an HTTP 200 response. The response is a JSON list of the registered Tax Classes. The example is partial: it shows only some fields of two product classes; the tax groups vary with the type of the class. With no registered classes, the response is {"msg":"Nenhuma classe de imposto cadastrada."} (no Tax Class registered). The field type is returned when the type of the class is registered.

[
  {
    "referencia": "REF12352465",
    "type": "nfe",
    "descricao": "Saída de produtos",
    "data": "2026-12-01 14:45:00",
    "icms": [],
    "ipi": [],
    "pis": [],
    "cofins": []
  },
  {
    "referencia": "REF43673367",
    "type": "nfe",
    "descricao": "Entrada de produtos",
    "data": "2026-12-01 15:02:21",
    "icms": [],
    "ipi": [],
    "pis": [],
    "cofins": []
  }
]

Tax Class
Delete

Deleting removes product or service Tax Classes of the authenticated company. Communication classes (NFCom) are not deleted by this endpoint.

To delete Tax Classes, send a DELETE request to the URL /1/nfe/classe-imposto/.

In the JSON body, send the parameter referencia. The class must belong to the authenticated company.

Parameter Required Type Size Description
referencia
string | array --- Reference of the Tax Class
Send an array to delete more than one Tax Class at a time.

Example JSON to delete Tax Classes:

  curl -X DELETE \
  -H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
  -H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
  -H "X-Access-Token: YOUR_ACCESS_TOKEN" \
  -H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "referencia":["REF12352465", "REF43673367"]
  }' \
  https://webmania.com.br/api/1/nfe/classe-imposto/

Example of an HTTP 200 response. The response is a JSON list: each deleted reference returns referencia and msg; a reference that is invalid, not found or from another company returns referencia and error. Check each item, because one request can contain both successes and errors.

[
  {
    "referencia": "REF12352465",
    "msg": "Classe de imposto excluída com sucesso."
  },
  {
    "referencia": "REF43673367",
    "msg": "Classe de imposto excluída com sucesso."
  }
]

Taxes in the API

There are two ways to set the taxes of an invoice: with a Tax Class, or directly in the API, in the impostos object of each product (see How to send the taxes).

Send the taxes directly in the API for transactions that the Tax Class does not cover, or when you need more flexibility.

The parameters of ICMS, ICMS-ST, IPI, PIS, COFINS and ISSQN go in the impostos object of each item of produtos. The table below lists the available groups. It does not mean that all of them can be omitted. In the usual direct input with ICMS or ISSQN, PIS and COFINS need a CST (tax status code) and a rate. Without ISSQN, also send the IPI data (except the rate when the CST is 100). For imports, send the rate of the importacao group. The next sections give the rules and exceptions of each group.

Groups of the impostos object:

Parameter NF-e / NFC-e Type Size Description
icms
object --- ICMS (state sales tax) information
ipi
object --- IPI (federal manufacturing tax) information
pis
object --- PIS (federal revenue tax) information
cofins
object --- COFINS (federal revenue tax) information
issqn
object --- ISSQN (city service tax) information
importacao
object --- Import tax information
Note: Tax withholding (retencao_tributos) is not part of the product taxes. Send it in the impostos key at the root of the JSON, at the same level as pedido and produtos.

Example of taxes sent directly in the API for a company in the Simples Nacional (small business regime):

{
  ...
  "produtos": [
     {
        "nome": "Camisetas Night Run",
        "codigo": "camiseta-night-run",
        "ean": "0789602015376",
        "ncm": "6109.10.00",
        "cest": "28.038.00",
        "quantidade": 3,
        "unidade": "UN",
        "peso": "0.800",
        "origem": 0,
        "subtotal": "44.90",
        "total": "134.70",
        "impostos": {
          "icms": {
             "codigo_cfop": "5.102",
             "situacao_tributaria": "102",
             "valor_bc": "20",
             "valor": "2.00"
          },
          "ipi": {
             "situacao_tributaria": "99",
             "codigo_enquadramento": 999,
             "aliquota": "0.00"
          },
          "pis": {
             "situacao_tributaria": "99",
             "aliquota": "0.00"
          },
          "cofins": {
             "situacao_tributaria": "99",
             "aliquota": "0.00"
          }
        }
     }
  ],
  ...
}

Taxes in the API > ICMS
Simples Nacional

Parameters and tax status codes (CSOSN) only for Simples Nacional companies. Send the ICMS data inside the icms object.

The tables below list the parameters of each CSOSN, with the required and optional fields.

Parameter NF-e / NFC-e Type Size Description
aliquota
string 3v2 ICMS rate (optional)
Webmania® calculates the ICMS and its tax base automatically! Learn more (in Portuguese)
0.00
We are tax specialists. We keep more than 5,000 rules and laws for every Brazilian state, constantly updated by the Webmania team of accounting experts. Avoid mistakes in the ICMS rate and calculations, and protect your transactions with Webmania technology.
aliquota_fcp
string 3v2 FCP (poverty fund surcharge) rate (optional)
Webmania® calculates the FCP and its tax base automatically! Learn more (in Portuguese)
aliquota_interestadual
string 3v2 Interstate ICMS rate (optional)
codigo_cfop
string 4 CFOP (transaction code)
0.000
situacao_tributaria
string 3 CSOSN (tax status code)
101 - Taxed with credit allowed
102 - Taxed without credit allowed
103 - ICMS exemption for the gross revenue bracket
201 - Taxed with credit allowed and with ICMS charged by tax substitution
202 - Taxed without credit allowed and with ICMS charged by tax substitution
203 - ICMS exemption for the gross revenue bracket and with ICMS charged by tax substitution
300 - Immune
400 - Not taxed
500 - ICMS charged earlier by tax substitution (substituted) or in advance
900 - Other
Send the CSOSN that applies to the transaction explicitly. There is no default value in this direct input.
aliquota_importacao
string 3v2 *Required for an import invoice:
Import ICMS rate
0.00
industria
string 1 Send it when the product is sold to a manufacturer for its own use and final consumption. When the sale is to a manufacturer for use in its production process, or has no such link, keep the value null.
0 - No
1 - Yes
majoracao
string 13v2 Unit amount used instead of the product amount to build the ICMS tax base. When it is not zero, it is multiplied by the product quantity.
0.00
bc_icms
string 13v2 ICMS tax base.
Used when it is not zero in returns (finalidade 4), in products that the automatic calculation classifies as special, or in the Paraná (PR) presumed credit transaction recognized by the API.
0.00
bc_icms_st
string 13v2 ICMS-ST tax base.
Used when it is not zero in returns (finalidade 4) or in products that the automatic calculation classifies as special. The fixed reference price (pauta fiscal) or the transaction value, when sent, take precedence over this base.
0.00
valor_icms
string 13v2 ICMS amount.
*Only for invoices whose purpose is a return, with a tolerance of R$ 0.01 (1 cent) from the automatic calculation.
0.00
aliquota_diferimento
string 4 decimal places Deferral percentage, with four decimal places.
Applied to CSOSN 900 in outbound returns (operacao 1, finalidade 4 and a return CFOP) when the transaction has calculated ICMS.
0.0000
credito_presumido NEW
object --- Object with the details of the presumed credit.
Learn more
Simples Nacional: ICMS 101
Parameter NF-e / NFC-e Type Size Description
aliquota_credito
string 3v2 Rate used to calculate the credit
0.00
"impostos": {
   "icms": {
     "codigo_cfop": "5.102",
     "situacao_tributaria": "101",
     "aliquota_credito": "10.00"
   }
 }
Simples Nacional: ICMS 201
Parameter NF-e / NFC-e Type Size Description
aliquota_st
string 3v4 ICMS-ST rate (optional)
Webmania® calculates the ICMS-ST and its tax base automatically! Learn more (in Portuguese)
0.00
We are tax specialists. We keep more than 5,000 rules and laws for every Brazilian state, constantly updated by the Webmania team of accounting experts. Avoid mistakes in the ICMS-ST rate and calculations, and protect your transactions with Webmania technology.
aliquota_fcp_st
string 3v2 FCP-ST rate (optional)
Webmania® calculates the FCP-ST and its tax base automatically! Learn more (in Portuguese)
aliquota_mva
string 3v2 Percentage of the original added value margin (original MVA/IVA) used to calculate ICMS-ST. When no ST base method is set explicitly, send aliquota_mva, pauta_fiscal or valor_operacao. The API keeps the original MVA or calculates the adjusted MVA, depending on the transaction.
0.00
aliquota_credito
string 3v2 Rate used to calculate the credit
0.00
aliquota_reducao
string 3v4 ICMS tax base reduction rate
0.0000
aliquota_reducao_st
string 3v4 ICMS-ST tax base reduction rate
0.0000
"impostos": {
   "icms": {
     "codigo_cfop": "5.402",
     "situacao_tributaria": "201",
     "aliquota_credito": "10.00",
     "aliquota_mva": "20.00"
   }
 }
Simples Nacional: ICMS 202 and 203
Parameter NF-e / NFC-e Type Size Description
aliquota_st
string 3v4 ICMS-ST rate (optional)
Webmania® calculates the ICMS-ST and its tax base automatically! Learn more (in Portuguese)
0.00
We are tax specialists. We keep more than 5,000 rules and laws for every Brazilian state, constantly updated by the Webmania team of accounting experts. Avoid mistakes in the ICMS-ST rate and calculations, and protect your transactions with Webmania technology.
aliquota_fcp_st
string 3v2 FCP-ST rate (optional)
Webmania® calculates the FCP-ST and its tax base automatically! Learn more (in Portuguese)
aliquota_mva
string 3v2 Percentage of the original added value margin (original MVA/IVA) used to calculate ICMS-ST. When no ST base method is set explicitly, send aliquota_mva, pauta_fiscal or valor_operacao. The API keeps the original MVA or calculates the adjusted MVA, depending on the transaction.
0.00
aliquota_reducao
string 3v4 ICMS tax base reduction rate
0.0000
aliquota_reducao_st
string 3v4 ICMS-ST tax base reduction rate
0.0000
"impostos": {
   "icms": {
     "codigo_cfop": "5.402",
     "situacao_tributaria": "202",
     "aliquota_mva": "20.00"
   }
 }
Simples Nacional: ICMS 500

The withheld ST group is optional. If bc_st_retido, aliquota_st_retido or valor_st_retido has a value that is not empty and not 0.00, all three fields must be present. valor_icms_substituto stays optional.

The withheld FCP is also optional. If valor_fcp_retido or aliquota_fcp_retido has a value that is not empty and not 0.00, both must be present. You can send the other field explicitly as 0.00. Despite its name, valor_fcp_retido holds the tax base, not the calculated tax.

The effective ICMS data is calculated for the final consumer when aliquota_bc_efetivo and aliquota_icms_efetivo both have values that are not empty. Without the pair, the calculation uses zero for this data.

Parameter NF-e / NFC-e Type Size Description
bc_st_retido
string 13v2 Tax base of the withheld ICMS-ST (charged earlier by ST).
You can omit the value when the law does not require it.
aliquota_st_retido
string 3v2 Rate of the withheld ICMS-ST (charged earlier by ST), including FCP when it applies to the goods.
Example: if the rate of the goods in the sale to the final consumer is 18% plus 2% FCP, send 20%.

You can omit the value when the law does not require it.
valor_st_retido
string 13v2 Amount of the withheld ICMS-ST (charged earlier by ST).
You can omit the value when the law does not require it.
valor_icms_substituto
string 13v2 Amount of the substitute's own ICMS (charged earlier).
You can omit the value when the law does not require it.
valor_fcp_retido
string 13v2 Tax base of the FCP withheld earlier by ST.
You can omit the value when the law does not require it.
aliquota_fcp_retido
string 3v2 Rate of the poverty fund surcharge (FCP) withheld earlier by ST.
You can omit the value when the law does not require it.
aliquota_bc_efetivo
string 3v2 Effective tax base reduction percentage
The reduction percentage that would apply under the common tax regime, to get the effective tax base. (optional, at the state's discretion)
aliquota_icms_efetivo
string 3v2 Effective ICMS rate
The ICMS rate of the sale to the final consumer under the common tax regime. (optional, at the state's discretion)
"impostos": {
   "icms": {
     "codigo_cfop": "5.102",
     "situacao_tributaria": "500",
     "bc_st_retido": "1000.00",
     "aliquota_st_retido": "20.00",
     "valor_st_retido": "200.00",
     ...
   }
 }

Taxes in the API > ICMS
Standard taxation

Parameters and tax status codes (CST) only for companies in the actual profit (Lucro Real) and presumed profit (Lucro Presumido) regimes. Send the ICMS data inside the icms object of the impostos of each product.

To declare that an item belongs to the basic food basket (cesta básica), see produtos[].impostos.icms.cesta_basica.

The tables below list the parameters of each CST, with the required and optional fields.

Parameter NF-e / NFC-e Type Size Description
aliquota
string 3v2 ICMS rate (optional)
Webmania® calculates the ICMS and its tax base automatically! Learn more (in Portuguese)
0.00
We are tax specialists. We keep more than 5,000 rules and laws for every Brazilian state, constantly updated by the Webmania team of accounting experts. Avoid mistakes in the ICMS rate and calculations, and protect your transactions with Webmania technology.
aliquota_fcp
string 3v2 FCP (poverty fund surcharge) rate (optional)
Webmania® calculates the FCP and its tax base automatically! Learn more (in Portuguese)
aliquota_interestadual
string 3v2 Interstate ICMS rate (optional)
aliquota_carga_efetiva
string 3v2 Effective ICMS tax load rate of the product (optional). Issuing field, sent in produtos[].impostos.icms.
Accepted values: 5.14, 5.60 or 8.80
perfil_fabricacao
string - Manufacturing profile of the product (optional). Issuing field, sent in produtos[].perfil_fabricacao. Accepted here when the product uses classe_imposto. In that case, if you send it in both places, the value of produtos[].perfil_fabricacao wins. With manual taxes (without classe_imposto), send it in produtos[].impostos.icms.perfil_fabricacao. Missing, null or empty means nao_informado.
Accepted values: industrial or nao_industrial
perfil_fabricacao
string - Manufacturing profile of the product (optional). Issuing field, sent in produtos[].impostos.icms.perfil_fabricacao. Use this place with manual taxes (without classe_imposto), where produtos[].perfil_fabricacao is not read. With classe_imposto, if you send it in both places, the value of produtos[].perfil_fabricacao wins. Missing, null or empty means nao_informado.
Accepted values: industrial or nao_industrial
codigo_cfop
string 4 CFOP (transaction code)
0.000
situacao_tributaria
string 2 CST (tax status code)
00 - Fully taxed
02 - Own single-phase taxation on fuels
10 - Taxed and with ICMS charged by tax substitution
15 - Own single-phase taxation, with responsibility for withholding, on fuels
20 - With tax base reduction
30 - Exempt or not taxed and with ICMS charged by tax substitution
40 - Exempt
41 - Not taxed
50 - Suspension
51 - Deferral
53 - Single-phase taxation on fuels with deferred payment
60 - ICMS charged earlier by tax substitution
61 - Single-phase taxation on fuels charged earlier
70 - With tax base reduction and ICMS charged by tax substitution
90 - Other
Send the CST that applies to the transaction. There is no default value when you send the taxes directly.
aliquota_importacao
string 3v2 *Required for an import invoice:
Import ICMS rate
0.00
industria
string 1 Send it when the product is sold to a manufacturer for its own use and final consumption. When the sale is to a manufacturer for use in its production process, or has no such link, keep the value null.
0 - No
1 - Yes
majoracao
string 13v2 Unit amount used to build the ICMS tax base: it is multiplied by the product quantity and, when the result is not zero, it replaces the product total in this base.
0.00
difal_antecipacao
boolean --- Send true to request the advance payment of DIFAL (interstate rate difference) on a double base, as tax substitution, in an interstate sale to a final consumer that is an ICMS taxpayer. Outside these conditions, the flag does not force this calculation.
codigo_beneficio_reducao_bc NEW
string 8 or 10 Tax benefit code of the tax base reduction (tag cBenefRBC).
*Applies to CST 51 and 90 when there is a tax base reduction (pRedBC > 0).
SC123456
bc_icms
string 13v2 ICMS tax base you send. It is used when it is not null in return invoices (finalidade 4), in products that the calculation recognizes as special, or in the specific Paraná (PR) presumed credit scenario.
0.00
valor_icms
string 13v2 ICMS amount you send for a return, with a tolerance of R$ 0.01 (1 cent) from the automatic calculation in the branches that apply this rule. It also works as the credit sent in an NF-e with CST 90, a CFOP of the 6.150 group and a recipient with the same CNPJ root as the issuer, when no direct credit amount is sent.
0.00
bc_icms_st
string 13v2 ICMS-ST tax base you send. It is used when it is not null for products that the calculation recognizes as special, or for return invoices (finalidade 4). The fixed reference price (pauta fiscal) or the transaction value, when sent, can replace this base.
0.00
credito_presumido NEW
object --- Details of the presumed credit.
Learn more
Standard taxation: ICMS 00
Parameter NF-e / NFC-e Type Size Description
pauta_fiscal
string 13v2 Fixed reference price (pauta) in reais used to calculate ICMS
0.00
"impostos": {
  "icms": {
    "pauta_fiscal": "0.00"
  }
}
Standard taxation: ICMS 02
Parameter NF-e / NFC-e Type Size Description
quantidade_bc
string 3v2-4 Quantity for the ICMS tax base (optional)
0.0000
"impostos": {
  "icms": {
    "codigo_cfop": "5.402",
    "situacao_tributaria": "02"
  }
}
Standard taxation: ICMS 10 and 30
Parameter NF-e / NFC-e Type Size Description
aliquota_st
string 3v4 ICMS-ST rate (optional)
Webmania® calculates the ICMS-ST and its tax base automatically! Learn more (in Portuguese)
0.00
We are tax specialists. We keep more than 5,000 rules and laws for every Brazilian state, constantly updated by the Webmania team of accounting experts. Avoid mistakes in the ICMS-ST rate and calculations, and protect your transactions with Webmania technology.
aliquota_fcp_st
string 3v2 FCP-ST rate (optional)
Webmania® calculates the FCP-ST and its tax base automatically! Learn more (in Portuguese)
aliquota_mva
string 3v2 Percentage of the original added value margin (original MVA/IVA) used to calculate ICMS-ST. When no ST base method is set explicitly, send the MVA, pauta_fiscal or valor_operacao. The calculation keeps the original MVA or applies the adjustment, depending on the transaction.
0.00
aliquota_reducao_st
string 3v4 ICMS-ST tax base reduction rate
0.0000
motivo_desoneracao_st
string 1-2 Reason for the ICMS-ST relief (desoneração). Used in CST 10 when the ST base is reduced. This calculation does not apply it to CST 30.
3 - Use in agriculture and livestock
9 - Other
12 - Agricultural development agency
"impostos": {
   "icms": {
     "codigo_cfop": "5.402",
     "situacao_tributaria": "10",
     "aliquota_mva": "20.00"
   }
 }
Standard taxation: ICMS 15
Parameter NF-e / NFC-e Type Size Description
quantidade_retencao
string 3v2-4 Taxed quantity subject to withholding
0.0000
aliquota_retencao
string 3v2-4 Ad rem rate (fixed amount per unit) of the tax with withholding
0.0000
percentual_reducao
string 3v2 Reduction percentage of the ICMS ad rem rate
0.00
motivo_reducao
string 1 Reason for the reduction (required when you send the reduction percentage)
0 - Public passenger transport
9 - Other
quantidade_bc
string 3v2-4 Quantity for the ICMS tax base (optional)
0.0000
"impostos": {
  "icms": {
    "codigo_cfop": "5.402",
    "situacao_tributaria": "15",
    "quantidade_retencao": "25.2200",
    "aliquota_retencao": "1.9876"
  }
}
Standard taxation: ICMS 20
Parameter NF-e / NFC-e Type Size Description
aliquota_reducao
string 3v4 ICMS tax base reduction rate
0.0000
motivo_desoneracao
string 1-2 Reason for the ICMS relief (desoneração). The deduction from the total depends on the deduction indicator and on the calculation conditions.
3 - Use in agriculture and livestock
9 - Other
10 - Disabled driver (Convênio ICMS 38/12) NEW
11 - Disabled non-driver (Convênio ICMS 38/12) NEW
12 - Agricultural development agency
deducao_desoneracao NEW
string 1 Indicates whether the relieved ICMS is deducted in the total calculation, when there is relief. If you send this numeric field with relief reason 7 (SUFRAMA), the calculation uses indicator 1 even if you send 0.
0 - No
1 - Yes
"impostos": {
   "icms": {
     "codigo_cfop": "5.102",
     "situacao_tributaria": "20",
     "aliquota_reducao": "20.00",
     "motivo_desoneracao": "9",
     "deducao_desoneracao": "1"
   }
 }
Standard taxation: ICMS 30
Parameter NF-e / NFC-e Type Size Description
motivo_desoneracao
string 1-2 Reason for the ICMS relief (desoneração).
6 - Utility vehicles and motorcycles of the Western Amazon and Free Trade Areas
7 - SUFRAMA
9 - Other
deducao_desoneracao NEW
string 1 Indicates whether the relieved ICMS is deducted in the total calculation, when there is relief. If you send this numeric field with relief reason 7 (SUFRAMA), the calculation uses indicator 1 even if you send 0.
0 - No
1 - Yes
"impostos": {
   "icms": {
     "codigo_cfop": "5.102",
     "situacao_tributaria": "30",
     "motivo_desoneracao": "9",
     "deducao_desoneracao": "1"
   }
 }
Standard taxation: ICMS 40, 41 and 50
Parameter NF-e / NFC-e Type Size Description
motivo_desoneracao
string 1-2 Reason for the ICMS relief (desoneração).
1 - Taxi
3 - Use in agriculture and livestock
4 - Fleet owner/Rental company
5 - Diplomatic/Consular
6 - Utility vehicles and motorcycles of the Western Amazon and Free Trade Areas
7 - SUFRAMA
8 - Sale to a public body
9 - Other
10 - Disabled driver (Convênio ICMS 38/12)
11 - Disabled non-driver (Convênio ICMS 38/12)
12 - Agricultural development agency
16 - Rio 2016 Olympic Games
90 - Requested by the tax authority
deducao_desoneracao NEW
string 1 Indicates whether the relieved ICMS is deducted in the total calculation, when there is relief. If you send this numeric field with relief reason 7 (SUFRAMA), the calculation uses indicator 1 even if you send 0.
0 - No
1 - Yes
"impostos": {
   "icms": {
     "codigo_cfop": "5.102",
     "situacao_tributaria": "40",
     "motivo_desoneracao": "9",
     "deducao_desoneracao": "1"
   }
 }
Standard taxation: ICMS 51
Parameter NF-e / NFC-e Type Size Description
aliquota_diferimento
string 4 decimal places Deferral percentage, normalized to four decimal places in direct input.
0.0000
aliquota_diferimento_fcp
string 3v2 Deferral percentage of the ICMS for the poverty fund surcharge (FCP), optional. If you send a percentage that is not empty and not 0.00, also send aliquota_fcp.
0.00
codigo_beneficio_reducao_bc NEW
string 8 or 10 Tax benefit code of the tax base reduction (tag cBenefRBC).
*Send it when there is a tax base reduction in CST 51.
SC123456
motivo_desoneracao
string 1-2 Reason for the ICMS relief (desoneração). The deduction from the total depends on the deduction indicator and on the calculation conditions.
3 - Use in agriculture and livestock
9 - Other
12 - Agricultural development agency
"impostos": {
   "icms": {
     "codigo_cfop": "5.102",
     "situacao_tributaria": "51",
     "aliquota_diferimento": "20.00",
     "codigo_beneficio_reducao_bc": "SC123456"
   }
 }
Standard taxation: ICMS 53
Parameter NF-e / NFC-e Type Size Description
aliquota_diferimento
string 3v2-4 Deferral percentage
0.0000
quantidade_bc
string 3v2-4 Quantity for the ICMS tax base (optional)
0.0000
"impostos": {
  "icms": {
    "codigo_cfop": "5.402",
    "situacao_tributaria": "53",
    "aliquota_diferimento": "30"
  }
}

In CST 60, if any field of the trio bc_st_retido, aliquota_st_retido and valor_st_retido has a value that is not empty and not 0.00, all three must be present. A field sent explicitly as 0.00 counts as present.

The same applies to the pair valor_fcp_retido and aliquota_fcp_retido. Despite its name, valor_fcp_retido is the tax base, not the amount of withheld tax.

The effective ICMS is calculated for the final consumer when aliquota_bc_efetivo and aliquota_icms_efetivo both have values that are not null. Without the pair, the effective values are set to zero in this branch of the calculation.

Standard taxation: ICMS 60
Parameter NF-e / NFC-e Type Size Description
bc_st_retido
string 13v2 Tax base of the withheld ICMS-ST (charged earlier by ST).
You can omit the value when the law does not require it.
aliquota_st_retido
string 3v2 Rate of the withheld ICMS-ST (charged earlier by ST), including FCP when it applies to the goods.
Example: if the rate of the goods in the sale to the final consumer is 18% plus 2% FCP, send 20%.

You can omit the value when the law does not require it.
valor_st_retido
string 13v2 Amount of the withheld ICMS-ST (charged earlier by ST).
You can omit the value when the law does not require it.
bc_st_dest
string 13v2 ICMS-ST tax base of the destination state (UF).
You can omit the value when the law does not require it.
valor_st_dest
string 13v2 ICMS-ST amount of the destination state (UF).
You can omit the value when the law does not require it.
valor_fcp_retido
string 13v2 Tax base of the FCP withheld earlier by ST.
You can omit the value when the law does not require it.
aliquota_fcp_retido
string 3v2 Rate of the poverty fund surcharge (FCP) withheld earlier by ST.
You can omit the value when the law does not require it.
aliquota_bc_efetivo
string 3v2 Effective tax base reduction percentage
The reduction percentage that would apply under the common tax regime, to get the effective tax base. (optional, at the state's discretion)
aliquota_icms_efetivo
string 3v2 Effective ICMS rate
The ICMS rate of the sale to the final consumer under the common tax regime. (optional, at the state's discretion)
"impostos": {
   "icms": {
     "codigo_cfop": "5.102",
     "situacao_tributaria": "60",
     "bc_st_retido": "1000.00",
     "aliquota_st_retido": "20.00",
     "valor_st_retido": "200.00",
     ...
   }
 }
Standard taxation: ICMS 61
Parameter NF-e / NFC-e Type Size Description
quantidade_bc
string 3v2-4 Quantity for the ICMS tax base (optional)
0.0000
"impostos": {
  "icms": {
    "codigo_cfop": "5.402",
    "situacao_tributaria": "61",
    "quantidade_bc": "25.2200"
  }
}
Standard taxation: ICMS 70
Parameter NF-e / NFC-e Type Size Description
aliquota_st
string 3v4 ICMS-ST rate (optional)
Webmania® calculates the ICMS-ST and its tax base automatically! Learn more (in Portuguese)
0.00
We are tax specialists. We keep more than 5,000 rules and laws for every Brazilian state, constantly updated by the Webmania team of accounting experts. Avoid mistakes in the ICMS-ST rate and calculations, and protect your transactions with Webmania technology.
aliquota_fcp_st
string 3v2 FCP-ST rate (optional)
Webmania® calculates the FCP-ST and its tax base automatically! Learn more (in Portuguese)
aliquota_mva
string 3v2 Percentage of the original added value margin (original MVA/IVA) used to calculate ICMS-ST. When no ST base method is set explicitly, send the MVA, pauta_fiscal or valor_operacao. The calculation keeps the original MVA or applies the adjustment, depending on the transaction.
0.00
aliquota_reducao
string 3v4 ICMS tax base reduction rate
0.0000
aliquota_reducao_st
string 3v4 ICMS-ST tax base reduction rate
0.0000
motivo_desoneracao
string 1-2 Reason for the ICMS relief (desoneração). The deduction from the total depends on the deduction indicator and on the calculation conditions.
3 - Use in agriculture and livestock
9 - Other
12 - Agricultural development agency
motivo_desoneracao_st
string 1-2 Reason for the ICMS-ST relief (desoneração).
3 - Use in agriculture and livestock
9 - Other
12 - Agricultural development agency
deducao_desoneracao NEW
string 1 Indicates whether the relieved ICMS is deducted in the total calculation, when there is relief. If you send this numeric field with relief reason 7 (SUFRAMA), the calculation uses indicator 1 even if you send 0.
0 - No
1 - Yes
"impostos": {
   "icms": {
     "codigo_cfop": "5.402",
     "situacao_tributaria": "70",
     "aliquota_reducao": "10.00",
     "aliquota_mva": "20.00",
     "motivo_desoneracao": "9",
     "deducao_desoneracao": "1"
   }
 }

Taxes in the API > ICMS
MVA

ICMS tax substitution (ICMS-ST) means that one company in the chain pays the ICMS of the next steps in advance. Most states calculate it with the MVA (added value margin). This method is available for Simples Nacional and for the standard regime (outside Simples Nacional).

For items declared in the basic food basket, the calculation in that section does not need an MVA.

The rate depends on the product (NCM, the product code) and on the destination state of the goods. Your accountant must provide it. To calculate with MVA, send aliquota_mva inside the icms object. In ICMS-ST scenarios that need a base, the API accepts the MVA, the fixed reference price (pauta fiscal) or the transaction value as alternatives.

Parameter Type Size Description
aliquota_mva string 3v2 Percentage of the original added value margin (original MVA/IVA) used to calculate ICMS-ST. The platform adjusts the MVA in the cases the calculation covers. Depending on the regime, the transaction and the product, it keeps the original MVA.
0.00

Example of the MVA inside the icms object:

"impostos": {
   "icms": {
     "codigo_cfop": "5.402",
     "situacao_tributaria": "10",
     "aliquota_mva": "20.00"
   }
 }

Taxes in the API > ICMS
Fixed reference price (pauta fiscal)

Some states use a fixed reference price (pauta fiscal) to calculate tax substitution for certain types of products. The tax is based on a value set in advance by the state.

The fixed price depends on the product (NCM) and on the destination state of the goods. Your accountant must provide it. For tax status ICMS 00 or ICMS-ST, send the pauta_fiscal parameter instead of aliquota_mva inside the icms object.

Parameter Type Size Description
pauta_fiscal string 13v2 Unit amount in reais of the fixed reference price (pauta) used to calculate ICMS 00 or ICMS-ST. The base takes the quantity into account and, depending on the scenario, freight, IPI and discount. Some products and states have specific rules.
0.00

Example of the fixed reference price (pauta fiscal) inside the icms object:

"impostos": {
   "icms": {
     "codigo_cfop": "5.402",
     "situacao_tributaria": "10",
     "pauta_fiscal": "15.00"
   }
 }

Taxes in the API > ICMS
Transaction value

Calculating tax substitution from the transaction value lets taxpayers who act as tax substitutes, responsible for paying the tax, fill in the NF-e for their transactions, among other uses.

For CST codes with ICMS-ST, send the valor_operacao parameter instead of aliquota_mva inside the icms object.

Parameter Type Size Description
valor_operacao string 13v2 Transaction value in reais used as the ICMS-ST base. In this calculation, the freight divided by the quantity is added. When sent, it takes precedence over the fixed reference price (pauta fiscal).
0.00

Example of the transaction value inside the icms object:

"impostos": {
   "icms": {
     "codigo_cfop": "5.402",
     "situacao_tributaria": "10",
     "valor_operacao": "150.00"
   }
 }

Taxes in the API > ICMS
Presumed credit NEW

Details of the presumed credit, a tax credit that the state grants as a benefit instead of the actual credit. Send this data in the credito_presumido object, inside the icms object.

Parameter NF-e Type Size Description
codigo_beneficio_fiscal
string 8 or 10 Presumed credit tax benefit code in the state (UF). It must be a string with exactly 8 or 10 characters.
aliquota
string 13v4 Presumed credit rate
0.0000
valor
string 13v2 Presumed credit amount
0.00
The amount is calculated automatically, but the value you send replaces it.

Example of how to add the presumed credit details to each icms in impostos:

"impostos": {
   "icms": {
      "credito_presumido": {
        "codigo_beneficio_fiscal": "JU34LDU7", 
        "aliquota": "10.0000"
      }
   }
 }

Taxes in the API > ICMS
Credit transfer between branches — CST 90 (CFOP 6.150) NEW

Transfer of goods between branches of the same owner with transfer of the ICMS credit, under Convênio ICMS 109/2024 and Ajuste SINIEF 33/2024. In this scenario, the ICMS tax base (vBC) and rate (pICMS) are set to zero. The amount shown on the invoice (vICMS) is the credit sent by the taxpayer, not an amount recalculated from the tax base.

This scenario applies only to the NF-e (model 55), not to the NFC-e. The item must meet all three conditions below at the same time:

  1. CFOP of the 6.150 group — 6.150, 6.151, 6.152, 6.153, 6.155 or 6.156 (interstate transfer between branches of the same owner);
  2. CST equal to 90 — situacao_tributaria: "90";
  3. same CNPJ root — the first 8 characters of the full CNPJs (company IDs) of the issuer and the recipient are identical after normalization. A missing CPF or CNPJ does not meet the condition.

Send the credit in the valor_icms field (or valor, which wins if you send both). When the credit is sent, the rule applies: vBC and pICMS are set to zero and vICMS gets the amount you sent. When the credit is not sent, the rule does not apply and the item keeps the platform's existing CST 90 behavior. Omitting the credit is the opt-out of this scenario (Ajuste SINIEF 33/24).

Rejection for a different owner. An item that declares the transfer (CST 90 + a CFOP of the 6.150 group) to a recipient with a different CNPJ root from the issuer, with the credit in the valor_icms field (the name the panel uses) and a value other than zero, is rejected with an error. A zero credit does not trigger this rejection. A direct integrator that sends only valor explicitly is not affected by this rejection and keeps the platform's existing behavior.

Parameter NF-e / NFC-e Type Size Description
codigo_cfop
string 4 CFOP (transaction code) of the 6.150 group.
6.150, 6.151, 6.152, 6.153, 6.155, 6.156
situacao_tributaria
string 2 CST (tax status code).
90
valor_icms / valor
string 13v2 Amount of the ICMS credit shown on the invoice (tag vICMS). It is the amount sent by the taxpayer, not recalculated.
valor_icms is the name the panel uses; valor is the name for direct API integration.
"0.00" is a valid credit (the rule applies and vICMS is zero). When the credit is not sent, the rule does not apply and the item keeps the existing CST 90 behavior. Omitting the credit is the opt-out.
218989.12
bc_icms / valor_bc
string 13v2 ICMS tax base (tag vBC). It is always zero on the invoice in this scenario, whatever value you send. You can omit it: the API assumes "0.00".
0.00
beneficio_fiscal
string 8-10 Tax benefit code (tag cBenef). Send it at the item level (inside produtos[]), not inside impostos.icms.
SP099000
valor_fcp / valor_fcp_st — — — Do not send FCP values other than zero. In this scenario, the invoice is rejected if any of these fields has a value other than zero or an invalid format. A missing field, an empty value and a normalized zero (such as "0.00") do not trigger this rejection.

Example of ICMS CST 90 for a credit transfer:

"impostos": {
   "icms": {
      "codigo_cfop": "6.152",
      "situacao_tributaria": "90",
      "valor_icms": "218989.12",
      "bc_icms": "0.00"
   }
 }

The taxpayer is responsible for the limit of transferable credit set by Convênio ICMS 109/2024. The platform checks the format and the scenario, but not the maximum credit you send.


Taxes in the API
IPI

Send the IPI (federal manufacturing tax) data in the ipi object, as shown in the taxes table. IPI applies only to the NF-e, not to the NFC-e. IPI parameters:

Parameter NF-e / NFC-e Type Size Description
situacao_tributaria
string 2 IPI CST (tax status code)
00 - Inbound with credit recovery
01 - Inbound taxed at zero rate
02 - Inbound exempt
03 - Inbound not taxed
04 - Inbound immune
05 - Inbound with suspension
49 - Other inbound
50 - Outbound taxed
51 - Outbound taxed at zero rate
52 - Outbound exempt
53 - Outbound not taxed
54 - Outbound immune
55 - Outbound with suspension
99 - Other outbound
Send the CST that applies. The validation of taxes sent directly has no default.
codigo_enquadramento
integer 1-3 Classification code (código de enquadramento). For CST 52, a specific code other than 999 is required. For the other CSTs, the validation of direct taxes assumes 999 when you do not send the code.
Default: 999, except CST 52
aliquota
string 3v2 IPI rate
0.00
percentual_devolvido
string 3v2 Percentage of the returned goods (returned taxes), from 0 to 100. If it is not zero, it requires ipi_devolvido, and vice versa. Used in a return NF-e when the automatic calculation has not set the returned IPI yet.
0.00
ipi_devolvido
string 13v2 Amount of the returned IPI (returned taxes). If it is not zero, it requires percentual_devolvido. Used in a return NF-e when the automatic calculation has not set the returned IPI yet.
0.00
codigo_selo
string 1-60 Code of the IPI control stamp. If the code or the number of stamps has a value that is not empty, both are required. Only the first 60 characters of the code are kept.
Fill in as set by Annex II-A of Instrução Normativa RFB No 770/2007
qtd_selo
string 1-12 Number of control stamps. Requires codigo_selo when it has a value that is not empty. Only the first 12 characters are kept.
Fill in as set by Annex XIV of Nota Técnica 2015.002
bc_ipi
string 13v2 IPI tax base.
Used when you send a value other than zero, with a rate other than zero, in return invoices or in special products recognized by the platform.
0.00
valor_ipi
string 13v2 IPI amount, zero or more, with up to 2 decimal places.
Used in non-automatic return invoices, in the calculation with a rate other than zero, when the difference from the automatic calculation is up to R$ 0.01 (1 cent). Above that, the calculated amount wins.
0.00

Example of IPI inside the impostos object:

"impostos": {
   "ipi": {
     "situacao_tributaria": "99",
     "codigo_enquadramento": "999",
     "aliquota": "10.00"
   }
 }

Taxes in the API
PIS

Send the PIS (federal revenue tax) data in the pis object, as shown in the taxes table. PIS parameters:

Parameter NF-e / NFC-e Type Size Description
situacao_tributaria
string 2 PIS CST (tax status code)
01 - Taxable transaction - Tax base = Transaction value, standard rate (cumulative/non-cumulative)
02 - Taxable transaction - Tax base = Transaction value (special rate)
03 - Taxable transaction - Tax base = Quantity sold x Rate per product unit
04 - Taxable transaction - Single-phase taxation - (Zero rate)
05 - Taxable transaction - (Tax substitution)
06 - Taxable transaction - (Zero rate)
07 - Transaction exempt from the contribution
08 - Transaction outside the scope of the contribution
09 - Transaction with the contribution suspended
49 - Other outbound transactions
50 - Transaction with right to credit - Linked only to taxed revenue in the domestic market
51 - Transaction with right to credit - Linked only to untaxed revenue in the domestic market
52 - Transaction with right to credit - Linked only to export revenue
53 - Transaction with right to credit - Linked to taxed and untaxed revenue in the domestic market
54 - Transaction with right to credit - Linked to taxed revenue in the domestic market and export revenue
55 - Transaction with right to credit - Linked to untaxed revenue in the domestic market and export revenue
56 - Transaction with right to credit - Linked to taxed and untaxed revenue in the domestic market, and export revenue
60 - Presumed credit - Purchase linked only to taxed revenue in the domestic market
61 - Presumed credit - Purchase linked only to untaxed revenue in the domestic market
62 - Presumed credit - Purchase linked only to export revenue
63 - Presumed credit - Purchase linked to taxed and untaxed revenue in the domestic market
64 - Presumed credit - Purchase linked to taxed revenue in the domestic market and export revenue
65 - Presumed credit - Purchase linked to untaxed revenue in the domestic market and export revenue
66 - Presumed credit - Purchase linked to taxed and untaxed revenue in the domestic market, and export revenue
67 - Presumed credit - Other transactions
70 - Purchase without right to credit
71 - Purchase with exemption
72 - Purchase with suspension
73 - Purchase at zero rate
74 - Purchase outside the scope of the contribution
75 - Purchase by tax substitution
98 - Other inbound transactions
99 - Other transactions
Send the CST that applies. The validation of taxes sent directly has no default.
aliquota
string 3v2 PIS rate
0.00
majoracao
string 13v2 Unit amount in reais. Multiplied by the quantity, it replaces the usual tax base when the result is not zero, unless an explicit base that applies takes precedence.
0.00
bc_pis
string 13v2 PIS tax base.
Used when you send a value other than zero and there is a taxed calculation, in return invoices, imports or special products recognized by the platform.
0.00

Example of PIS inside the impostos object:

"impostos": {
   "pis": {
     "situacao_tributaria": "99",
     "aliquota": "0.65"
   }
 }

Taxes in the API
COFINS

Send the COFINS (federal revenue tax) data in the cofins object, as shown in the taxes table. COFINS parameters:

Parameter NF-e / NFC-e Type Size Description
situacao_tributaria
string 2 COFINS CST (tax status code)
01 - Taxable transaction - Tax base = Transaction value, standard rate (cumulative/non-cumulative)
02 - Taxable transaction - Tax base = Transaction value (special rate)
03 - Taxable transaction - Tax base = Quantity sold x Rate per product unit
04 - Taxable transaction - Single-phase taxation - (Zero rate)
05 - Taxable transaction - (Tax substitution)
06 - Taxable transaction - (Zero rate)
07 - Transaction exempt from the contribution
08 - Transaction outside the scope of the contribution
09 - Transaction with the contribution suspended
49 - Other outbound transactions
50 - Transaction with right to credit - Linked only to taxed revenue in the domestic market
51 - Transaction with right to credit - Linked only to untaxed revenue in the domestic market
52 - Transaction with right to credit - Linked only to export revenue
53 - Transaction with right to credit - Linked to taxed and untaxed revenue in the domestic market
54 - Transaction with right to credit - Linked to taxed revenue in the domestic market and export revenue
55 - Transaction with right to credit - Linked to untaxed revenue in the domestic market and export revenue
56 - Transaction with right to credit - Linked to taxed and untaxed revenue in the domestic market, and export revenue
60 - Presumed credit - Purchase linked only to taxed revenue in the domestic market
61 - Presumed credit - Purchase linked only to untaxed revenue in the domestic market
62 - Presumed credit - Purchase linked only to export revenue
63 - Presumed credit - Purchase linked to taxed and untaxed revenue in the domestic market
64 - Presumed credit - Purchase linked to taxed revenue in the domestic market and export revenue
65 - Presumed credit - Purchase linked to untaxed revenue in the domestic market and export revenue
66 - Presumed credit - Purchase linked to taxed and untaxed revenue in the domestic market, and export revenue
67 - Presumed credit - Other transactions
70 - Purchase without right to credit
71 - Purchase with exemption
72 - Purchase with suspension
73 - Purchase at zero rate
74 - Purchase outside the scope of the contribution
75 - Purchase by tax substitution
98 - Other inbound transactions
99 - Other transactions
Send the CST that applies. The validation of taxes sent directly has no default.
aliquota
string 3v2 COFINS rate
0.00
majoracao
string 13v2 Unit amount in reais. Multiplied by the quantity, it replaces the usual tax base when the result is not zero, unless an explicit base that applies takes precedence.
0.00
bc_cofins
string 13v2 COFINS tax base.
Used when you send a value other than zero and there is a taxed calculation, in return invoices, imports or special products recognized by the platform.
0.00

Example of COFINS inside the impostos object:

"impostos": {
   "cofins": {
     "situacao_tributaria": "99",
     "aliquota": "3.00"
   }
 }

Taxes in the API
ISSQN

With ISSQN (city service tax) you can issue a combined NF-e, also called a mixed NF-e. It records a service together with the sale of products in the same transaction. The city must have an agreement with the state SEFAZ, so that SEFAZ collects the taxes and passes them on to the city.

Send the ISSQN data in the issqn object, together with the pis and cofins taxes. In the validation of direct taxes, send cnae if the company has no ISSQN CNAE (activity code) registered. The current validation rejects exigibilidade values 6 and 7 with a required-parameter error for processo, even if you send the process. ISSQN parameters:

Parameter NF-e / NFC-e Type Size Description
codigo_cfop
string 4 CFOP (transaction code)
0.000
exigibilidade
integer 1 ISS enforceability indicator. The current validation rejects 6 and 7, even with processo sent.
1 - Enforceable
2 - Not applicable
3 - Exemption
4 - Export
5 - Immunity
6 - Enforceability suspended by court order
7 - Enforceability suspended by administrative proceeding
item_servico
string 5 Item of the service list (ABRASF standard) that classifies the service. You must send item_servico or codigo_servico. If you send only the second one, its value is used as the service item.
00.00
incentivo_fiscal
string 1 Tax incentive indicator
1 - Yes
2 - No
aliquota
string 3v2 ISSQN rate
0.00
deducao
string 13v2 Deduction from the tax base
0.00
retencoes
string 13v2 Amount of other withholdings
0.00
desconto_incondicionado
string 13v2 Amount of the unconditional discount
0.00
desconto_condicionado
string 13v2 Amount of the conditional discount
0.00
iss_retido
string 13v2 Amount of ISS withheld
0.00
municipio
string --- City where the tax applies
E.g.: Brasília

Default: the company's city
codigo_servico
string 1-20 Code of the service provided in the city
processo
string 1-30 Number of the court or administrative proceeding that suspends enforceability
The validation of direct taxes currently rejects exigibilidade 6 or 7, even when you send this field. This flow does not issue invoices with suspension.

Example of ISSQN inside the impostos object:

"impostos": {
   "issqn": {
     "codigo_cfop": "5.933",
     "exigibilidade": 1,
     "codigo_servico": "10.1",
     "incentivo_fiscal": 2,
     "aliquota": "5.00",
     "deducao": "19058.70"
   },
   "pis": {
     "situacao_tributaria": "02",
     "aliquota": "0.65"
   },
   "cofins": {
     "situacao_tributaria": "02",
     "aliquota": "4.00"
   }
 }

Taxes in the API
Tax withholding

Send the tax withholding data in the retencao_tributos object, inside the impostos key at the root of the JSON (same level as pedido and produtos). The values are invoice totals (group retTrib of the XML), not values per product. The parameters are:

Parameter NF-e / NFC-e Type Size Description
valor_pis
string 13v2 Withheld PIS amount
0.00
valor_cofins
string 13v2 Withheld COFINS amount
0.00
valor_csll
string 13v2 Withheld CSLL amount
0.00
bc_irrf
string 13v2 IRRF tax base
0.00
valor_irrf
string 13v2 Withheld IRRF amount
0.00
bc_previdencia
string 13v2 Tax base of the social security withholding
0.00
valor_previdencia
string 13v2 Amount of the social security withholding
0.00
Note: Send the retencao_tributos parameter only in the impostos key at the root of the JSON. If you send it inside produtos[].impostos, it is ignored and the withholding is not added to the XML. The root impostos key accepts only the retencao_tributos object. ICMS, IPI, PIS, COFINS, ISSQN and IBS/CBS still go in the impostos of each product.

Illustrative outline of the two levels (it has omissions and comments; it is not a JSON to send): taxes in produtos and tax withholding at the root of the JSON:

{
  "pedido": { ... },
  "produtos": [
    {
      "nome": "Produto exemplo",
      ...
      "impostos": {            // product taxes
        "icms": { ... },
        "pis": { ... },
        "cofins": { ... }
      }
    }
  ],
  "impostos": {                // JSON root
    "retencao_tributos": {
      "valor_pis": "12.58",
      "valor_cofins": "45.62",
      "valor_csll": "20.42"
    }
  }
}

Taxes in the API
Import

Send the import tax data in the importacao object, as shown in the taxes table.

Parameter NF-e / NFC-e Type Size Description
aliquota
string 3v2 Decimal rate of the import tax
0.00 (normalized to 2 decimal places)
iof
string 3v2 IOF (financial transactions tax) rate
0.00

Example of import data inside the impostos object:

"impostos": {
   "importacao": {
     "aliquota": "18.00"
   }
 }

Taxes in the API
Tax calculation

The invoice total includes items such as ICMS-ST and FCP-ST; PIS is not added separately in this formula. Companies that work with tax substitution (ICMS-ST) can get the total tax amounts before issuing the invoice, for billing and audit.

To request the tax calculation, send the calculo_impostos parameter as shown in the Invoice information table, with the same procedure you use to issue an invoice.

When the invoice has IBS/CBS (tax reform), the response also includes the impostos.ibs_cbs group and the ibs_estadual, ibs_municipal and cbs rates in aliquotas. These are the effective rates: they already include the reduction of the cClassTrib (tax classification), when there is one. The monofasico and estorno_credito groups are returned only when they exist on the invoice.

In a successful response, the JSON object has impostos, aliquotas and pedido. impostos.issqn returns the services total, not the ISSQN tax. total_tributacao is the approximate tax burden. Partial example with illustrative values:

{
  "impostos": {
      "ipi": "0.00",
      "icms": "0.00",
      "icms_st": "0.00",
      "pis": "0.00",
      "cofins": "0.00",
      "fcp_st": "0.00",
      "fcp_dest": "0.00",
      "fcp_dest_base": "0.00",
      "issqn": "0.00",
      "total_tributacao": "0.00",
      "ibs_cbs": {
          "base_calculo": "0.00",
          "ibs": "0.00",
          "ibs_estadual": "0.00",
          "ibs_municipal": "0.00",
          "cbs": "0.00",
          "ibs_diferimento": {
              "estadual": "0.00",
              "municipal": "0.00"
          },
          "cbs_diferimento": "0.00",
          "ibs_credito_presumido": "0.00",
          "cbs_credito_presumido": "0.00",
          "total_nf_ibs_cbs": "1000.00",
          "monofasico": {
              "ibs": "0.00",
              "cbs": "0.00",
              "ibs_retencao": "0.00",
              "cbs_retencao": "0.00",
              "ibs_retido": "0.00",
              "cbs_retido": "0.00"
          },
          "estorno_credito": {
              "ibs": "0.00",
              "cbs": "0.00"
          }
      }
  },
  "aliquotas": {
      "icms": [ "0.00" ],
      "icms_st": [ "0.00" ],
      "pis": [ "0.00" ],
      "cofins": [ "0.00" ],
      "ipi": [ "0.00" ],
      "ibs_estadual": [ "0.00" ],
      "ibs_municipal": [ "0.00" ],
      "cbs": [ "0.00" ]
  },
  "pedido": {
      "produtos": "0.00",
      "frete": "0.00",
      "seguro": "0.00",
      "desconto": "0.00",
      "despesas_acessorias": "0.00",
      "total": "1000.00"
  }
}

Tax reform

Preliminary documentation. This section may change until SEFAZ, the state tax authority, fully implements the tax reform.

The tax reform is coming, and Webmania is ready to help you through the transition. From 2026, the new taxes are phased in gradually, and our API will stay up to date with every requirement.

What changes with the tax reform?

Complementary Law 214/2025 (Lei Complementar 214/2025) created three new taxes. They will gradually replace the current taxes:

  • ✓ IBS - Imposto sobre Bens e Serviços, the state and city goods and services tax (replaces ICMS and ISS)
  • ✓ CBS - Contribuição Social sobre Bens e Serviços, the federal goods and services tax (replaces PIS and COFINS)
  • ✓ IS - Imposto Seletivo, the selective tax (starts in 2027)

When does it start?

Environment Available from Required from
Sandbox (test environment) July 7, 2025 To be defined
Production October 20, 2025 January 1, 2026
Important tip: In 2025, filling in the new taxes is optional when you issue invoices in the production environment. Use this period to test and adapt your system!

How will the transition work?

The change to the new taxes is gradual until 2033, for a smooth transition for companies and taxpayers. See the simplified schedule of rate changes:

Year IBS CBS Current taxes
2026 0.1% state 0.90% No changes
2027 0.05% state and 0.05% city 8.80% PIS/COFINS abolished.
IPI rate reduced to 0%, except for products with incentives in the Manaus Free Trade Zone.
2029-2032 Rates set by the Senate Gradual reduction of ICMS and ISS
2033 Transition complete ICMS and ISS abolished

Tax reform
IBS/CBS

To add the new taxes to your invoices, add the ibs_cbs object inside the impostos field of each product.

The table below lists the parameters you can send inside the object:

Parameter NF-e/NFC-e Type Size Description
situacao_tributaria
string 3 IBS and CBS CST (tax status code).
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
classificacao_tributaria
string 6 IBS and CBS cClassTrib (tax classification code).
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
situacao_tributaria_regular
string 3 IBS and CBS CST (tax status code) in the regular regime.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed in the regular regime.
classificacao_tributaria_regular
string 6 IBS and CBS cClassTrib (tax classification code) in the regular regime.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed in the regular regime.
ibs_estadual
object - State IBS tax information
ibs_municipal
object - City IBS tax information
cbs
object - CBS tax information
tributacao_monofasica
object - Single-phase taxation information
Required for tax status code (CST) 620.
credito_presumido
object - IBS and CBS presumed credit information
transferencia_credito
object - IBS and CBS credit transfer information
ajuste_competencia
object - IBS and CBS period adjustment information
Required for tax status code (CST) 811.
estorno_credito
object - IBS and CBS credit reversal information
Required when a credit reversal condition applies to IBS/CBS.

Example of how to fill in the IBS and CBS tax information:

{
  "produtos": [
    {
      "nome": "Camiseta Night Run",
      "ncm": "6109.10.00",
      ...
      "impostos": {
        "icms": {...},
        "ipi": {...},
        "pis": {...},
        "cofins": {...},
        "ibs_cbs": {
          "situacao_tributaria": "000",
          "classificacao_tributaria": "000001",
          "ibs_estadual": {...},
          "ibs_municipal": {...},
          "cbs": {...}
        }
      }
    }
  ]
}

Tax reform
IBS/CBS — Simples Nacional NEW

In short: this applies to the NF-e and NFC-e of companies in Simples Nacional (the small business regime), and of companies in the standard regime (outside Simples Nacional) with a pending request to join Simples Nacional. The invoice now states the company's IBS/CBS regime. Each item states the activity code and the IBS/CBS calculated with the Simples Nacional rates.

When it appliesSandboxProduction
New fields and Simples Nacional calculationAlready availableInvoices processed from December 14, 2026 (Brasília time), whatever issue date is sent
CBS set to zero for companies above the sublimit without the regular regimeInvoices with an issue date from January 1, 2027 (see How it works)
No new field is required when issuing. When you send the activity code or the Simples Nacional rates, the API validates the values and sends them on the invoice. Without a rate, the API calculates the Simples IBS/CBS at 0.00.

Do I need to do anything?

If your company is…What to do
Simples Nacional, above the sublimit or notSend the activity code and the Simples Nacional rates in the item or in the Tax Class (see the order of precedence). If the company chose the regular IBS/CBS regime, check this option in the company settings.
Standard regime, with a pending request to join Simples NacionalIn the company settings, check the pending option and choose the intended regime. Then send the activity code and the rates as above.
Standard regime, with no pending requestNothing changes.
MEI (individual micro-entrepreneur)Nothing. The API stops sending IBS/CBS on MEI invoices, even if the integration sends it.

How it works

The API reads the company's tax regime (enquadramento) from its settings: the tax type (simples_nacional, simples_nacional_sublimite, lucro_normal or mei) and the IBS/CBS regime options. With this, the API decides on its own how the IBS and the CBS of each item go on the invoice. You do not send the regime when issuing.

The regular IBS/CBS regime is the choice of a Simples Nacional company to pay IBS and CBS under the general rules, outside Simples. A pending option is the situation of a standard-regime company that asked to join Simples Nacional and is still waiting for the decision. Above the sublimit (simples_nacional_sublimite) is a Simples Nacional company whose gross revenue exceeds the sublimit.

If your company is…IBS/CBS under the general rules
(state IBS, city IBS and CBS)
IBS/CBS calculated under Simples Nacional
Simples Nacional, without the regular regimeOnly when the IBS/CBS CST of the item requires itIBS and CBS
Simples Nacional above the sublimit, without the regular regimeYes. In 2026, the CBS uses the normal rate. From January 1, 2027, the API sets the CBS to zero; the IBS stays normal.CBS only
Simples Nacional, above the sublimit or not, with the regular regimeYesNo
Standard regime with a pending option for Simples Nacional, without the regular regimeYesIBS and CBS
Standard regime with a pending option for Simples Nacional above the sublimit, without the regular regimeYesCBS only
Standard regime with a pending option, with the regular regimeYesNo
MEI (individual micro-entrepreneur)No IBS/CBS on the invoice

The choice of the regular regime takes effect from January 1, 2027. The API sends the regime according to the company settings.

To set the CBS to zero, the API uses the issue date that goes on the invoice. If data_entrada_saida is earlier than data_emissao, the invoice goes out with the entry/exit date. Example: with data_emissao 2027-01-02 and data_entrada_saida 2026-12-31, the invoice is dated December 31, 2026, and the CBS keeps the normal rate.

Issuing parameters

They apply to Simples Nacional companies (above the sublimit or not) and to standard-regime companies with a pending option. For other companies, the API ignores the fields. You can also save these values once in the Tax Class, or in the Webmania® Panel: in the Tax Class, in the product record and in the Fiscal Issuer.

Where to send each parameter:

  • codigo_atividade_sn: in each item of produtos;
  • aliquota_ibs_sn and aliquota_cbs_sn: inside the ibs_cbs object, in impostos of each item of produtos.

On the adjustment NF-e and on the tax-only complementary NF-e, the fields go in other places; see Special cases.

Parameter NF-e/NFC-e Type Size Description
codigo_atividade_sn
string 2 Simples Nacional activity code of the item.
01, 02, 03, 04 or 90
Send it as text, with two digits: "01", not 1. A code outside the list makes the API reject the invoice. The table below gives the meaning of each code.
aliquota_ibs_sn
string 3v4 IBS rate under Simples Nacional, in %.
From 0 to 100, with a dot and up to four decimal places. E.g. "1.2345"
Used only when the company calculates IBS under Simples (see How it works).
aliquota_cbs_sn
string 3v4 CBS rate under Simples Nacional, in %.
From 0 to 100, with a dot and up to four decimal places. E.g. "0.9000"

Simples Nacional activity codes:

Code When to use
01Resale, or sale of goods manufactured by the company (Annex I)
02Other tangible goods, not subject to ICMS (Annex I)
03Sale of goods manufactured by the company, with incentivized manufacturing in the Manaus Free Trade Zone (Annex II)
04Other tangible goods with incentivized manufacturing in the Manaus Free Trade Zone, not subject to ICMS (Annex II)
90Non-taxable transaction

Where the API gets each value

FieldOrder of precedenceIf it is nowhere
Activity code1. Item in the request or in the Fiscal Issuer (in the Fiscal Issuer, the saved product fills in the item and a code you type wins; if you clear it, the Fiscal Issuer uses the saved code again)
2. Tax Class of the item
The invoice goes out without an activity code
Simples IBS rate and CBS rate1. Item in the request or in the Fiscal Issuer
2. Tax Class of the item
Each rate is resolved separately.
The API uses 0.00

A zero sent in the item counts: "aliquota_cbs_sn": "0" overrides the rate of the Tax Class. The other taxes of the item still come from the Tax Class.

Special cases

CaseWhat you do
Adjustment NF-eSend codigo_atividade_sn at the root of the request and the rates in ibs_cbs. The API applies the code to the generated item, with the same validation.
Tax-only complementary NF-eSend codigo_atividade_sn at the root of the request and the rates in impostos.ibs_cbs. The API applies the code to the generated item, with the same validation.
Return invoice through the /1/nfe/devolucao/ endpointNothing. For an NF-e return, the API copies the activity code of each item and the IBS/CBS of the original invoice. The IBS/CBS is copied only when every returned item has it on the original invoice.
Partial return through the same endpointNothing. The API adjusts the IBS and CBS base and amounts (including deferral and returned tax) and the Simples Nacional amounts to the returned quantity. The other copied groups, such as single-phase taxation, keep the amounts of the original invoice.
Return invoice issued at /1/nfe/emissao/ (finalidade 4)Send the Simples Nacional rates and item amounts equal to those of the original invoice. The API calculates the Simples IBS and CBS from them.
Credit note for goods returned because the recipient refused the delivery (finalidade 5, tipo_credito 03 or 06)Same as the return invoice issued at /1/nfe/emissao/: rates and amounts based on the original invoice.

Simples Nacional examples

Minimal. The product uses a Tax Class that already has the activity code and the Simples rates. You send nothing new.

{
  "produtos": [
    {
      "nome": "Camiseta Night Run",
      "ncm": "6109.10.00",
      "quantidade": 1,
      "subtotal": "1000.00",
      "total": "1000.00",
      "classe_imposto": "REF1000" // activity code and rates come from the Tax Class
    }
  ]
}

Complete. Simples Nacional company without the regular regime. The item overrides the activity code and the CBS rate of the Tax Class; the IBS rate still comes from the Tax Class.

{
  "produtos": [
    {
      "nome": "Camiseta Night Run",
      "ncm": "6109.10.00",
      "quantidade": 1,
      "subtotal": "1000.00",
      "total": "1000.00",
      "desconto": "50.00",
      "classe_imposto": "REF1000",
      "codigo_atividade_sn": "01", // resale of goods; overrides the Tax Class
      "impostos": {
        "ibs_cbs": {
          "aliquota_cbs_sn": "0.9000" // only the CBS changes; the IBS follows the Tax Class
        }
      }
    }
  ],
  "pedido": {
    "frete": "30.00"
  }
}

Tax reform
State IBS

For the state IBS tax information, add the ibs_estadual object inside the ibs_cbs field.

The table below lists the parameters you can send inside the object:

Parameter NF-e/NFC-e Type Size Description
aliquota_diferimento
string 3v2-4 Deferral percentage (the tax is postponed to a later stage)
Required when the CST requires deferral (510 or 515 in the fallback; the tax status table may set the condition).
valor_devolvido
string 13v2 Amount of the returned tax.
0.00

Example of the state IBS:

"ibs_estadual": {
  "aliquota_diferimento": "5.00", // Deferral percentage
  "valor_devolvido": "0.45" // Amount of the returned tax
}

Tax reform
City IBS

For the city IBS tax information, add the ibs_municipal object inside the ibs_cbs field.

The table below lists the parameters you can send inside the object:

Parameter NF-e/NFC-e Type Size Description
aliquota_diferimento
string 3v2-4 Deferral percentage (the tax is postponed to a later stage)
Required when the CST requires deferral (510 or 515 in the fallback; the tax status table may set the condition).
valor_devolvido
string 13v2 Amount of the returned tax.
0.00

Example of the city IBS:

"ibs_municipal": {
  "aliquota_diferimento": "50.00", // Deferral percentage
  "valor_devolvido": "0.45" // Amount of the returned tax
}

Tax reform
CBS

For the CBS information, add the cbs object inside the ibs_cbs field.

The table below lists the parameters you can send inside the object:

Parameter NF-e/NFC-e Type Size Description
aliquota_diferimento
string 3v2-4 Deferral percentage (the tax is postponed to a later stage)
Required when the CST requires deferral (510 or 515 in the fallback; the tax status table may set the condition).
percentual_devolvido
string 3v2-4 Percentage of the returned tax.
Applies only to the NF-e (model 55), while technical note NT 2025.002-RTC v1.40 is in force. Required when there is a positive returned amount. On the NFC-e (model 65), the percentage is ignored. Send only percentual_devolvido and the API derives the amount automatically.
valor_devolvido
string 13v2 Amount of the returned tax.
0.00. On the NF-e, under NT v1.40, a positive amount requires a positive percentual_devolvido; the pair must match the base and the effective rate (tolerance: R$ 0.01).

Example of the CBS (percentage sent and amount derived automatically):

"cbs": {
  "aliquota_diferimento": "50.00", // Deferral percentage
  "percentual_devolvido": "50.0000" // Percentage of the returned tax — the amount will be derived
}

Fragment with an explicit percentage and amount: the amount of 0.45 is consistent only if the base and the effective rate result in a tax of 0.90 before the return. The base and the rate are not in this fragment:

"cbs": {
  "aliquota_diferimento": "50.00", // Deferral percentage
  "percentual_devolvido": "50.0000", // Percentage of the returned tax
  "valor_devolvido": "0.45" // Amount of the returned tax (consistent with the percentage and the rate)
}

Tax reform
CBS zero rate — ZFM/ALC NEW

For a zero CBS rate on transactions in the Manaus Free Trade Zone (ZFM) or in the Free Trade Areas (ALC), add the alc_zfm_cbs object inside the cbs field.
It applies when the issuer and the recipient are in the same incentivized area, with restrictions by NCM (product code).

Parameter NF-e/NFC-e Type Size Description
tipo_aplicacao
string 1 How the zero rate applies.
1 - Manaus Free Trade Zone
2 - Free Trade Area (SUFRAMA)
numero_processo_suframa
string 8-12 SUFRAMA process number (SUFRAMA is the Manaus Free Trade Zone agency).
Required when tipo_aplicacao = 2 (Free Trade Area).
aliquota_efetiva_referencia
string 3v2-4 CBS reference effective rate.
Required when the group is sent (a required element in the XML). A number from 0 to 100, with up to 4 decimal places.
valor_efetivo_referencia
string 13v2 CBS reference effective amount.
Required when the group is sent (a required element in the XML). A number greater than or equal to 0, with up to 2 decimal places.

Example of the CBS zero rate group — ZFM/ALC:

"cbs": {
  "alc_zfm_cbs": {
    "tipo_aplicacao": "2", // Free Trade Area (SUFRAMA)
    "numero_processo_suframa": "12345678", // SUFRAMA process
    "aliquota_efetiva_referencia": "0.9000", // Reference effective rate
    "valor_efetivo_referencia": "0.90" // Reference effective amount
  }
}

Tax reform
Single-phase taxation

When you use tax status code (CST) 620 (single-phase taxation, where the tax is charged once for the whole chain), you must add the tributacao_monofasica object inside the ibs_cbs field.

The required fields depend on the tax classification (cClassTrib) you use. The table below lists the parameters you can send:

The reworked single-phase layout (NT 2025.002-RTC v1.50) is always used in the sandbox. In production, it turns on by the current server date (UTC−3), from November 16, 2026, regardless of data_emissao. With the new layout on, the issue year selects the variant (ad valorem: a percentage of the value; ad rem: a fixed amount per unit): IBS ad valorem until 2028 and ad rem from 2029; CBS ad valorem in 2026 and ad rem from 2027. In the sandbox, the CBS also uses ad rem before 2027 when there is a quantity without the matching value base. The required fields depend on the variant and on the groups the classification enables. The old layout stays in the production branch before the switch.

Parameter NF-e/NFC-e Type Size Description
quantidade_bc
string 13v4 Quantity of the single-phase tax base
Conditional on the ad rem variant of the normal group (620001, 620002, 620004 in the fallback); in the old layout, also on deferral 620003. In the new layout, it does not replace valor_bc when the tax requires ad valorem.
aliquota_ibs
string 3v4 IBS specific rate
Conditional on the ad rem variant of the normal group (620001, 620002, 620004 in the fallback); in the old layout, also on deferral 620003. In the new layout, IBS is ad rem from issue year 2029.
aliquota_cbs
string 3v4 CBS specific rate in the ad rem variant
Conditional on the variant of the normal group (620001, 620002, 620004 in the fallback); in the old layout, also on deferral 620003. The same field holds a percentage in the ad valorem variant described below.
quantidade_bc_retencao
string 13v4 Quantity of the tax base subject to withholding
Required in the group subject to withholding (620002 in the fallback) for the ad rem variant; in the new layout, the ad valorem variant uses valor_bc_retencao.
aliquota_ibs_retencao
string 3v4 IBS rate for withholding
Required for classification 620002 (single-phase subject to withholding).
aliquota_cbs_retencao
string 3v4 CBS rate for withholding
Required for classification 620002 (single-phase subject to withholding).
quantidade_bc_retido
string 13v4 Quantity of the tax base already withheld earlier
Required for classifications 620004, 620005, 620006 (single-phase withheld earlier). Same field in the new layout (NT 2025.002-RTC v1.50) -- the API calculates the amount internally; the new XSD carries only the result, not quantity/rate.
aliquota_ibs_retido
string 3v4 IBS rate withheld earlier
Required for classifications 620004, 620005, 620006 (single-phase withheld earlier). Same field in the new layout (NT 2025.002-RTC v1.50).
aliquota_cbs_retido
string 3v4 CBS rate withheld earlier
Required for classifications 620004, 620005, 620006 (single-phase withheld earlier). Same field in the new layout (NT 2025.002-RTC v1.50).
aliquota_diferimento_ibs
string 3v4 IBS deferral percentage (0 to 100)
Required for deferral 620003 in the old layout; the new layout neither validates nor uses this percentage.
aliquota_diferimento_cbs
string 3v4 CBS deferral percentage (0 to 100)
Required for deferral 620003 in the old layout; the new layout neither validates nor uses this percentage.
valor_bc NEW
string 13v2 Tax base amount of ad valorem single-phase taxation
Required for classifications 620001, 620002, 620004 (ad valorem variant; always in the sandbox, in production from November 16, 2026).
aliquota_uf NEW
string 3v4 State IBS ad valorem single-phase rate
Required for classifications 620001, 620002, 620004 (IBS ad valorem variant; always in the sandbox, in production from November 16, 2026).
aliquota_mun NEW
string 3v4 City IBS ad valorem single-phase rate
Required for classifications 620001, 620002, 620004 (IBS ad valorem variant; always in the sandbox, in production from November 16, 2026).
aliquota_cbs NEW
string 3v4 CBS ad valorem single-phase rate
Required for classifications 620001, 620002, 620004 (CBS ad valorem variant; same field as the ad rem classifications above, depending on the variant in force; always in the sandbox, in production from November 16, 2026).
valor_bc_retencao NEW
string 13v2 Ad valorem single-phase tax base amount subject to withholding
Required for classification 620002 (ad valorem variant subject to withholding; always in the sandbox, in production from November 16, 2026).
aliquota_ibs_retencao NEW
string 3v4 IBS single-phase rate subject to withholding (ad valorem variant)
Required for classification 620002 (IBS ad valorem variant; same field as the ad rem classifications above, depending on the variant in force; always in the sandbox, in production from November 16, 2026).
aliquota_cbs_retencao NEW
string 3v4 CBS single-phase rate subject to withholding (ad valorem variant)
Required for classification 620002 (CBS ad valorem variant; same field as the ad rem classifications above, depending on the variant in force; always in the sandbox, in production from November 16, 2026).
quantidade_bc_biocombustivel NEW
string 11v0-4 Quantity of the tax base for the biofuel blend difference
Used in the new layout when the classification enables the biofuel blend difference (620004, 620005 in the fallback; always in the sandbox, in production from November 16, 2026). Optional even for these classifications: if omitted, the XML is built with zero (qBCBioComb = 0.0000), without rejection; the integrator must calculate the value.
valor_ibs_diferenca NEW
string 13v2 IBS amount of the biofuel blend difference
Required for classifications 620004, 620005 (biofuel blend difference; always in the sandbox, in production from November 16, 2026).
valor_cbs_diferenca NEW
string 13v2 CBS amount of the biofuel blend difference
Required for classifications 620004, 620005 (biofuel blend difference; always in the sandbox, in production from November 16, 2026).

Fragment for classification 620001 in the old ad rem layout. On its own, it does not work for the new layout in the sandbox, or in production after the switch; in that case, send the bases and rates of the required variant:

"tributacao_monofasica": {
  "quantidade_bc": "1000.0000", // Quantity of the tax base
  "aliquota_ibs": "0.4500", // IBS rate 
  "aliquota_cbs": "0.9500" // CBS rate 
}

Tax reform
Presumed credit

The presumed credit lets you use tax credits in specific situations. To use it, add the credito_presumido object inside the ibs_cbs field.

The table below lists the parameters you can send inside the object:

Parameter NF-e/NFC-e Type Size Description
classificacao
string 1-2 Presumed credit classification code
See the classification table below
bc
string 13v2 Tax base of the transaction
aliquota_ibs
string 2v4 Presumed credit percentage for the IBS
Required when the credit classification applies to the IBS and the group is used.
aliquota_cbs
string 2v4 Presumed credit percentage for the CBS
Required when the credit classification applies to the CBS and the group is used.
Presumed credit classifications
Code Description Applies to
3 Purchase of materials for recycling IBS and CBS
4 Used movable goods for resale IBS and CBS
5 Automotive regime - Art. 310 CBS
6 Automotive regime - Art. 311 CBS
7 Manaus Free Trade Zone - Art. 444 IBS
10 Manaus Free Trade Zone - Art. 450 CBS
11 Free Trade Area - Art. 462 IBS
13 Free Trade Area (Industry) - Art. 467 CBS

Example of the presumed credit:

"credito_presumido": {
  "classificacao": "5", // Classification code
  "bc": "100.00", // Tax base of the transaction
  "aliquota_ibs": "0.10", // IBS percentage
  "aliquota_cbs": "0.05" // CBS percentage
}

Tax reform
Credit transfer

On an NF-e that transfers IBS and CBS credits (CST 800), add the transferencia_credito object inside the ibs_cbs field. This tax status requires finalidade=6 and tipo_debito equal to 01 or 05. Both amounts below are required in this group:

The table below lists the parameters you can send inside the object:

Parameter NF-e/NFC-e Type Size Description
valor_ibs
string 13v2 IBS amount to transfer
0.00
valor_cbs
string 13v2 CBS amount to transfer
0.00

Example of the credit transfer:

"transferencia_credito": {
  "valor_ibs": "2.50", // IBS amount to transfer
  "valor_cbs": "4.00" // CBS amount to transfer
}

Tax reform
Period adjustment

When you need to adjust the IBS and CBS calculation period (CST 811), add the ajuste_competencia object inside the ibs_cbs field:

The table below lists the parameters you can send inside the object:

Parameter NF-e/NFC-e Type Size Description
competencia_apuracao
string 7 Year and month of the calculation period
Format: YYYY-MM
valor_ibs
string 13v2 IBS amount to adjust
0.00
valor_cbs
string 13v2 CBS amount to adjust
0.00

Example of the period adjustment:

"ajuste_competencia": {
  "competencia_apuracao": "2025-12", // Year and month of the calculation period
  "valor_ibs": "2.50", // IBS amount to adjust
  "valor_cbs": "4.00" // CBS amount to adjust
}

Tax reform
Credit reversal

When you need to reverse an IBS and CBS credit, add the estorno_credito object inside the ibs_cbs field. The group is required when the cClassTrib (tax classification) calls for a reversal, or when finalidade=6 and tipo_debito=07, regardless of that indicator. Send the two numeric amounts below:

The table below lists the parameters you can send inside the object:

Parameter NF-e/NFC-e Type Size Description
valor_ibs
string 13v2 IBS amount to reverse
0.00
valor_cbs
string 13v2 CBS amount to reverse
0.00

Example of the credit reversal:

"estorno_credito": {
  "valor_ibs": "2.50", // IBS amount to reverse
  "valor_cbs": "4.00" // CBS amount to reverse
}

Invoice types
Return/reversal

This is the simplified Webmania way to issue a return invoice for goods (Devolução) or a reversal NF-e (Estorno). Both cancel the tax effects of an invoice issued before. The new invoice is built from the original invoice.

To issue a return or reversal invoice, send a POST request to the URL /1/nfe/devolucao/.

In the JSON body, send chave or uuid of the original invoice, natureza_operacao, ambiente and exactly one of classe_imposto and codigo_cfop. For a partial return, also send produtos and, if needed, quantidade.

In the endpoint /1/nfe/devolucao/, the reference to the original invoice is automatic. You send only the chave (or uuid) of the original invoice. Webmania then references each returned item with the access key and the item number of the original invoice. You do not need to send dfe_referenciado or change your integration. For a custom invoice through the endpoint /1/nfe/emissao/ with finalidade=4, reference the original invoice in the header (nfe_referenciada) or per item (dfe_referenciado). See Referenced tax document.
Parameter NF-e Type Size Description
chave | uuid
string 44 | 36 Access key or UUID of the NF-e issued before
natureza_operacao
string 1-60 Nature of the transaction
ambiente
integer 1 SEFAZ environment
1 - Production
2 - Sandbox
classe_imposto
string --- Tax Class for the return or reversal.
Required when codigo_cfop is not sent. Do not send both fields together.
codigo_cfop
string 4 CFOP (transaction code) for the return or reversal.
Required when classe_imposto is not sent. Do not send both fields together. Send the CFOP of the transaction; the API removes the punctuation.
produtos
array --- Required for a partial return:
1-based selectors of the items of the original invoice.
Each value gives the sequential position (1-based) of the product in the original NF-e: the first item is 1, the second is 2, and so on. You do not need to return every product: list only the returned items. If you send quantidade, both arrays must have the same length and the same order. Webmania finds the matching item in the original invoice automatically, so you do not need to send it.
quantidade
array --- Optional for a partial return:
Number of units returned for each selected item.
If sent, the array must have the same length as the produtos array and give the returned quantity in the same order. Each quantity must be numeric, greater than zero and not greater than the original quantity of the item. If the lengths differ, the request is rejected.
volume
string 1-15 Number of packages carried. In this endpoint, only a value other than zero replaces the package count copied from the original invoice. If you leave the field out or send 0, the copied package count stays.
informacoes_fisco
string 1-2000 Information for the tax authority
informacoes_complementares
string 1-5000 Additional information for the consumer
url_notificacao
string --- Notification URL for all status updates of the return NF-e

Example of a return invoice request:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "chave":"00000000000000000000000000000000000000000000",
  "natureza_operacao":"Devolução de venda de produção do estabelecimento",
  "codigo_cfop":"1.202", // CFOP code of the return
  "produtos": [ 2, 3 ], // Sequential numbers of the products
  "quantidade": [ 5, 1 ], // E.g.: product 2 = 5 units / product 3 = 1 unit
  "ambiente":"1", // 1 - Production or 2 - Sandbox
  "volume":"1" // Replaces the copied package count; leave it out or send 0 to keep the original value.
}' \
https://webmania.com.br/api/1/nfe/devolucao/

Example of a reversal invoice request:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "chave":"00000000000000000000000000000000000000000000",
  "natureza_operacao":"999 - Estorno de NF-e não cancelada no prazo legal",
  "codigo_cfop":"1.102", "ambiente":2 // Reverse CFOP of transaction 5.102; 2 - Sandbox
}' \
https://webmania.com.br/api/1/nfe/devolucao/

Example of an HTTP 200 response for an approved invoice. The response depends on the result of the transaction. The example shows uuid, status, nfe, serie, recibo, chave, xml, danfe and log. recibo is included only on approval, when a receipt number is available. The links are not returned for an NF-e in processing or in contingency mode. Validation failures return error. Do not treat HTTP 200 as tax authorization.

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identification number
  "status": "aprovado", // aprovado, reprovado, cancelado, denegado, processamento or contingencia
  "nfe": "25000", // NF-e number
  "serie": "1", // Series number
  "recibo": "000000000000000", // Receipt number
  "chave": "00000000000000000000000000000000000000000000", // Access key number
  "xml": "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/",
  "danfe": "http://nfe.seudominio.com.br/danfe/[chave|uuid]/",
  "log": "{...}" // SEFAZ response log
}
Reference per item: this flow has no exception by CFOP. When the simplified return is rebuilt from the original XML, Webmania fills dfe_referenciado for each product, including for codigo_cfop: "1.202". Your integration does not need to send this group.

Invoice types
Adjustment

The adjustment invoice (Nota Fiscal de Ajuste) is used only for specific bookkeeping needs of companies in the actual profit or presumed profit regime (Lucro Real or Lucro Presumido). It does not represent goods going out or coming in. It is used for an ICMS credit note, such as a transfer, a refund or a return of ICMS (state sales tax).

To issue an adjustment invoice, send a POST request to the URL /1/nfe/ajuste/.

In the JSON body, send operacao, natureza_operacao, codigo_cfop, at least one of valor_icms and valor_icms_st, ambiente and cliente. The ibs_cbs object is optional at the root. When you send it, it is validated with the rules of the group of the complementary NF-e and applied to the adjustment item.

Reversal invoices for SEFAZ SC and ES (the states of Santa Catarina and Espírito Santo), which use the adjustment purpose to cancel invoices more than 24 hours old, must be issued at the endpoint /1/nfe/devolucao/.
Parameter NF-e Type Size Description
operacao
integer 1 Transaction type of the invoice
0 - Incoming
1 - Outgoing
natureza_operacao
string 1-60 Nature of the transaction
codigo_cfop
string 4 CFOP (transaction code) of the adjustment
valor_icms
string 13v2 ICMS amount to adjust
Required when valor_icms_st is not sent. Send a numeric value; format: 0.00.
valor_icms_st
string 13v2 ICMS ST (tax substitution) amount to adjust
Required when valor_icms is not sent. Send a numeric value; format: 0.00.
ambiente
integer 1 SEFAZ environment
1 - Production
2 - Sandbox
cliente
object --- Customer information
situacao_tributaria
string 2-3 ICMS CST or CSOSN (tax status code)
The tax status of the ICMS adjustment transaction. If left out, the API uses 900 for an issuer in Simples Nacional and 90 in all other cases.
informacoes_fisco
string 1-2000 Information for the tax authority
informacoes_complementares
string 1-5000 Additional information for the consumer

Example of an adjustment invoice request:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "operacao": 1,
  "natureza_operacao": "CREDITO ICMS S/ ESTOQUE",
  "codigo_cfop": "2.949",
  "valor_icms": "1000.00", // ICMS amount to adjust
  "ambiente": "1",
  "cliente": {
    "cpf": "000.000.000-00",
    "nome_completo": "Nome do Cliente",
    "endereco": "Av. Brg. Faria Lima",
    "complemento": "Escritório",
    "numero": "1000",
    "bairro": "Itaim Bibi",
    "cidade": "São Paulo",
    "uf": "SP",
    "cep": "00000-000",
    "telefone": "(00) 0000-0000",
    "email": "nome@email.com"
  }
}' \
https://webmania.com.br/api/1/nfe/ajuste/

Example of an HTTP 200 response for an approved invoice. The response depends on the result of the transaction. The example shows the fields uuid, status, nfe, serie, recibo, chave, xml, danfe and log. recibo is included only on approval, when a receipt number is available. The links are not returned for an NF-e in processing or in contingency mode. Validation failures return error. Do not treat HTTP 200 as tax authorization.

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identification number
  "status": "aprovado", // aprovado, reprovado, cancelado, denegado, processamento or contingencia
  "nfe": "25000", // NF-e number
  "serie": "1", // Series number
  "recibo": "000000000000000", // Receipt number
  "chave": "00000000000000000000000000000000000000000000", // Access key number
  "xml": "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/",
  "danfe": "http://nfe.seudominio.com.br/danfe/[chave|uuid]/",
  "log": "{...}" // SEFAZ response log
}

Invoice types
Complementary

The complementary invoice (Nota Fiscal Complementar) adds data and amounts that were missing from the original invoice. It is used to increase the price and quantity of the goods, or to add missing amounts of the taxes ICMS (state sales tax), ICMS-ST (tax substitution), IPI (federal manufacturing tax), ISSQN (city service tax), IBS and CBS (the new goods and services taxes).

To issue a complementary invoice, send a POST request to the URL /1/nfe/complementar/.

The invoice is an NF-e model 55 with purpose 2. In the JSON body, send chave or uuid of the referenced invoice, operacao, natureza_operacao, ambiente and cliente. Send produtos to add price/quantity, or impostos to add taxes. agropecuario is optional.

Parameter NF-e Type Size Description
chave | uuid
string 44 | 36 Send one of the options: chave (44 characters) or uuid (36 characters) of the NF-e issued before.
operacao
integer 1 Transaction type of the invoice
0 - Incoming
1 - Outgoing
natureza_operacao
string 1-60 Nature of the transaction
ambiente
integer 1 SEFAZ environment
1 - Production
2 - Sandbox
cliente
object --- Customer information
produtos
array (objects) --- Required to add price and/or quantity:
Information of the complementary products only
0.00
impostos
object --- To add ICMS, ICMS-ST, IPI, ISSQN, IBS and CBS without sending products:
Information of the complementary taxes. When you send products, use produtos[].impostos.
0.00
agropecuario
object --- Optional for a complementary NF-e:
Send only one block, defensivos or guia_transito, with the same contract as a regular invoice.
documento_adicao
object --- In a tax complement without produtos, with operacao=0, the data is applied to the generated item. Take the import data from the DI (import declaration). When you send produtos, send the import data in each item, as shown in the Products table.
informacoes_fisco
string 1-2000 Information for the tax authority
informacoes_complementares
string 1-5000 Additional information for the consumer

Short structure of the complementary request. Replace the { ... } parts with valid objects before you send it. Choose products or taxes, according to what you complement:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "chave": "00000000000000000000000000000000000000000000",
  "operacao": 1,
  "natureza_operacao": "COMPLEMENTAR",
  "ambiente": "1",
  "cliente": {
    "cpf": "000.000.000-00",
    "nome_completo": "Nome do Cliente",
    "endereco": "Av. Brg. Faria Lima",
    "complemento": "Escritório",
    "numero": "1000",
    "bairro": "Itaim Bibi",
    "cidade": "São Paulo",
    "uf": "SP",
    "cep": "00000-000",
    "telefone": "(00) 0000-0000",
    "email": "nome@email.com"
  },
  "produtos": [{ ... }], // Add price and/or quantity (accepts ibs_cbs per item)
  "impostos": { ... }, // Add taxes (includes ibs_cbs)
  "agropecuario": { ... } // Optional: defensivos or guia_transito
}' \
https://webmania.com.br/api/1/nfe/complementar/

Sample with agropecuario.guia_transito. Replace { ... } with the full customer and tax data:

{
  "chave": "00000000000000000000000000000000000000000000",
  "operacao": 1,
  "natureza_operacao": "COMPLEMENTAR - GUIA TRANSITO",
  "ambiente": "2",
  "cliente": { ... },
  "impostos": { ... },
  "agropecuario": {
    "guia_transito": {
      "tipo": 1,
      "uf": "SP",
      "serie": "A1",
      "numero": "123456789"
    }
  }
}

Sample with agropecuario.defensivos. Replace { ... } with the full customer and product data, and use a valid CPF (individual taxpayer ID):

{
  "chave": "00000000000000000000000000000000000000000000",
  "operacao": 1,
  "natureza_operacao": "COMPLEMENTAR - DEFENSIVOS",
  "ambiente": "2",
  "cliente": { ... },
  "produtos": [{ ... }],
  "agropecuario": {
    "defensivos": [
      {
        "numero_receituario": "REC-2026-001",
        "cpf_responsavel_tecnico": "11122233344"
      }
    ]
  }
}

Example of an HTTP 200 response for an approved invoice. The response depends on the result of the transaction. The example shows the fields uuid, status, nfe, serie, recibo, chave, xml, danfe and log. The receipt number depends on approval and on being available. Links are not returned for an NF-e in processing or in contingency mode. Validation failures return error. HTTP 200 does not confirm tax authorization.

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identification number
  "status": "aprovado", // aprovado, reprovado, cancelado, denegado, processamento or contingencia
  "nfe": "25000", // NF-e number
  "serie": "1", // Series number
  "recibo": "000000000000000", // Receipt number
  "chave": "00000000000000000000000000000000000000000000", // Access key number
  "xml": "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/",
  "danfe": "http://nfe.seudominio.com.br/danfe/[chave|uuid]/",
  "log": "{...}" // SEFAZ response log
}

Invoice types > Complementary
Price and/or quantity

Send the product information in the produtos array, one object per product, as shown in the complementary invoice table.

Identify each product as shown in the Products table and send the amounts to add. In the ICMS of the item, send codigo_cfop and situacao_tributaria inside produtos[].impostos.icms. Send quantidade, or the pair subtotal and total. If the quantity is not sent, a quantity of zero is used. The block produtos[].impostos.ibs_cbs is optional. When you send IBS/CBS, base_calculo is required and accepts 0.00.

Parameter NF-e Type Size Description
quantidade
string 11v4 Required to add quantity:
Number of items
subtotal
string 2 decimal places Required to add price:
Unit price of the product, formatted with two decimal places in the complementary invoice
0.00
total
string 13v2 Required to add price:
Total price (quantity x unit price)
0.00
codigo_cfop
string 4 CFOP (transaction code)
Send the CFOP code of the complementary ICMS transaction
situacao_tributaria
string 2-3 ICMS CST or CSOSN (tax status code)
2-digit CST or 3-digit CSOSN (tax status code for Simples Nacional companies), according to the regime of the complementary ICMS transaction
impostos.ibs_cbs
object --- Optional block to add IBS/CBS to the item.
Requires base_calculo, situacao_tributaria and classificacao_tributaria. Does not accept CST 800; percentual_devolvido is ignored. You can send valor_devolvido in state IBS, city IBS and CBS.
beneficio_fiscal
string 8 Tax benefit code in the state (UF)
Use the same code adopted in the EFD and other tax filings, in the states that require it.
gtin
string 8-14 GTIN of the product, formerly the EAN code or barcode
gtin_tributavel
string 8-14 Taxable GTIN of the product, formerly the EAN code or barcode
cod_barras
string 3-30 Own or third-party barcode that differs from the GTIN standard
cod_barras_tributavel
string 8-14 Own or third-party taxable barcode that differs from the GTIN standard
unidade_tributavel
string 1-6 Taxable unit of the product
Example:
UN - Unit
KG - Kilogram
subtotal_tributavel
string 11v10 Taxable unit price of the product
0.00 (full value without discounts)
quantidade_tributavel
string 11v4 Taxable quantity of the product. Accepts a decimal value, for example 1.5000

Example of a price and/or quantity complement. The rates and tax codes must match the transaction:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "nfe_referenciada": "00000000000000000000000000000000000000000000",
  "operacao": 1,
  "natureza_operacao": "COMPLEMENTAR",
  "ambiente": "1",
  "cliente": {
    "cpf": "000.000.000-00",
    "nome_completo": "Nome do Cliente",
    "endereco": "Av. Brg. Faria Lima",
    "complemento": "Escritório",
    "numero": "1000",
    "bairro": "Itaim Bibi",
    "cidade": "São Paulo",
    "uf": "SP",
    "cep": "00000-000",
    "telefone": "(00) 0000-0000",
    "email": "nome@email.com"
  },
  "produtos": [
    {
      "nome": "Camisetas Night Run",
      "codigo": "camiseta-night-run",
      "ncm": "6109.10.00",
      "cest": "28.038.00",
      "quantidade": 3, // Add quantity
      "unidade": "UN",
      "origem": 0,
      "subtotal": "44.90", // Add price
      "total": "134.70", // Add price
      "beneficio_fiscal": "PR000000", // Tax benefit code (optional)
      "impostos": {
        "icms": {
          "codigo_cfop": "6.102",
          "situacao_tributaria": "101"
        },
        "ibs_cbs": {
          "situacao_tributaria": "000",
          "classificacao_tributaria": "000001",
          "base_calculo": "0.00",
          "ibs_estadual": { "valor_devolvido": "0.00" },
          "ibs_municipal": { "valor_devolvido": "0.00" },
          "cbs": { "valor_devolvido": "0.00" }
        }
      }
    }
  ]
}' \
https://webmania.com.br/api/1/nfe/complementar/

Example of an HTTP 200 response for an approved invoice. The response depends on the result of the transaction. The example shows the fields uuid, status, nfe, serie, recibo, chave, xml, danfe and log. The receipt number depends on approval and on being available. Links are not returned for an NF-e in processing or in contingency mode. Validation failures return error. HTTP 200 does not confirm tax authorization.

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identification number
  "status": "aprovado", // aprovado, reprovado, cancelado, denegado, processamento or contingencia
  "nfe": "25000", // NF-e number
  "serie": "1", // Series number
  "recibo": "000000000000000", // Receipt number
  "chave": "00000000000000000000000000000000000000000000", // Access key number
  "xml": "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/",
  "danfe": "http://nfe.seudominio.com.br/danfe/[chave|uuid]/",
  "log": "{...}" // SEFAZ response log
}

Invoice types > Complementary
Complementary tax

Without produtos, send the taxes in impostos, as shown in the complementary invoice table. When you send produtos, send the taxes of each item in produtos[].impostos. The root IBS/CBS is applied to the first generated item only when no products are sent.

Example of a complementary ICMS tax request:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "nfe_referenciada": "00000000000000000000000000000000000000000000",
  "operacao": 1,
  "natureza_operacao": "COMPLEMENTAR",
  "ambiente": "1",
  "cliente": {
    "cpf": "000.000.000-00",
    "nome_completo": "Nome do Cliente",
    "endereco": "Av. Brg. Faria Lima",
    "complemento": "Escritório",
    "numero": "1000",
    "bairro": "Itaim Bibi",
    "cidade": "São Paulo",
    "uf": "SP",
    "cep": "00000-000",
    "telefone": "(00) 0000-0000",
    "email": "nome@email.com"
  },
  "impostos": {
    "codigo_cfop": "6.102", // CFOP code
    "situacao_tributaria": "900", // ICMS tax status
    "bc_icms": "100.00", // Tax base of the ICMS complement
    "valor_icms": "18.00", // Amount of the ICMS complement
    "valor_fcp": "1.00", // Ignored in this example with CSOSN 900; see the accepted CSTs in the table
    "beneficio_fiscal": "PR000000" // Tax benefit code (optional)
  }
}' \
https://webmania.com.br/api/1/nfe/complementar/

Example of an HTTP 200 response for an approved invoice. The response depends on the result of the transaction. The example shows the fields uuid, status, nfe, serie, recibo, chave, xml, danfe and log. The receipt number depends on approval and on being available. Links are not returned for an NF-e in processing or in contingency mode. Validation failures return error. HTTP 200 does not confirm tax authorization.

{
    "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identification number
    "status": "aprovado", // aprovado, reprovado, cancelado, denegado, processamento or contingencia
    "nfe": "25000", // NF-e number
    "serie": "1", // Series number
    "recibo": "000000000000000", // Receipt number
    "chave": "00000000000000000000000000000000000000000000", // Access key number
    "xml": "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/",
    "danfe": "http://nfe.seudominio.com.br/danfe/[chave|uuid]/",
    "log": "{...}" // SEFAZ response log
}

You can also add IBS/CBS taxes inside the object impostos.ibs_cbs:

"impostos": {
    "codigo_cfop": "6.102",
    "ibs_cbs": {
      "situacao_tributaria": "000",
      "classificacao_tributaria": "000001",
      "base_calculo": "0.00",
      "ibs_estadual": { "valor_devolvido": "0.00" },
      "ibs_municipal": { "valor_devolvido": "0.00" },
      "cbs": { "valor_devolvido": "0.00" }
    }
 }
Complementary tax: ICMS
Parameter NF-e Type Size Description
codigo_cfop
string 4 CFOP (transaction code)
Send the CFOP code of the complementary ICMS transaction
situacao_tributaria
string 2-3 ICMS CST or CSOSN (tax status code)
2-digit CST or 3-digit CSOSN (tax status code for Simples Nacional companies), according to the regime of the complementary ICMS transaction
bc_icms
string 13v2 Tax base of the ICMS complement
0.00
valor_icms
string 13v2 Amount of the ICMS complement
0.00
valor_operacao
string 13v2 ICMS amount of the transaction for CST 51. If not sent, it is calculated from the tax base and rate of the transaction.
0.00
valor_fcp
string 13v2 FCP (poverty fund surcharge) amount of the ICMS, with valor_icms and CST 00, 10, 20, 51, 70 or 90. In all other cases it is ignored.
0.00
aliquota_diferimento
string 3v4 Deferral percentage of ICMS CST 51, formatted with 4 decimal places.
To calculate the deferral, send a value greater than 0 and less than 100. Outside this range, the ICMS amounts of the group are set to zero.
beneficio_fiscal
string 8 Tax benefit code in the state (UF)
Use the same code adopted in the EFD and other tax filings, in the states that require it.
"impostos": {
    "codigo_cfop": "6.102",
    "situacao_tributaria": "900",
    "bc_icms": "100.00",
    "valor_icms": "18.00"
 }
Complementary tax: ICMS-ST
Parameter NF-e Type Size Description
codigo_cfop
string 4 CFOP (transaction code)
Send the CFOP code of the complementary ICMS transaction
situacao_tributaria
string 2-3 ICMS CST or CSOSN (tax status code)
2-digit CST or 3-digit CSOSN (tax status code for Simples Nacional companies), according to the regime of the complementary ICMS transaction
bc_icms_st
string 13v2 Tax base of the ICMS-ST complement
0.00
valor_icms_st
string 13v2 Amount of the ICMS-ST complement
0.00
valor_fcp_st
string 13v2 FCP amount of the ICMS-ST, with valor_icms_st and CST/CSOSN 10, 30, 70, 90, 201, 202, 203 or 900. In all other cases it is ignored.
0.00
aliquota_mva
string 3v2 Original added value margin percentage (MVA/IVA)
0.00
beneficio_fiscal
string 8 Tax benefit code in the state (UF)
Use the same code adopted in the EFD and other tax filings, in the states that require it.
"impostos": {
    "codigo_cfop": "6.102",
    "situacao_tributaria": "10",
    "bc_icms_st": "100.00",
    "valor_icms_st": "18.00",
    "aliquota_mva": "35.12"
 }
Complementary tax: IPI
Parameter NF-e Type Size Description
codigo_cfop
string 4 CFOP (transaction code)
Send the CFOP code of the transaction
bc_ipi
string 13v2 Tax base of the IPI complement. It must be greater than zero when valor_ipi is positive.
100.00
valor_ipi
string 13v2 Amount of the IPI complement
0.00
aliquota_ipi
string 3v4 Rate of the IPI complement, from 0 to 100, with up to 4 decimal places. Requires bc_ipi and valor_ipi.
When sent, it is used if it differs by at most 0.01 from the rate calculated from bc_ipi and valor_ipi. Above that, the calculated rate prevails.
"impostos": {
    "codigo_cfop": "6.102",
    "bc_ipi": "100.00",
    "valor_ipi": "18.00",
    "aliquota_ipi": "18.00"
 }
Complementary tax: ISSQN
Parameter NF-e Type Size Description
codigo_cfop
string 4 CFOP (transaction code)
Send the CFOP code of the complementary ISSQN transaction
exigibilidade
integer 1 ISS enforceability indicator
1 - Enforceable
2 - Not applicable
3 - Exemption
4 - Export
5 - Immunity
6 - Suspended by court decision
7 - Suspended by administrative proceeding
item_servico
string 5 Item of the service list that classifies the service in the ABRASF standard
00.00
incentivo_fiscal
string 1 Tax incentive indicator
1 - Yes
2 - No
bc_issqn
string 13v2 Tax base of the ISSQN complement. Send a numeric value greater than zero together with valor_issqn.
100.00
valor_issqn
string 13v2 Amount of the ISSQN complement. Send a numeric value greater than zero together with bc_issqn. The rate is calculated as amount/base x 100.
18.00
"impostos": {
    "codigo_cfop": "6.102",
    "exigibilidade": 1,
    "item_servico": "10.01",
    "incentivo_fiscal": 2,
    "bc_issqn": "100.00",
    "valor_issqn": "18.00"
 }

Invoice types > Complementary
Import addition document

In an inbound complementary NF-e (operacao: 0), the object documento_adicao passes the import data to the generated product when the array produtos is not sent. Send the data of the import declaration. The example below is a fragment of the JSON body.

Parameter NF-e / NFC-e Type Size Description
ndoc_importacao
string 15 Number of the import document
ddoc_importacao
string 10 Date of the import document
uf_desembaraco
string 2 State (UF) of customs clearance
local_desembaraco
string 1-60 Place of customs clearance
data_desembaraco
string 10 Date of customs clearance
via_transporte
string 1-2 Transport mode code, from 1 to 12. Send 1 for sea, not the name of the mode.
intermediacao
string 1 Intermediation code: 1 on its own account, 2 on behalf of a third party (conta e ordem), 3 to order (encomenda).
fabricante
string 1-60 Code of the foreign manufacturer, up to 60 characters. When left out in an addition, it uses 1.
adicao
string
integer
1-3 Addition number. The value is converted to an integer with up to three digits.
seq_adicao
string
integer
1-3 Sequential number of the item in the addition. Up to three digits are used. When left out in an addition, the default is 1.
afrmm
string 13v2 AFRMM amount (fee for the renewal of the merchant navy), formatted with two decimal places (required when the transport mode is sea).
"documento_adicao": {
    "ndoc_importacao": "1234567890",
    "ddoc_importacao": "2025-01-01",
    "uf_desembaraco": "SP",
    "local_desembaraco": "São Paulo",
    "data_desembaraco": "2025-01-01",
    "via_transporte": "1",
    "intermediacao": "1",
    "fabricante": "1234567890",
    "adicao": "1",
    "seq_adicao": "1",
    "afrmm": "100.00"
  }
 

Invoice types
Credit

During the transition to IBS/CBS (the new goods and services taxes of the tax reform), the NF-e is also used to register credit notes in specific cases of tax regularization. In practice, this purpose is used when a transaction must reduce amounts reported before, or register a credit linked to an NF-e already issued. Examples are returns because the recipient refused the goods or could not be found, and the other cases listed in the credit type.

To issue a credit note, send a POST request to the URL /1/nfe/emissao/.

Reuse the same blocks of a regular NF-e request, such as cliente, produtos and pedido. The changes to your system are in the fields below.

Parameter NF-e Type Size Description
finalidade
integer 1 Purpose of the invoice.
Send 5 for a credit note.
tipo_credito
integer 1 Credit note type
1 - Fines and interest
2 - Appropriation of presumed IBS credit on the balance due in the Manaus Free Trade Zone (ZFM) (art. 450, § 1º, LC 214/25); the API accepts this type only from 2029
3 - Return because the recipient refused the whole delivery or could not be found at the delivery attempt
4 - Reduction of amounts
5 - Credit transfer in a business succession
6 - Return because the recipient refused part of the delivery; accepted in production since August 3, 2026 and in the sandbox since July 1, 2026
The value is normalized to two digits, so 6 and "06" are the same. The technical note NT 2025.002-RTC calls this type 06.
nfe_referenciada
string
array
44 Access key of the document issued before. Required for types 01 to 05 and not allowed for type 06.
You can send more than one document in an array of strings. The model must be NF-e (55), except for type 03, which also accepts NFC-e (65).
With tipo_credito = 06, use dfe_referenciado per item.
The rule that the referenced access key must be from the same state (UF) as the company applies to credit types 03 and 04. For types 01, 02, 05 and 06, the access key can be from any state.

Short example of a credit note of type 06 (return because the recipient refused part of the delivery) through the endpoint /1/nfe/emissao/. It does not run until you fill in the objects shown with ellipses. The original invoice is referenced per item in dfe_referenciado (the field nfe_referenciada does not apply to type 06):

{
  "ambiente": 1,
  "operacao": 0,
  "natureza_operacao": "Retorno por recusa parcial na entrega",
  "modelo": "nfe",
  "finalidade": 5,
  "tipo_credito": 6,
  "cliente": { ... },
  "pedido": { ... },
  "produtos": [
    {
      "nome": "Produto 1",
      "codigo": "8",
      "ncm": "61091000",
      "quantidade": "2.00",
      "unidade": "UN",
      "origem": "0",
      "subtotal": "5.0000",
      "total": "10.00",
      "codigo_cfop": "1202",
      "dfe_referenciado": {
        "chave": "00000000000000000000000000000000000000000000",
        "item": 1
      },
      "impostos": { "ibs_cbs": { ... } }
    }
  ]
}

Taxes

In credit notes, send the block impostos.ibs_cbs of each item, according to the nature of the transaction. The tax groups of the current system (icms, ipi, pis, cofins, issqn and importacao) are accepted only in the types shown in the table below. This applies both to the explicit payload and to the groups taken from the Tax Class. When the group icms is sent in an allowed type, the API calculates and shows the actual ICMS (state sales tax) amounts from the tax status code (CST/CSOSN) and the rate sent. Sending impostos.icms.valor: "0.00" explicitly does not override this calculation.

API contract change: in the credit types outside the four exceptions of rule B25-80 of the technical note NT 2025.002-RTC v1.36, sending any group of the current tax system is invalid. It is no longer dropped silently. The rollout has two phases. During the announced advisory window, the request is recorded in internal monitoring and the group is not included in the XML. After the cutover, the request returns a JSON error in the field error that names the group sent. HTTP 200 does not confirm success. Being allowed means the group can be sent; it does not make ICMS, IPI, PIS, COFINS, ISSQN or import tax required.
Credit type Current-system groups accepted Behavior for the other groups
03 — Return because of total refusal or because the recipient could not be found icms, ipi, pis, cofins, issqn and importacao Groups not listed are not accepted. During the announced advisory window, the group is not included and the case is recorded in internal monitoring. After the cutover, the request returns a JSON error in the field error. HTTP 200 does not confirm success in this flow.
04 — Reduction of amounts icms, ipi, pis, cofins, issqn and importacao Groups not listed are not accepted. During the announced advisory window, the group is not included and the case is recorded in internal monitoring. After the cutover, the request returns a JSON error in the field error. HTTP 200 does not confirm success in this flow.
06 — Return because of partial refusal icms, ipi, pis, cofins, issqn and importacao Groups not listed are not accepted. During the announced advisory window, the group is not included and the case is recorded in internal monitoring. After the cutover, the request returns a JSON error in the field error. HTTP 200 does not confirm success in this flow.
01, 02 and 05 No group of the current tax system Sending icms, ipi, pis, cofins or issqn is recorded in internal monitoring during the announced advisory window (it is not dropped silently). After the cutover, it returns a JSON error in the field error. HTTP 200 does not confirm success.
Attention: even without ICMS, the CFOP (transaction code) is still required. For this purpose, send it in the field codigo_cfop at the root of the product. This differs from a regular invoice, where the CFOP is usually sent inside the object impostos.icms. If the field codigo_cfop is not sent and the product has no impostos block, the API uses the CFOP registered in the Tax Class (classe_imposto) for the scenario of the transaction. The root codigo_cfop takes priority over the Tax Class. It does not replace a CFOP already resolved in the tax groups or in an explicit CFOP override.

Example JSON of a credit note request:

{
    "ambiente": 1,
    "operacao": 0,
    "natureza_operacao": "Nota de crédito",
    "modelo": "nfe",
    "finalidade": 5,
    "tipo_credito": 5,
    "nfe_referenciada": [
        "00000000000000000000000000000000000000000000"
    ],
    "cliente": {
        "cnpj": "00.000.000/0000-00",
        "razao_social": "Empresa 1",
        "endereco": "Rua Teste",
        "numero": "32",
        "bairro": "Teste",
        "cidade": "Curitiba",
        "uf": "PR",
        "cep": "00000000"
    },
    "produtos": [
        {
            "nome": "Produto 1",
            "ncm": "61091000",
            "quantidade": "2.00",
            "unidade": "UN",
            "origem": "0",
            "subtotal": "5.0000",
            "total": "10.00",
            "cest": "28.038.00",
            "codigo_cfop": "2.102",
            "impostos": {
                "ibs_cbs": {
                    "situacao_tributaria": "000",
                    "classificacao_tributaria": "000001"
                }
            }
        }
    ],
    "pedido": {
        "presenca": "2",
        "modalidade_frete": "9",
        "frete": "5.00",
        "total": "500.00",
        "forma_pagamento": [
            99
        ],
        "desc_pagamento": [
            "Pagamento Digital"
        ],
        "pagamento": [
            0
        ],
        "tipo_integracao": [
            1
        ],
        "valor_pagamento": [
            "500.00"
        ]
    }
}

Invoice types
Debit

During the transition to IBS/CBS, the NF-e is also used to register debit notes in transactions that create or regularize debits of these taxes. This purpose applies, for example, to fines and interest, advance payment, inventory loss, invoices not processed in the tax calculation, and the other cases listed in the selected debit type.

To issue a debit note, send a POST request to the URL /1/nfe/emissao/.

As with the credit note, keep the usual NF-e blocks and change mainly the fields below.

Parameter NF-e Type Size Description
finalidade
integer 1 Purpose of the invoice.
Send 6 for a debit note.
tipo_debito
integer 1 Debit note type
1 - Transfer of credits to cooperatives
2 - Cancellation of credit for immune or exempt outbound transactions
3 - Debits of invoices not processed in the tax calculation
4 - Fines and interest
5 - Credit transfer in a business succession
6 - Advance payment
7 - Inventory loss (spoilage, loss, theft, robbery)
8 - Exit from the Simples Nacional regime (Desenquadramento do SN)

Referenced tax document

When tipo_debito is 3 or 4, send the object dfe_referenciado inside each item of the array produtos. This object links the debit to the outbound tax document (DF-e) that caused the tax regularization. It shows which earlier document is used as the reference.

Parameter NF-e Type Size Description
dfe_referenciado.chave
string 44 Access key of the referenced DF-e.
Required when tipo_debito is 3 or 4.
dfe_referenciado.item
integer 1-999 Item number in the referenced DF-e.
For tipo_debito 3, the field is ignored. For type 4, when sent, it is converted to an integer and must be between 1 and 999.

Example of an object inside the array produtos with dfe_referenciado filled in:

{
  "nome": "Produto 1",
  "codigo": "8",
  "ncm": "61091000",
  "quantidade": "2.00",
  "unidade": "UN",
  "origem": "0",
  "subtotal": "5.0000",
  "total": "10.00",
  "codigo_cfop": "6102",
  "dfe_referenciado": {
    "chave": "00000000000000000000000000000000000000000000",
    "item": 1
  },
  "impostos": {
    "ibs_cbs": {
      "situacao_tributaria": "000",
      "classificacao_tributaria": "000001"
    }
  }
}

Taxes

In debit notes, send the block impostos.ibs_cbs in each item, according to the transaction the credit or debit note represents. The group gEstornoCred is required for type 07: send the block estorno_credito with its IBS and CBS amounts. The tax groups of the current system (icms, ipi, pis, cofins and issqn) are accepted only in the types shown in the table below. This applies both to the explicit payload and to the groups taken from the Tax Class. When the group icms is sent in type 07, the API calculates and shows the actual ICMS amounts from the tax status code (CST/CSOSN) and the rate sent. Sending impostos.icms.valor: "0.00" explicitly does not override this calculation.

API contract change: only debit type 07 — inventory loss (spoilage, loss, theft, robbery) — and debit type 06, under the terms below, accept tax groups of the current system. In types 01, 02, 03, 04, 05 and 08, sending icms, ipi, pis, cofins, issqn or importacao is invalid and is no longer dropped silently. During the announced advisory window, the request is recorded in internal monitoring. After the cutover, it returns a JSON error in the field error. HTTP 200 does not confirm success in this flow. Being allowed does not make any group required. In debit type 06 — advance payment (tpNFDebito = 06) — in an NF-e model 55, Exceptions 2 and 3 of rule B25-80 (NT 2025.002-RTC v1.51) apply per tax group and depend on the issue date. The group ipi is accepted with no date limit (Exception 3). The groups pis and cofins are accepted only on invoices whose field data_emissao is in the year 2026 (Exception 2). This includes their tax substitution cases (PISST/COFINSST), which are sent inside these same groups. The groups icms, issqn and importacao (II, import tax) are still rejected, and ICMSUFDest and impostoDevol are not included in these documents. The exceptions take effect in the sandbox on September 1, 2026 and in production on October 5, 2026. For type 07, also send impostos.ibs_cbs.estorno_credito.valor_ibs and impostos.ibs_cbs.estorno_credito.valor_cbs.
Debit type Current-system groups accepted Behavior for the other groups
07 — Inventory loss (spoilage, loss, theft, robbery) icms, ipi, pis, cofins, issqn and importacao Groups not listed are not accepted. During the announced advisory window, the group is not included and the case is recorded in internal monitoring. After the cutover, the request returns a JSON error in the field error. HTTP 200 does not confirm success in this flow.
06 — Advance payment (tpNFDebito = 06) ipi in any year; pis and cofins (including the PISST/COFINSST cases, sent in these groups) only when data_emissao is in the year 2026 icms, issqn and importacao (II) are not accepted, and ICMSUFDest and impostoDevol are not included. During the announced advisory window, the group that was not included is recorded in internal monitoring. After the cutover, the request returns a JSON error in the field error. HTTP 200 does not confirm success in this flow. In effect: sandbox from September 1, 2026 and production from October 5, 2026 (NT 2025.002-RTC v1.51).
01, 02, 03, 04, 05 and 08 No group of the current tax system Sending icms, ipi, pis, cofins or issqn is recorded in internal monitoring during the announced advisory window (it is not dropped silently). After the cutover, it returns a JSON error in the field error. HTTP 200 does not confirm success.
Attention: even without ICMS, the CFOP (transaction code) is still required. For this purpose, send it in the field codigo_cfop at the root of the product. This differs from a regular invoice, where the CFOP is usually sent inside the object impostos.icms. If the field codigo_cfop is not sent and the product has no impostos block, the API uses the CFOP registered in the Tax Class (classe_imposto) for the scenario of the transaction. The root codigo_cfop takes priority over the Tax Class. It does not replace a CFOP already resolved in the tax groups or in an explicit CFOP override.

Example JSON of a debit note request:

{
    "ambiente": 1,
    "operacao": 1,
    "natureza_operacao": "Nota de débito",
    "modelo": "nfe",
    "finalidade": 6,
    "tipo_debito": 5,
    "cliente": {
        "cnpj": "00.000.000/0000-00",
        "razao_social": "Empresa",
        "endereco": "Rua Teste",
        "numero": "10",
        "bairro": "Teste",
        "cidade": "Curitiba",
        "uf": "PR",
        "cep": "00000000"
    },
    "produtos": [
        {
            "nome": "Produto 1",
            "ncm": "61091000",
            "quantidade": "2.00",
            "unidade": "UN",
            "origem": "0",
            "subtotal": "5.0000",
            "total": "10.00",
            "codigo": "8",
            "cest": "28.038.00",
            "codigo_cfop": "6102",
            "impostos": {
                "ibs_cbs": {
                    "situacao_tributaria": "800",
                    "classificacao_tributaria": "800001",
                    "transferencia_credito": {
                        "valor_ibs": "1.00",
                        "valor_cbs": "1.00"
                    }
                }
            }
        }
    ],
    "pedido": {
        "presenca": "2",
        "modalidade_frete": "0",
        "frete": "5.00",
        "total": "500.00",
        "forma_pagamento": [
            99
        ],
        "desc_pagamento": [
            "Pagamento Digital"
        ],
        "pagamento": [
            0
        ],
        "tipo_integracao": [
            1
        ],
        "valor_pagamento": [
            "500.00"
        ]
    }
}

Events
Correction letter (CC-e)

The electronic correction letter (Carta de Correção Eletrônica, CC-e) is a legal event that corrects some data of an NF-e (electronic invoice for goods) that was already issued. Not every field can be corrected: see below what is not allowed.

To issue a correction letter, send a POST request to the URL /1/nfe/cartacorrecao/.

In the JSON body, send chave, correcao and, when it cannot be taken from the invoice, ambiente. For invoices not issued through Webmania, also send evento.

What can NOT be corrected with a correction letter?
- Amounts such as the tax base, the rate, a price difference and the quantity.
- Registration data that would change the sender or the recipient.
- The issue date or the shipping date.
- The series and the number of the invoice.
Your change does not fit a correction letter?
Issue a return invoice to cancel the tax effects of the NF-e issued before. Then issue a new invoice as usual.
Parameter NF-e Type Size Description
chave | uuid
string 44 | 36 Access key or UUID of the NF-e
correcao
string 15-1000 Corrections to apply
Between 15 and 1000 characters
ambiente
integer 1 SEFAZ environment (SEFAZ is the state tax authority). Required if the invoice was not issued through Webmania. For an invoice found in Webmania, it can be taken from the saved data.
1 - Production
2 - Sandbox
evento
integer 1-2 Event number, from 1 to 20. Required if the invoice was not issued through Webmania. For an invoice found in Webmania, when you leave it out, the API uses the last registered event plus 1.
url_notificacao
string --- Notification URL for all status updates of the correction letter

Example of a correction letter request:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "chave":"00000000000000000000000000000000000000000000",
  "correcao":"O CFOP correto é 5.102 referente a revenda tributada no mesmo estado."
}' \
https://webmania.com.br/api/1/nfe/cartacorrecao/

Example of an HTTP 200 response, with comments. The response is a JSON object with uuid, status, evento, modelo and log (the response structure or an empty string). It also has xml and dacce, only when the status is aprovado. Validation failures return error. The same content is also sent as a notification:

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identification number
  "status": "aprovado", // aprovado or reprovado
  "evento": "1", // Event number
  "modelo": "cce", // Event type
  "xml": "http://nfe.seudominio.com.br/xmlcce/[uuid]/", // XML
  "dacce": "http://nfe.seudominio.com.br/dacce/[uuid]/", // DANFE (printed summary)
  "log": "{...}" // SEFAZ response log
}

Events
Recipient acknowledgment

The recipient acknowledgment (Manifestação do Destinatário) is a set of events. With them, the recipient of an NF-e states its position on the transaction described in the invoice. This lets the recipient confirm and keep track of the information given by the supplier that issued the invoice.

To register a recipient acknowledgment, send a POST request to the URL /1/nfe/manifesta/.

In the JSON body, send chave, ambiente, evento and justificativa.

Parameter NF-e Type Size Description
chave
string 44 Access key of the invoice on which the recipient states its position on the transaction
ambiente
integer 1 SEFAZ environment
1 - Production
2 - Sandbox
evento
string 6 Numeric event code, accepted as a string or a number. It states the recipient's position on the transaction in the invoice.
210200 – Confirmação da Operação (transaction confirmed)
210210 – Ciência da Operação (aware of the transaction)
210220 – Desconhecimento da Operação (transaction not recognized)
210240 – Operação não Realizada (transaction did not take place)
justificativa
string 15-255 Required for event 210240 - Operação não Realizada (transaction did not take place). For the other events, any text must also have 15 to 255 bytes after special characters are removed.

Example of a recipient acknowledgment request:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "evento": "210200",
  "justificativa": ""
}' \
https://webmania.com.br/api/1/nfe/manifesta/

Example of an HTTP 200 response, with comments. The response has uuid, status, evento, modelo and log (the response structure or an empty string). xml appears only with the status aprovado. Validation failures return error:

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identification number
  "status": "aprovado", // aprovado or reprovado
  "evento": "210200", // Recipient acknowledgment (MDe) event
  "modelo": "mde",
  "xml": "http://nfe.seudominio.com.br/xmlmde/[uuid]/",
  "log": "{...}",
}

Events
IBS/CBS events

IBS/CBS events register tax reform information linked to an NF-e or NFC-e that was already issued. (IBS and CBS are the new goods and services taxes of the tax reform.) Each event has a six-digit code, sent in cod_evento.

To register an IBS/CBS event, send a POST request to the URL /1/nfe/evento-ibs-cbs/.

In the JSON body, send chave, ambiente, cod_evento and, optionally, evento.

The fields specific to each event are listed in their sections below. In the response of a processed event, cod_evento is the six-digit code as text, and evento is the sequence as an integer. modelo is nfe or nfce. Validation failures return error, which can be a text or a list of messages. The HTTP status alone does not confirm the tax registration.

Parameter NF-e Type Size Description
chave
string 44 Access key of the NF-e/NFC-e that will be linked to the event
ambiente
integer 1 SEFAZ environment (SEFAZ is the state tax authority)
1 - Production
2 - Sandbox
cod_evento
string 6 IBS/CBS event code
See the table below for the code, description and author type of each available event.
evento
integer 1-20 Event sequence number, from 1 to 20. When left out, the API uses the next sequence of the history found for the event code, access key, model and environment. With no history, it starts at 1.
url_notificacao
string --- Notification URL for status updates of the event
IBS/CBS events
Code Description Author type
110300 Payment link (Vinculação Pagamento) Issuer
112110 Report of full actual payment to release the presumed credit of the buyer Issuer
112120 Import into ALC/ZFM (Free Trade Areas / Manaus Free Trade Zone) not converted into exemption Issuer
112130 Spoilage, loss, robbery or theft during transport hired by the supplier Issuer
112140 Supply not made after advance payment Issuer
112150 Update of the expected delivery date Issuer
211110 Request to appropriate presumed credit Recipient
211124 Spoilage, loss, robbery or theft during transport hired by the buyer Recipient
211128 Acceptance of a debit in the tax calculation because of a credit note Recipient
211130 Item added to fixed assets Recipient
211140 Request to appropriate fuel credit Recipient
211150 Request to appropriate credit for goods and services that depend on the buyer's activity Recipient

Event 110300 - Payment link (Vinculação Pagamento)

Lets the issuer link a payment transaction to an NF-e/NFC-e already authorized. Send a POST request to /1/nfe/evento-ibs-cbs/, with cod_evento equal to 110300. The event is available in the sandbox from October 5, 2026 and in production from December 14, 2026.

One transaction per event: send a single pagamento object, never a list. For other transactions, send new events, within the limit of 20 events 110300 per access key. Canceled 110300 events also use numbers of the event sequence and count toward this limit. This limit is separate from the up to 99 transactions allowed when the invoice is issued. The next sequence number is calculated from the history of 110300 events already registered. It counts events that are approved, in contingency mode, approved in EPEC, canceled and in processing; rejected events are not counted. 110300 events sent at the same time for the same NF-e can get the same sequence number and be rejected by SEFAZ as a duplicate sequence. In that case, resend the rejected event only after the result of the accepted request is registered in the history. The event does not receive n_pag and does not change the payment data of the invoice. To link payments when you issue the invoice, use pedido.pagamentos_vinculados.

The API fills in the authorization protocolo of the invoice automatically from the access key sent. You do not need to send it. If you send it, it must match the protocol of the authorized invoice. The environment of the event must be the same as the invoice's, and the invoice must belong to the authenticated issuer.

Fields specific to event 110300
Parameter Type Size Description
pagamento object 1 Required. A single payment transaction.
pagamento.id_transacao string 2-35 Required. Transaction ID with 2 to 35 characters. Same text and exact preservation rules described in linked payments.
pagamento.tp_meio_pagamento string or integer 2 Required. Only 15, 17, 18, 20, 23 or 24.
pagamento.cnpj_recebedor string 14 Required. Valid CNPJ (company ID) of the payment receiver, which can differ from the issuer.
pagamento.cnpj_base_psp string 8 Required. Base CNPJ of the PSP (payment service provider). Same rules described in linked payments.
protocolo string 15 or 17 Optional. Authorization protocol of the invoice; filled in automatically when not sent. If sent, it must match the protocol of the authorized invoice.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 2,
  "cod_evento": "110300",
  "pagamento": {
    "id_transacao": "TRANSACAO-0001",
    "tp_meio_pagamento": "17",
    "cnpj_recebedor": "11222333000181",
    "cnpj_base_psp": "12345678"
  }
}

The access key above is only an example. Replace it with the access key of an invoice authorized in the same environment. The protocol and the event sequence are resolved automatically.

To cancel an authorized payment link, send PUT to /1/nfe/evento-ibs-cbs/cancelar/ with the uuid returned for the 110300 event, not the UUID of the invoice. See the other parameters in IBS/CBS event cancellation.

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c",
  "ambiente": 2
}
Cancellation availability at SEFAZ: the cancellation uses event 110001. SEFAZ may reject the cancellation of a 110300 event until the official event schema is updated to accept 110300 as an authorized reference event.

Event 112110 - Report of full actual payment to release the presumed credit of the buyer

Description: lets the issuer report that the transaction was paid in full, to release the presumed credit of the buyer (NT 2025.002, item 8.3).

Event 112110 has no specific fields.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "112110",
  "evento": 1,
  "url_notificacao": "https://seudominio.com/webhook"
}

The response is a JSON object with the fields uuid, status, evento, modelo and log.

Event 112120 - Import into ALC/ZFM not converted into exemption

Description: for items of an import NF-e, reports when the taxation in the ALC/ZFM (Free Trade Areas / Manaus Free Trade Zone) was not converted into exemption as the law provides (NT 2025.002, item 8.15). Send itens as a list with at least one object. Every field below is required in each item, including the object controle_estoque.

Fields specific to event 112120
Parameter Type Size Description
item integer 1-3 Item number of the referenced import NF-e.
valor_ibs decimal 13v2 IBS amount for the quantity not converted into exemption.
valor_cbs decimal 13v2 CBS amount for the quantity not converted into exemption.
controle_estoque.quantidade decimal 11v0-4 Quantity that does not meet the requirements for conversion into exemption.
controle_estoque.unidade string 1-6 Unit of measure of the quantity sent.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "112120",
  "evento": 1,
  "itens": [
    {
      "item": 1,
      "valor_ibs": "12.50",
      "valor_cbs": "8.40",
      "controle_estoque": {
        "quantidade": "10.0000",
        "unidade": "UN"
      }
    }
  ]
}

The response is a JSON object with the fields uuid, status, evento, modelo and log.

Event 112130 - Spoilage, loss, robbery or theft during transport hired by the supplier

Description: lets the supplier report spoilage, loss, robbery or theft before delivery, during transport hired by the supplier (CIF freight), including the reversal of IBS/CBS credit (NT 2025.002, item 8.17). Send itens as a list with at least one object. Every field below is required in each item, including the object controle_estoque and both reversal amounts.

Fields specific to event 112130
Parameter Type Size Description
item integer 1-3 Item number of the supply invoice.
valor_ibs decimal 13v2 IBS amount for the spoiled/lost/stolen/robbed quantity.
valor_cbs decimal 13v2 CBS amount for the spoiled/lost/stolen/robbed quantity.
controle_estoque.quantidade_perecimento decimal 11v0-4 Quantity that was spoiled, lost, robbed or stolen.
controle_estoque.unidade_perecimento string 1-6 Unit of measure of the spoiled/lost quantity.
controle_estoque.valor_ibs_estorno decimal 13v2 IBS credit amount to reverse.
controle_estoque.valor_cbs_estorno decimal 13v2 CBS credit amount to reverse.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "112130",
  "evento": 1,
  "itens": [
    {
      "item": 1,
      "valor_ibs": "15.00",
      "valor_cbs": "7.00",
      "controle_estoque": {
        "quantidade_perecimento": "2.0000",
        "unidade_perecimento": "UN",
        "valor_ibs_estorno": "5.00",
        "valor_cbs_estorno": "2.50"
      }
    }
  ]
}

The response is a JSON object with the fields uuid, status, evento, modelo and log.

Event 112140 - Supply not made after advance payment

Description: lets the supplier report that there was an advance payment, but the matching supply was not made (NT 2025.002, item 8.18). Send itens as a list with at least one object. Every field below is required in each item, including the object controle_estoque.

Fields specific to event 112140
Parameter Type Size Description
item integer 1-3 Item number of the advance payment debit note.
valor_ibs decimal 13v2 IBS amount for the quantity not supplied.
valor_cbs decimal 13v2 CBS amount for the quantity not supplied.
controle_estoque.quantidade_nao_fornecida decimal 11v0-4 Quantity not supplied, with tax paid in advance.
controle_estoque.unidade_nao_fornecida string 1-6 Unit of the quantity not supplied.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "112140",
  "evento": 1,
  "itens": [
    {
      "item": 1,
      "valor_ibs": "9.00",
      "valor_cbs": "4.00",
      "controle_estoque": {
        "quantidade_nao_fornecida": "3.0000",
        "unidade_nao_fornecida": "UN"
      }
    }
  ]
}

The response is a JSON object with the fields uuid, status, evento, modelo and log.

Event 112150 - Update of the expected delivery date

Description: lets the supplier update the expected date of delivery or availability of the goods, which adjusts the matching tax period (NT 2025.002, item 8.19).

Fields specific to event 112150
Parameter Type Size Description
data_previsao_entrega date 10 Required. New expected delivery date in the format YYYY-MM-DD.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "112150",
  "evento": 1,
  "data_previsao_entrega": "2026-03-15"
}

The response is a JSON object with the fields uuid, status, evento, modelo and log.

Event 211110 - Request to appropriate presumed credit

Description: event created by the recipient for purchase invoices from third parties that give the right to appropriate presumed credit (NT 2025.002 v1.40, item 8.4). Send itens as a list with at least one object. The API requires every field below in each item, including the object credito_presumido and the rates and amounts of both taxes.

Fields specific to event 211110
Parameter Type Size Description
item integer 1-3 Item number of the referenced NF-e.
base_calculo decimal 13v2 Tax base of the item for the presumed credit.
credito_presumido.classificacao string 2 Classification code of the presumed credit.
credito_presumido.aliquota_ibs decimal 3v2-4 Presumed credit percentage of IBS.
credito_presumido.aliquota_cbs decimal 3v2-4 Presumed credit percentage of CBS.
credito_presumido.valor_ibs decimal 13v2 Presumed credit amount of IBS.
credito_presumido.valor_cbs decimal 13v2 Presumed credit amount of CBS.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "211110",
  "evento": 1,
  "itens": [
    {
      "item": 1,
      "base_calculo": "1000.00",
      "credito_presumido": {
        "classificacao": "01",
        "aliquota_ibs": "5.0000",
        "aliquota_cbs": "4.0000",
        "valor_ibs": "50.00",
        "valor_cbs": "40.00"
      }
    }
  ]
}

The response is a JSON object with the fields uuid, status, evento, modelo and log.

Event 211124 - Spoilage, loss, robbery or theft during transport hired by the buyer

Description: lets the buyer report spoilage, loss, robbery or theft in transit in transactions with FOB freight (freight paid by the buyer) (NT 2025.002, item 8.16). Send itens as a list with at least one object. Every field below is required in each item, including the object controle_estoque.

Fields specific to event 211124
Parameter Type Size Description
item integer 1-3 Item number of the purchase NF-e.
valor_ibs decimal 13v2 IBS amount for the spoiled/lost/stolen/robbed quantity.
valor_cbs decimal 13v2 CBS amount for the spoiled/lost/stolen/robbed quantity.
controle_estoque.quantidade_perecimento decimal 11v0-4 Quantity that was spoiled, lost, robbed or stolen.
controle_estoque.unidade_perecimento string 1-6 Unit of the spoiled/lost quantity.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "211124",
  "evento": 1,
  "itens": [
    {
      "item": 1,
      "valor_ibs": "6.00",
      "valor_cbs": "3.20",
      "controle_estoque": {
        "quantidade_perecimento": "1.0000",
        "unidade_perecimento": "UN"
      }
    }
  ]
}

The response is a JSON object with the fields uuid, status, evento, modelo and log.

Event 211128 - Acceptance of a debit in the tax calculation because of a credit note

Description: lets the recipient state whether it agrees with the IBS/CBS debit posted by a credit note in the assisted tax calculation (NT 2025.002, item 8.6).

Fields specific to event 211128
Parameter Type Size Description
indicador_aceitacao string 1 Required. Agreement indicator: "1" accepts the debit, "0" does not accept it. Send the value as text.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "211128",
  "evento": 1,
  "indicador_aceitacao": "1"
}

The response is a JSON object with the fields uuid, status, evento, modelo and log.

Event 211130 - Item added to fixed assets

Description: buyer event to report that an item was added to fixed assets, so that it gets the matching tax treatment (NT 2025.002, item 8.7).

Fields specific to event 211130: send itens as a non-empty list. Each item must have every field below, including the object controle_estoque with quantity and unit.
Parameter Type Size Description
item integer 1-3 Item number of the referenced NF-e.
valor_ibs decimal 13v2 IBS amount related to the fixed asset.
valor_cbs decimal 13v2 CBS amount related to the fixed asset.
controle_estoque.quantidade_imobilizada decimal 11v0-4 Quantity of the item added to fixed assets.
controle_estoque.unidade_imobilizada string 1-6 Unit of the quantity added to fixed assets.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "211130",
  "evento": 1,
  "itens": [
    {
      "item": 1,
      "valor_ibs": "18.00",
      "valor_cbs": "9.00",
      "controle_estoque": {
        "quantidade_imobilizada": "2.0000",
        "unidade_imobilizada": "UN"
      }
    }
  ]
}

The response has uuid, status, cod_evento, evento (integer), modelo and log. It has xml only with the status aprovado and an available XML, and motivo when there is a rejection reason. Validation failures return error (text or list). Do not assume authorization from HTTP 200 alone.

Event 211140 - Request to appropriate fuel credit

Description: event of a fuel buyer in the production chain to request the appropriation of credit for the share used in its activity (NT 2025.002, item 8.8).

Fields specific to event 211140: send itens as a non-empty list. Each item must have every field below, including the object controle_estoque with quantity and unit.
Parameter Type Size Description
item integer 1-3 Item number of the referenced NF-e.
valor_ibs decimal 13v2 IBS amount related to the fuel used.
valor_cbs decimal 13v2 CBS amount related to the fuel used.
controle_estoque.quantidade_combustivel decimal 11v0-4 Quantity of fuel used.
controle_estoque.unidade_combustivel string 1-6 Unit of the quantity used.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "211140",
  "evento": 1,
  "itens": [
    {
      "item": 1,
      "valor_ibs": "25.00",
      "valor_cbs": "11.00",
      "controle_estoque": {
        "quantidade_combustivel": "50.0000",
        "unidade_combustivel": "L"
      }
    }
  ]
}

The response has uuid, status, cod_evento, evento (integer), modelo and log. It has xml only with the status aprovado and an available XML, and motivo when there is a rejection reason. Validation failures return error (text or list). Do not assume authorization from HTTP 200 alone.

Event 211150 - Request to appropriate credit for goods and services that depend on the buyer's activity

Description: buyer event to request the appropriation of credit for goods and services whose credit depends on the activity carried out (NT 2025.002, item 8.9).

Fields specific to event 211150: send itens as a non-empty list. Each item must have every field below.
Parameter Type Size Description
item integer 1-3 Item number of the referenced NF-e.
valor_credito_ibs decimal 13v2 IBS credit amount requested for the item.
valor_credito_cbs decimal 13v2 CBS credit amount requested for the item.

Example JSON request:

{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1,
  "cod_evento": "211150",
  "evento": 1,
  "itens": [
    {
      "item": 1,
      "valor_credito_ibs": "7.50",
      "valor_credito_cbs": "4.10"
    }
  ]
}

The response has uuid, status, cod_evento, evento (integer), modelo and log. It has xml only with the status aprovado and an available XML, and motivo when there is a rejection reason. Validation failures return error (text or list). Do not assume authorization from HTTP 200 alone.

Cancellation of an IBS/CBS event by UUID

To cancel an authorized IBS/CBS event, send a PUT request to the URL /1/nfe/evento-ibs-cbs/cancelar/.

In the JSON body, send the uuid of the event.

Parameter NF-e Type Size Description
uuid
string 36 UUID of the authorized IBS/CBS event to cancel
ambiente
integer 1 SEFAZ environment (1 - Production / 2 - Sandbox). When sent, it must be the same as the environment of the original event.
url_notificacao
string --- Notification URL for the result of the cancellation event

Example JSON request (cancellation):

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c",
  "ambiente": 1,
  "url_notificacao": "https://seudominio.com/webhook-cancelamento"
}

Example cURL call:

curl -X PUT \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c"
}' \
https://webmania.com.br/api/1/nfe/evento-ibs-cbs/cancelar/

Example JSON response:

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c",
  "status": "cancelado",
  "cod_evento": "110001",
  "evento": 1,
  "modelo": "nfe",
  "xml_cancelamento": "http://nfe.seudominio.com.br/xmlevento/43eace5c-8008-4f6c-b830-b6d52d7ff90c/cancelamento",
  "log": "{...}"
}

When SEFAZ approves it, the cancellation does not create a new document. The IBS/CBS event keeps its uuid and changes to cancelado. The original XML stays available at /xmlevento/[uuid]/. xml_cancelamento (/xmlevento/[uuid]/cancelamento) is returned only if the cancellation is approved and its XML is available. What these URLs return depends on who accesses them: the authenticated owner gets the XML. An anonymous access gets an encrypted ZIP file when the document has a password; otherwise, access is denied. The response has uuid, status, cod_evento, evento (original sequence, integer), modelo and log. It may include the rejection motivo. Validation failures return error (text or list), without confirming the cancellation.

Events
Financial reconciliation (ECONF)

The financial reconciliation event (Conciliação Financeira, ECONF) registers the payment information related to an NF-e (model 55) or an NFC-e (model 65).

To issue the financial reconciliation, send a POST request to the URL /1/nfe/conciliacao/.

In the JSON body, send chave (or uuid) and pagamento. When the invoice was not issued by the Webmania system, the parameter ambiente becomes required.

Parameter NF-e / NFC-e Type Size Description
chave
string 44 Access key of the related NF-e/NFC-e
uuid
string 36 UUID of the related NF-e/NFC-e
pagamento
object 1 Required when pagamentos is not sent. Object with a single payment; send only one of the two parameters.
pagamentos
array 1-100 Required when pagamento is not sent. List of 1 to 100 payment objects; do not send both parameters together.
ambiente
integer 1 SEFAZ environment (SEFAZ is the state tax authority)
1 - Production
2 - Sandbox

Required when the invoice was not issued by WebmaniaBR.
evento
integer 1-2 Sequential event number, from 1 to 99. When left out for an invoice found in Webmania, the API uses the previous sequence plus 1; otherwise, it starts at 1.
url_notificacao
string --- Notification URL for status updates of the financial reconciliation
Payment details
Parameter NF-e / NFC-e Type Size Description
indicador_pagamento
integer 1 Payment indicator
0 or 1
forma_pagamento
string 2 Payment method code (tPag). Values accepted in this transaction: 01, 02, 03, 04, 05, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 90, 91, 99. The labels are listed in the order payment section.
desc_pagamento
string 2-60 Description of the payment method
valor_pagamento
string 13v2 Payment amount, for example 150.00. Required, except with forma_pagamento = "90" or "91": then, when missing or empty, it is 0.00.
data_pagamento
string 10 Payment date
YYYY-MM-DD
cnpj_transacional_pag
string 14 Transaction CNPJ (company ID) of the payment
Required with uf_pagamento
uf_pagamento
string 2 State (UF) of the payment
Required with cnpj_transacional_pag
cnpj_instituicao_financeira
string 14 CNPJ of the financial institution (CNPJIF). It is included in the event only when cnpj_transacional_pag and uf_pagamento are also filled in.
bandeira
string 2 Card brand code (tBand): 01 to 27 or 99. It is included in the event only when cnpj_transacional_pag and uf_pagamento are also filled in.
autorizacao
string 1-128 Authorization code of the transaction (cAut). It is included in the event only when cnpj_transacional_pag and uf_pagamento are also filled in.
cnpj_beneficiario
string 14 CNPJ of the payment beneficiary
Required with uf_beneficiario
uf_beneficiario
string 2 State (UF) of the beneficiary
Required with cnpj_beneficiario

Example of a financial reconciliation request:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "chave": "00000000000000000000000000000000000000000000",
  "ambiente": 1, // 1 - Production or 2 - Sandbox
  "pagamento": {
    "indicador_pagamento": 0,
    "forma_pagamento": "03",
    "desc_pagamento": "Cartão de crédito",
    "valor_pagamento": "150.00",
    "data_pagamento": "2026-01-06",
    "cnpj_transacional_pag": "12345678000195",
    "uf_pagamento": "PR",
    "cnpj_instituicao_financeira": "12345678000195",
    "bandeira": "01",
    "autorizacao": "ABC123456",
    "cnpj_beneficiario": "98765432000144",
    "uf_beneficiario": "PR"
  }
}' \
https://webmania.com.br/api/1/nfe/conciliacao/

Example of an HTTP 200 response. The response has uuid, status, evento and modelo. protocolo_evento (15 or 17 digits) and log are left out when not available. The field xml is returned only when the status is aprovado. Validation failures return error. HTTP 200 does not confirm approval.

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identification number
  "status": "aprovado", // aprovado, reprovado, processamento or cancelado
  "evento": "1", // Event number
  "modelo": "econf", // Invoice model
  "protocolo_evento": "342260000119838", // nProt (protocol number) of the event at SEFAZ
  "xml": "http://nfe.seudominio.com.br/xmleconf/[uuid]/", // XML of the event
  "log": "{...}" // SEFAZ response log
}

Cancellation of the financial reconciliation (ECONF)

To cancel the financial reconciliation, send a PUT request to the URL /1/nfe/conciliacao/cancelar/.

In the JSON body, send only the uuid of the reconciliation. The access key, the environment, the event and the protocolo_evento (nProt) are taken from it.

Parameter NF-e / NFC-e Type Size Description
uuid
string 36 UUID of the financial reconciliation
url_notificacao
string --- Notification URL for status updates of the cancellation

Example of a financial reconciliation cancellation:

curl -X PUT \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c"
}' \
https://webmania.com.br/api/1/nfe/conciliacao/cancelar/

Example of an HTTP 200 response. The response has uuid, status, evento (integer) and modelo. protocolo_evento and log are left out when not available. cancelado means the cancellation is confirmed. Validation failures return error:

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c",
  "status": "cancelado",
  "evento": 1,
  "modelo": "econf",
  "protocolo_evento": "342260000119838",
  "log": "{...}"
}

Functions
Download the XML and PDF

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

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

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

Ways to access the files:

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

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

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

Functions > Download the XML and PDF
Access credentials

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

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

curl -X GET \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
https://nfe.webmania.com.br/danfe/00000000000000000000000000000000000000000000/

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

Functions > Download the XML and PDF
Token

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

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

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

https://nfe.webmania.com.br/danfe/00000000000000000000000000000000000000000000/?token=[TOKEN]

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

Functions
SEFAZ status

This call returns the last known status of SEFAZ in the company's state. It returns the NFC-e status when the company has NFC-e configured, and the NF-e status in all other cases. The result uses the stored production status; the call does not check SEFAZ in real time.

To check the SEFAZ status, send a GET request to the URL /1/nfe/sefaz/.

  curl -X GET \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
https://webmania.com.br/api/1/nfe/sefaz/

Example of an HTTP 200 response. The field status returns online or offline:

{
  "status": "online"
}

Functions
A1 certificate expiry

This call returns how many days are left before the company's A1 digital certificate expires.

To check the expiry of the A1 certificate, send a GET request to the URL /1/nfe/certificado/.

  curl -X GET \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
https://webmania.com.br/api/1/nfe/certificado/

Example of an HTTP 200 response with 25 days left. The response contains expiration with the days left when this value is not zero. If the certificate is not found or the value is zero, it returns error. Access or configuration failures can also return an error:

{
  "expiration": 25
}

Functions
Look up an invoice

This call returns the current status of an invoice, also while it is in processamento or contingencia. Use the notifications for day-to-day tracking. Use this call to check a single invoice when you need to.

To look up an invoice, send a GET request to the URL /1/nfe/consulta/.

Send the uuid, chave or ID of the invoice in the JSON body or in the query string. Send at least one identifier. chave takes priority over uuid, and both take priority over ID.

Parameter Type Size Returns Description
chave string 44 object Access key
uuid string 36 object UUID
ID string 1-15 array Purchase order number or processing ID

Example of an invoice lookup:

curl -X GET \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "uuid":"43eace5c-8008-4f6c-b830-b6d52d7ff90c"
}' \
https://webmania.com.br/api/1/nfe/consulta/

Example of an HTTP 200 response for an authorized NF-e. A lookup by chave or uuid returns an object; a lookup by ID returns a list. The JSON keys in the response depend on the document and its status; empty fields may be omitted. recibo appears only when a receipt is available and the status is aprovado; danfe_simples and danfe_etiqueta exist only for NF-e. On failure, check error; HTTP 200 alone does not confirm that the lookup found a document or that the document was authorized. log contains the response available from SEFAZ, and may be omitted when empty:

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identifier
  "status": "aprovado", // aprovado, reprovado, cancelado, denegado, processamento or contingencia,
  "motivo": "Autorizado o uso da NF-e", // Reason for the status (here: use of the NF-e authorized)
  "nfe": "25000", // NF-e number
  "serie": "1", // Series number
  "recibo": "000000000000000", // Receipt number
  "chave": "00000000000000000000000000000000000000000000", // Access key number
  "modelo": "nfe", // Invoice model: nfe or nfce; events have their own response
  "epec": false, // Issued through EPEC
  "xml": "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/",
  "danfe": "http://nfe.seudominio.com.br/danfe/[chave|uuid]/",
  "danfe_simples": "http://nfe.seudominio.com.br/danfe/simples/[chave|uuid]/", // Simplified DANFE
  "danfe_etiqueta": "http://nfe.seudominio.com.br/danfe/etiqueta/[chave|uuid]/", // Simplified DANFE - Label
  "log": "{...}" // SEFAZ response log
}

Functions
Cancel an invoice

A cancellation registers at SEFAZ the event that voids an authorized invoice, as long as the goods have not left yet and the deadline has not passed. After that, the invoice status changes to cancelado.

To cancel an invoice, send a PUT request to the URL /1/nfe/cancelar/.

The API sets the type of cancellation automatically:

If you send nfce_referenciada, the cancellation is processed as a replacement (only for NFC-e). Otherwise, the API makes a standard cancellation.

Attention: You can cancel only an NF-e that the tax authority has already authorized, and only before the taxable event, that is, before the goods leave the business premises. Currently, the maximum deadline to cancel an NF-e is 24 hours (1 day), counted from the authorization. If the 24-hour deadline has passed or the goods are already in transit, issue a return NF-e to void the earlier NF-e.
Parameter NF-e/NFC-e Type Size Description
chave | uuid
string 44 | 36 Access key or UUID of the NF-e
motivo
string 15-255 Recommended. Reason for the cancellation, 15 to 255 characters. When it is missing, the API uses Cancelamento por problemas administrativos. (cancellation due to administrative problems).
nfce_referenciada
string 44 Access key of the replacement NFC-e
When sent, it turns on cancellation by replacement automatically (NFC-e only). The key must have model 65 and tpEmis=9, belong to the same issuer and be different from the canceled key.

Example of an invoice cancellation:

curl -X PUT \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
   "chave":"00000000000000000000000000000000000000000000",
   "motivo":"Cancelamento por motivos administrativos."
}' \
https://webmania.com.br/api/1/nfe/cancelar/

Example of a cancellation by replacement for NFC-e:

curl -X PUT \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
   "chave":"00000000000000000000000000000000000000000000",
   "motivo":"Cancelamento por substituição de NFC-e.",
   "nfce_referenciada":"11111111111111111111111111111111111111111111"
}' \
https://webmania.com.br/api/1/nfe/cancelar/

Example of an HTTP 200 response for a confirmed cancellation. When the cancellation is confirmed, the response contains status equal to cancelado, xml with the URL of the NF-e XML and xml_cancelamento with the URL of the event. log and motivo are omitted when empty; xml_cancelamento may be empty if the cancellation is not confirmed. Validation failures return error; check the body, not only the HTTP 200. A confirmed cancellation also triggers the notification cancelado:

{
  "status": "cancelado",
  "xml": "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/",
  "xml_cancelamento": "http://nfe.seudominio.com.br/xmlnfe/[chave|uuid]/cancelamento",
  "log": "{...}" // SEFAZ response log
}

If SEFAZ is unstable and does not confirm the cancellation, the HTTP 200 response has status equal to processando_cancelamento, without error. Do not resend the cancellation: Webmania confirms the result automatically and sends the notification cancelado, or aprovado if SEFAZ did not register the event. For all other failures, the response still contains error.

Functions
Void invoice numbers

Number voiding tells SEFAZ that a range of NF-e numbers will not be used, when there is a gap in the number sequence.

To void a range of invoice numbers, send a PUT request to the URL /1/nfe/inutilizar/.

Attention: Number voiding lets the issuer tell SEFAZ, by the tenth day of the following month, which NF-e numbers will not be used because there was a gap in the NF-e number sequence. You can void a number only if no NF-e has used it yet (authorized, canceled or denied). Example: NF-e no. 100 and no. 110 were issued, but the range 101 to 109 was not used, for technical reasons, before no. 110 was issued.
Parameter NF-e Type Size Description
sequencia
string variable A single number or a range of numbers: 101 or 101-109. For a single number, the API uses the same start and end. The start must be at least 1 and the end cannot exceed 1,000,000,000.
motivo
string 15-255 Reason for the number voiding
ambiente
integer 1 SEFAZ environment
1 - Production
2 - Sandbox (homologação)
serie
string 1-3 Series of the numbers
modelo
string 1 Invoice model of the numbers
1 - NF-e
2 - NFC-e

Example of number voiding:

curl -X PUT \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "sequencia":"101-109",
  "motivo":"Inutilização por problemas técnicos.",
  "ambiente":"1", // 1 - Production or 2 - Sandbox (homologação)
  "serie":"99", // Series of the numbers
  "modelo":"1" // 1 - NF-e or 2 - NFC-e
}' \
https://webmania.com.br/api/1/nfe/inutilizar/

Example of an HTTP 200 response. The field xml returns the XML protocol of the number voiding:

{
  "xml": "http://nfe.seudominio.com.br/xmlnfe/04abc819-2dfa-4810-a60e-5a0b53310e48/",
  "log": "{...}" // SEFAZ response log
}

Functions
Export reports

You can export invoice reports in CSV, XML and DANFE formats, the same way as in the Webmania® Panel.

To export a report, send a POST request to the URL /1/nfe/relatorios/.

In the JSON body, modelo and relatorio are required. Send the pair data_inicio/data_final or numero_inicio/numero_final; CSV requires dates. The maximum number range is 100,000. The date period is limited to 30 or 60 days, depending on the plan.

Reports are exported in asynchronous mode: track the export status by repeating the request or with the parameter url_notificacao, as shown below.

Parameter All models Type Size Description
data_inicio
string 10 or 19 Filter by date and time
YYYY-MM-DD or YYYY-MM-DD HH:mm:ss.
Send both dates. Without a time, the start is 00:00:00 and the end is 23:59:59.
data_final
string 10 or 19 Filter by date and time
YYYY-MM-DD or YYYY-MM-DD HH:mm:ss.
Send both dates. Without a time, the start is 00:00:00 and the end is 23:59:59.
numero_inicio
string 10 Filter by number
Send the start and the end. It does not replace the dates that CSV requires.
numero_final
string 10 Filter by number
Send the start and the end. It does not replace the dates that CSV requires.
modelo
string 3-6 Document model
nfe
nfce
nfse
mdfe
cte
cte_os
nfcom
dce
cce
mde
ciot
relatorio
string 3-14 Report to export
csv
excel
xml
danfe
danfe_simples
danfe_etiqueta
damdfe
dacte
danfecom

Simplified/label DANFE: NF-e only; DACTE: CT-e/CT-e OS; DAMDFE: MDF-e; DANFECOM: NFCom. CIOT and MDe do not generate a PDF.
separar_pdf
integer 1 Split the PDF - Available for DANFE, simplified/label DANFE, DACTE, DAMDFE and DANFECOM
0 - No
1 - Yes
status
string 8-12 Filter by document status
emitidas (issued)
canceladas (canceled)
denegadas (denied)
inutilizadas (voided)
encerradas (closed; MDF-e only)

Required for XML, depending on the model. For PDF, the default is emitidas; CSV and Excel ignore this filter. XML of NFS-e, DC-e and CIOT accepts emitidas/canceladas; MDF-e also accepts encerradas. CC-e does not accept canceladas/inutilizadas.
ordem
string --- Sort order of the invoices in the report
data_emissao (issue date)
numeracao (number)
ordem_alfabetica (alphabetical)
id_pedido (order ID)

For MDF-e, use data_emissao or numeracao. When it is missing, the report is sorted by issue date, newest first.
url_notificacao
string --- Notification URL that receives the download URL of the report. It must be a valid URL with up to 500 characters.

Example of an XML report export:

curl -X POST \
-H "X-Consumer-Key: YOUR_CONSUMER_KEY" \
-H "X-Consumer-Secret: YOUR_CONSUMER_SECRET" \
-H "X-Access-Token: YOUR_ACCESS_TOKEN" \
-H "X-Access-Token-Secret: YOUR_ACCESS_TOKEN_SECRET" \
-H "Content-Type: application/json" \
-d '{
  "data_inicio":"2020-01-01", // Start date
  "data_final":"2020-01-31", // End date
  "modelo":"nfe", // Invoice model
  "relatorio":"xml", // Report to export
  "status":"emitidas", // Filter by invoice status
  "url_notificacao":"http://meudominio.com/retorno.php" // Notification URL
}' \
https://webmania.com.br/api/1/nfe/relatorios/

Example of an HTTP 200 response. A successful response is a JSON object with these main fields: uuid, status (processando, concluido or falha), data_inicio/data_final or numero_inicio/numero_final, depending on the filter, modelo, relatorio, total and processado. Also check error; an HTTP 2xx response does not guarantee success:

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identifier
  "status": "processando", // processando or concluido
  "data_inicio": "2020-01-01 00:00:00",
  "data_final": "2020-01-31 23:59:59",
  "modelo": "nfe",
  "relatorio": "xml",
  "total": 50, // Total results found
  "processado": 0 // Export progress
}

When you repeat the same request to the API, the parameter processado changes so you can track the export progress. We recommend at least 5 seconds between requests. If you sent the parameter url_notificacao, the API sends the response as a POST request to that URL when the export is complete.

When the export is complete, the parameter status changes to concluido, together with the parameter url to download the report. Use the URL you receive; do not build it yourself. The example shows the main fields; expira gives the last date for the download:

{
  "uuid": "43eace5c-8008-4f6c-b830-b6d52d7ff90c", // Unique identifier
  "status": "concluido", // Export complete
  "data_inicio": "2020-01-01 00:00:00",
  "data_final": "2020-01-31 23:59:59",
  "modelo": "nfe",
  "relatorio": "xml",
  "total": 50, // Total results found
  "url": "https://nfe.webmania.com.br/relatorio/000000000-0000-0000-0000-000000000000/", // Download URL
  "expira": "2020-08-14" // Report expiry date
}

Update company

The API has changed: every change to a company is now made at the endpoint PUT /2/b2b/empresas/{uuid} of the B2B Management API, with the management credential of your account and the UUID of the company. The full reference, with every parameter and example, is in Configure company:

  • Registration data
  • Address
  • Taxation
  • Series and numbering
  • A1 digital certificate
  • Optional settings
Existing integrations keep working. Integrations built on the endpoint /1/nfe/empresa/ keep working, and their reference is in version 1.0 of the documentation. We recommend that you move the integration to version 2.0 to avoid future interruptions.

IBS/CBS regime (Simples Nacional)

Set it once, in the company registration. It applies to NF-e, NFC-e, CT-e, CT-e OS and NFCom. To see the effect of each option on the invoice, see IBS/CBS — Simples Nacional.

In the Webmania® Panel, in the company settings:

  • Regime regular do IBS/CBS em vigor (IBS/CBS regular regime in effect): select Sim (Yes) if the company chose the regular regime of IBS/CBS (the new goods and services taxes).
  • Opção pelo Simples Nacional pendente (Simples Nacional option pending): select Sim (Yes) if the company is in the standard regime and is waiting for the decision on its request to join Simples Nacional (the small business regime).
  • CRT pretendido no Simples Nacional (intended CRT in Simples Nacional; CRT is the tax regime code of the company): choose 1 - Simples Nacional or 2 - Simples Nacional, excesso sublimite de receita bruta (Simples Nacional, gross revenue above the sublimit). The field is available only when the pending option is selected.

Through the API, send the fields at the root of POST /1/nfe/empresa/, with the credentials of the company. Use this endpoint for now: PUT /2/b2b/empresas/{uuid} does not accept these fields yet. Fields you leave out keep their saved values.

Example for a company in the standard regime with a pending request to join Simples Nacional:

{
  "regime_regular_ibs_cbs": false,
  "opcao_simples_pendente": true,
  "crt_pretendido_simples": 1
}
Parameter All models Type Size Description
regime_regular_ibs_cbs
integer 1 Option for the regular regime of IBS/CBS.
1, "1" or true - Opted in
0, "0" or false - Did not opt in
opcao_simples_pendente
integer 1 Pending request to join Simples Nacional. Use it only for a company in the standard regime.
1, "1" or true - Pending
0, "0" or false - No pending request

For a company in Simples Nacional or MEI (individual micro-entrepreneur), the API clears the option when it saves the registration.
crt_pretendido_simples
integer 1 Intended regime in Simples Nacional.
1 or "1" - Simples Nacional
2 or "2" - Simples Nacional above the sublimit

Required in the registration when the pending option is selected. null or "" keeps the saved value. It does not change the current tax status of the company.
Do not send these fields when you issue an invoice. The API ignores these fields inside emitente, with no error, and always uses the company registration. If the registration has an invalid value, the invoice is rejected with a message that names the field, for example: [emitente] Informe 1 ou 2 no campo crt_pretendido_simples do cadastro da empresa para a opção pendente pelo Simples Nacional. (Send 1 or 2 in the field crt_pretendido_simples of the company registration for the pending Simples Nacional option.)

Contingency mode and processing

Webmania® detects when SEFAZ, the state tax authority, is offline or has not yet returned the result of an invoice. It then switches to contingency mode, a backup procedure of the tax authority. Your application does not need to resend anything:

SituationWhat Webmania does
SEFAZ received the invoice but has not returned the result yetKeeps the invoice in processamento and checks SEFAZ automatically until it gets the result. See Invoices in processing.
NF-e when the state SEFAZ is unavailableSends the invoice to the SEFAZ backup environments SVC-RS or SVC-AN. The invoice issued there is legally valid: you can print the DANFE (printed invoice summary) and ship the goods as usual.
NFC-e when SEFAZ is unavailableIssues the NFC-e (consumer receipt) in offline mode, without contacting SEFAZ, with the status contingencia and the DANFE for immediate delivery to the consumer. Webmania checks SEFAZ every minute and sends the NFC-e automatically, within the 24-hour limit.
From request to final result: NF-e and NFC-e When it receives the POST /api/1/nfe/emissao/, Webmania checks whether the SEFAZ of the state (the state tax authority) is available. If it is, the invoice is sent in the same request: the response returns aprovado or reprovado, or processamento when SEFAZ has not given the result yet; in that case Webmania checks SEFAZ automatically. When SEFAZ is unavailable, the NF-e is sent automatically to SVC (SVC-AN or SVC-RS, depending on the state), in the same request and with legal validity. The NFC-e is issued in offline contingency mode: the response returns the contingencia status, with the XML and the DANFE to hand to the consumer. Webmania checks SEFAZ, looks up the NFC-e and resends it automatically when SEFAZ responds again. The url_notificacao receives every status change, up to the final result. POST /api/1/nfe/emissao/ Is the state SEFAZ available? Sent to the authorizer SEFAZ or SVC, in the same request Which model? Immediate response aprovado reprovado Processing processamento Webmania checks SEFAZ automatically NFC-e in offline contingency contingencia with XML and DANFE to print Webmania checks SEFAZ and looks up the NFC-e before resending Automatic resend when SEFAZ responds again Final result in your application in the url_notificacao and the lookup Yes No NF-e: SVC-AN or SVC-RS NFC-e
Webmania® step Check Final result Waiting for the result: not a final status Your application
SVC is the SEFAZ contingency environment and issues the NF-e with legal validity. While the status is processamento or contingencia, follow the invoice through the lookup, without issuing it again.

The final result arrives in the notification and is available in the invoice lookup. Until then, do not request a new invoice for the same transaction.

Contingency mode
Invoices in processing

The NF-e and the NFC-e are sent to SEFAZ with a request for a synchronous response. Still, the API response can return the status processamento when SEFAZ has not returned the result yet. This does not stop the API from processing the request asynchronously, or from waiting for the tax result. When the response shows processamento:

  • Authorization is not confirmed yet: the first response does not guarantee immediate authorization.
  • Webmania checks SEFAZ automatically, and the final result arrives in the notification.
  • Look up the invoice and wait for the tax result before you ship the product or request a new invoice.

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

The POST to the url_notificacao is sent directly from the Webmania® servers, through the static outbound IPs. By checking the IP, you can make sure that the notification to your application comes from our servers.

All files are stored on Amazon S3, which guarantees 99.999999999% file durability and end-to-end encryption, under strict security and internal control rules.

Request limits

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

GET 15per second

Reading: lookups and lists.

POST No limit

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

PUT / DELETE 5per second

Changing and removing resources.

Specific limits

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

Request Limit Reason
Tax document events, such as cancellation, correction letter and recipient acknowledgment 1 request per second, on any method Safe communication with SEFAZ (the state tax authority) and the city halls.
Issuing in the sandbox (homologação) 1 request per second Test environment for your integration.

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

When the limit is exceeded

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

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

Example of an HTTP 429 response:

{
  "error": "Too Many Requests"
}
Detect the limit by the HTTP status 429, not by the text of the error field: the message can change from one endpoint to another.

How to handle HTTP 429

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

Best practices

Use the notification URL

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

Send through a queue

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

Send valid credentials

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

Allow your server IP

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

Changelog

  1. v3.2.0 · November 30, 2026 · Documentation · Added

    NF-e and NFC-e have a new section, IBS/CBS — Simples Nacional: what changes for each type of company, the setup in the company record and in the Tax Class, the activity code and the Simples rates, the dates per environment, and how to fill in returns and credit notes.

    Changed sections: reforma-tributaria-simples-nacional, ibs-cbs-classe-imposto

  2. v3.1.2 · November 28, 2026 · API · Changed

    Company changes are now made with the endpoint PUT /2/b2b/empresas/{uuid} of the B2B Management API. Integrations that use /1/nfe/empresa/ keep working; their reference is in version 1.0 of the B2B documentation.

    Changed section: atualizar-empresa

  3. v3.1.1 · November 24, 2026 · API · Changed

    New status processando_cancelamento: when SEFAZ (the state tax authority) is unstable, the cancellation waits for automatic confirmation and ends as cancelado or aprovado.

    Changed sections: cancelar-nfe, nfe-ciclo-vida

  4. v3.1.0 · November 17, 2026 · API · Added

    Basic food basket (cesta básica) items can now be confirmed in the cesta_basica field, with automatic ICMS and ICMS-ST calculation based on the activity sent in tipo_atividade for the company and the customer. It currently works for Pernambuco (Annex 45 of RICMS-PE). Without per-item confirmation, the current calculation still applies.

    Changed sections: informacoes-produto-cesta-basica, informacoes-cliente, atualizar-empresa-opcionais

  5. v3.0.2 · November 17, 2026 · Documentation · Changed

    The contingency section now has a flowchart from the request to the final result: SVC for the NF-e, offline contingency for the NFC-e, and the statuses that are not final.

    Changed section: contingencia

  6. v3.0.1 · November 9, 2026 · Documentation · Added

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

Solutions

Fiscal IssuerFiscal MonitorTax ReconciliationArtificial Intelligence

Industries

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

Brazil tax guide

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

Company

AboutCustomersContactBook a demoPolicies and termsTrust Center

Developers

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

Offices

United States

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

São Paulo, Brazil

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

Curitiba, Brazil

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

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

Talk to our team

Quick access

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

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

Region and language

Brazil

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