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:
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.
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: 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: 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: 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: 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: 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: 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: 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 (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: 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: 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.
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.
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/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. classe_imposto (Tax Class) or the impostos object. /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. url_notificacao. aprovado, use the danfe and xml URLs of the response or of the notification. uuid, chave (access key) or ID, to check the status at any time. 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:
| Situation | Invoice to issue | How to issue |
|---|---|---|
| Sale, purchase or other outgoing or incoming transaction | Normal NF-e or NFC-e | POST /1/nfe/emissao/ with finalidade = 1 |
| Return goods, or cancel the tax effects of an invoice issued before | Return/reversal | POST /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) | Adjustment | POST /1/nfe/ajuste/ |
| Add price, quantity or taxes that were missing from the original invoice | Complementary | POST /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) | Credit | POST /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 loss | Debit | POST /1/nfe/emissao/ with finalidade = 6 and tipo_debito |
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:
processamento or contingencia, follow the invoice through the lookup or the notification, without issuing it again.| Status | What it means | What to do |
|---|---|---|
processamento | SEFAZ 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. |
contingencia | SEFAZ 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. |
aprovado | SEFAZ 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. |
reprovado | SEFAZ rejected the invoice; motivo has the response. | Fix the data shown in motivo and issue a new invoice. |
denegado | SEFAZ denied the use of the invoice; motivo has the response. | Solve the problem shown in motivo before you issue a new invoice. |
processando_cancelamento | Cancellation waiting for confirmation from SEFAZ. | The status is updated automatically when SEFAZ responds. Do not resend the cancellation. |
cancelado | SEFAZ approved the cancellation. | Store the xml_cancelamento. Do not use this invoice in the transaction. |
Each item of produtos needs its taxes, sent in one of these ways; at least one is required:
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.
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 send | Where | See |
|---|---|---|
| ICMS, IPI, PIS, COFINS, ISSQN and Import | produtos[].impostos | Taxes in the API |
| IBS and CBS | produtos[].impostos.ibs_cbs | Tax reform |
| Tax withholding | impostos.retencao_tributos, at the root of the JSON | Tax withholding |
| Tax totals before issuing | calculo_impostos | Tax calculation |
Take this reference to your AI assistant, integrate the API with an official SDK, or start from the ready-made modules and examples.
Send an AI the section index of this reference: it reads the index and fetches only the sections it needs, in Markdown. The Markdown is in Portuguese; the assistant can answer in English.
Official open-source SDKs on GitHub to integrate the Webmania APIs in the language of your project. Each repository includes installation, examples and the operations it covers.
Node.js / TypeScript Available
git clone https://github.com/
Python Available
git clone https://github.com/
PHP Available
git clone https://github.com/
Perl Available
git clone https://github.com/
Go Available
git clone https://github.com/
C Available
git clone https://github.com/
C++ Available
git clone https://github.com/
Lua Available
git clone https://github.com/
Dart Available
git clone https://github.com/
R Available
git clone https://github.com/
Java Available
git clone https://github.com/
Kotlin Available
git clone https://github.com/
Scala Available
git clone https://github.com/
Clojure Available
git clone https://github.com/
Ruby Available
git clone https://github.com/
.NET (C#) Available
git clone https://github.com/
PowerShell Available
git clone https://github.com/
Elixir Available
git clone https://github.com/
Rust Available
git clone https://github.com/
Haskell Available
git clone https://github.com/
Swift Available
git clone https://github.com/
Official modules to issue invoices in one click from your online store, with no coding.
Test the REST API without writing a line of code, and speed up your integration with the official Webmania® tools.
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.
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 status | When it is sent |
|---|---|
aprovado | SEFAZ authorized the invoice; the body has the chave, the xml and the danfe. |
reprovado | SEFAZ rejected the invoice; the body has the motivo (reason). |
denegado | SEFAZ denied the use of the invoice; the body has the motivo (reason). |
cancelado | SEFAZ 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.
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.
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 |
motivo | string | Reason for the status, as SEFAZ returns itE.g.: Autorizado o uso da NF-e (use of the NF-e authorized) |
nfe | string | Invoice numberManaged 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. |
chave | string | Access key that identifies the invoice at SEFAZ (44 characters; keep the value as text) |
modelo | string | Invoice modelnfe |
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 |
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 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.
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. 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. produtos, with the data of each item and its taxes: classe_imposto or impostos. pedido object, with the payment, the buyer presence, the freight and the total. 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.
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 | ||
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 | ||
finalidade | integer | 1 | Purpose of the invoice. Adjustment and Complementary invoices have their own issuing endpoints. 1 - Normal NF-e | ||
ambiente | integer | 1 | SEFAZ environment 1 - Production | ||
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 | |
tipo_debito | Required when finalidade = 6 (Debit) | integer | 1 | Debit note type, required only for finalidade = 6. 1 - Credit transfer to cooperatives | |
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 | ||
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:
| Parameter | NF-e | NFC-e | Type | Size | Description |
|---|---|---|---|---|---|
data_emissao | string | 19 | Issue date and time.Format: | ||
data_entrada_saida | string | 19 | Date and time of entry or exit, when it differs from the issue date.Format: | ||
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: |
{
"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.
| 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": { ... }
} | Parameter | NF-e | NFC-e | Type | Size | Description |
|---|---|---|---|---|---|
modelo | string | 2 | Tax document model2B = Cupom Fiscal issued by a cash register (not an ECF) | ||
n_ecf | integer | 1-3 | Sequential number of the ECFSend 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": { ... }
} | Parameter | NF-e | NFC-e | Type | Size | Description |
|---|---|---|---|---|---|
uf | string | 2 | State of the rural producerXX | ||
data | string | 10 | Issue date of the producer invoiceFormat: | ||
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 model04 = Producer invoice (NF de Produtor) | ||
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.
| 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": { ... }
} Send the customer data in the cliente object:
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.endereco, also send a valid bairro (neighborhood) and cep (postal code).| Parameter | NF-e | NFC-e | Type | Size | Description |
|---|---|---|---|---|---|
cpfIndividual | string | 11 | CPF number (individual taxpayer ID)000.000.000-00 | ||
nome_completoIndividual | string | 2-60 | Full name | ||
cnpjCompany | string | 14 | CNPJ (company ID)00.000.000/0000-00 | ||
razao_socialCompany | string | 2-60 | Legal name | ||
ieCompany Individual | string | 2-14 | *Required if the customer has a state registration State registration (IE) number More information: sintegra.gov.br (in Portuguese) | ||
suframaCompany | string | 8-9 | SUFRAMA registration (Manaus Free Trade Zone) | ||
substituto_tributarioCompany 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_finalCompany 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 | ||
contribuinteCompany 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 | ||
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. |
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"
},
...
} 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 | |
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"
}
...
} 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 codeNOTE: 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: | |
unidade_tributavel | string | 1-6 | Taxable unit of the product Example: | |
peso | string | 12v3 | Product weightWeight in kilograms (KG) | |
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 | |
desconto | string | 13v2 | Discount amount for this product 0.00 | |
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 total0 - Item amount is not 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 goodsThe 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 | |
cnpj_fabricante | string | 14 | CNPJ (company ID) of the manufacturer of the goods 00.000.000/0000-00 (example format; send a valid CNPJ) | |
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 |
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"
}
]
}
],
...
} 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 documentFormat: 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 dateFormat: 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 | |
intermediacao | string | 1 | Import type, by intermediation 1 - Import on own account | |
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 codeNumber 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 importWith 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 importWith 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 importRequired for imports on behalf of a third party, or to order. Does not accept the value "EX". | |
cod_exportador | string | 1-60 | Exporter codeNumber 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",
}
],
...
} 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 dateFormat: | |
data_validade | string | 10 | Expiration dateFormat: | |
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"
}
}
],
...
} 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.
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. /1/nfe/devolucao/ — automatic: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. /1/nfe/emissao/ with finalidade=4: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": { ... }
} 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 consumedXX | |
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 temperatureOnly 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"
}
}
],
...
} 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 | |
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"
}
]
}
}
],
...
} 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"
}
}
],
...
} 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 | |
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 firearmCaliber, 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"
}
}
],
...
} 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 type1 - Dealership sale | |
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 weight0.0000 (in metric tons, with 4 decimal places) | |
peso_bruto | string | 1-9 | Total gross weight0.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) | |
numero_motor | string | 1-21 | Engine number | |
cmt | string | 1-9 | Maximum traction capacity0.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 typeUse the RENAVAM table, as in the examples below: | |
especie_veiculo | integer | 1 | Vehicle categoryUse the RENAVAM table | |
vin | string | 1 | VIN conditionIndicates whether the vehicle's VIN (chassis number) was re-stamped. | |
condicao_veiculo | integer | 1 | Vehicle condition1 - Finished | |
marca_modelo | integer | 1-6 | Make/model codeUse the RENAVAM table | |
cor_denatran | integer | 1-2 | Color code of the DENATRAN (national traffic department)01 - Yellow | |
lotacao | integer | 1-3 | Maximum seating capacity | |
restricao | integer | 1 | Restriction0 - None |
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"
}
}
],
...
} 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. |
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.
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:
| Recipient | Customer | CST |
|---|---|---|
| Purchase for resale | tipo_atividade: "comerciante", active ie, contribuinte: 1 and consumidor_final: 0 | 70 |
| Purchase for manufacturing | tipo_atividade: "industria" | 20 |
| End consumer | consumidor_final: 1, without tipo_atividade | 20 |
| Not an ICMS taxpayer | contribuinte: 9, without tipo_atividade | 20 |
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.
| Field | Value |
|---|---|
ncm | Full NCM (product code), with eight digits. |
impostos.icms.situacao_tributaria | CST based on the recipient (table above). |
impostos.icms.aliquota | PE intrastate rate (20.50). |
impostos.icms.aliquota_st | With CST 70: PE intrastate rate (20.50). |
impostos.icms.motivo_desoneracao | Required with CST 70. |
impostos.icms.deducao_desoneracao | With CST 70: 0, so the relieved ICMS (desonerado) is not deducted from the invoice total. |
impostos.icms.aliquota_mva | Does 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.
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.
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) | |
intermediador | integer | 1 | Intermediary/marketplace indicator 0 - Transaction without an intermediary (on your own website or platform) | |
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) | |
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 expenses0.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"
}
} 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) | ||
forma_pagamento | string or array | 2 | Payment method. Default when missing: 99 - Other. 01 - Cash | ||
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 dateFormat: 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 type1 - Payment integrated with the company's automation system (e.g.: TEF terminal, e-commerce, integrated POS)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 | ||
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
}
} 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.
pedido.forma_pagamento and pedido.valor_pagamento, and the intermediary data, when applicable. | 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) |
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.
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) | |
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) | |
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"
}
} Identify the carrier that will transport the products. The carrier information goes inside the transporte object, as a complement.
| 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 plateUse one of these formats: XXX9999, XXX999, XX9999 or XXXX999. | |
uf_veiculo | string | 2 | State code (UF) where the vehicle is registeredSend "EX" for abroad. | |
rntc | string | 1-20 | National Registry of Road Cargo Carriers (ANTT, the national land transport agency) | |
seguro | string | 13v2 | Insurance amount0.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"
}
} 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 plateUse one of these formats: XXX9999, XXX999, XX9999 or XXXX999. | |
uf_veiculo | string | 2 | State code (UF) where the vehicle is registeredSend "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"
}
]
}
} 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 |
|---|---|---|---|---|
cnpjCompany | string | 14 | CNPJ (company ID)00.000.000/0000-00 | |
razao_socialCompany | string | 2-60 | Legal name | |
ieCompany | string | 2-14 | State registration (IE) number | |
cpfIndividual | string | 11 | CPF (individual taxpayer ID) number000.000.000-00 | |
nome_completoIndividual | string | 2-60 | Full name | |
nome_estrangeiroForeign | 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_paisForeign | string | 4 | Country code (BACEN standard, from the Central Bank of Brazil)E.g.: United States = 2496 | |
paisForeign | string | 1-60 | Name of the delivery country | |
ufCompany Individual Foreign | string | 2 | State of the delivery address. Required when you do not send nome_estrangeiro.Send "EX" for abroad | |
cepCompany 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 |
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"
}
}
} 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 |
|---|---|---|---|---|
cnpjCompany | string | 14 | CNPJ (company ID)00.000.000/0000-00 | |
razao_socialCompany | string | 2-60 | Legal name | |
ieCompany | string | 2-14 | State registration (IE) number | |
cpfIndividual | string | 11 | CPF (individual taxpayer ID) number000.000.000-00 | |
nome_completoIndividual | string | 2-60 | Full name | |
nome_estrangeiroForeign | 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_paisForeign | string | 4 | Country code (BACEN standard, from the Central Bank of Brazil)E.g.: United States = 2496 | |
paisForeign | string | 1-60 | Name of the pickup country | |
ufCompany Individual Foreign | string | 2 | State of the pickup address, required when there is no nome_estrangeiro.Send "EX" for abroad | |
cepCompany 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 |
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"
}
}
} 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 numberE.g.: 12345 | |
valor | string | 13v2 | Original amount of the bill0.00 | |
desconto | string | 13v2 | Discount amount0.00 | |
valor_liquido | string | 13v2 | Net amount of the bill0.00 |
Example with the billing data:
{
...
"pedido": {
...
},
"fatura": {
"numero": "000001",
"valor": "100.00",
"desconto": "0.00",
"valor_liquido": "100.00"
}
} 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 dateFormat: YYYY-MM-DD | |
valor | string | 13v2 | Installment amount0.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"
}
]
} 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"
}
} 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; | |
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"
}
}
}
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 | |
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 | |
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"
} 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"
}
]
} 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"
} 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. |
| 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 | |
cenario | string | --- | Tax scenariosaida_dentro_estado | |
tipo_pessoa | string | --- | Person typefisica | |
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: | |
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 | string | 3v2 | Effective ICMS burden, normalized to 2 decimal places and saved for codes 20, 70, 90, 201, 202, 203 and 900. | |
aliquota_efetiva_icms_st | string | 3v4 | Effective 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 | string | 8 or 10 | Tax 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 | |
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 | |
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 | |
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"
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
estado | string | 2 | State abbreviation (UF)e.g. PR | |
aliquota | string | 3v2 | Rate value0.00 |
{
"icms": [
{
...
"aliquota_mva" : [
{
"estado" : "PR",
"aliquota" : "32.00"
},
{
"estado" : "SC",
"aliquota" : "32.00"
},
{
"estado" : "RS",
"aliquota" : "32.00"
}
]
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
estado | string | 2 | State abbreviation (UF)e.g. PR | |
aliquota | string | 3v2 | Rate value0.00 |
{
"icms": [
{
...
"aliquota_icms" : [
{
"estado" : "PR",
"aliquota" : "32.00"
},
{
"estado" : "SC",
"aliquota" : "32.00"
},
{
"estado" : "RS",
"aliquota" : "32.00"
}
]
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
estado | string | 2 | State abbreviation (UF)e.g. PR | |
aliquota | string | 3v2 | Rate value0.00 |
{
"icms": [
{
...
"aliquota_icms_st" : [
{
"estado" : "PR",
"aliquota" : "32.00"
},
{
"estado" : "SC",
"aliquota" : "32.00"
},
{
"estado" : "RS",
"aliquota" : "32.00"
}
]
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
estado | string | 2 | State abbreviation (UF)e.g. PR | |
aliquota | string | 3v2 | Rate value0.00 |
{
"icms": [
{
...
"aliquota_fcp" : [
{
"estado" : "PR",
"aliquota" : "32.00"
},
{
"estado" : "SC",
"aliquota" : "32.00"
},
{
"estado" : "RS",
"aliquota" : "32.00"
}
]
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
estado | string | 2 | State abbreviation (UF)e.g. PR | |
aliquota | string | 3v2 | Rate value0.00 |
{
"icms": [
{
...
"aliquota_fcp_st" : [
{
"estado" : "PR",
"aliquota" : "32.00"
},
{
"estado" : "SC",
"aliquota" : "32.00"
},
{
"estado" : "RS",
"aliquota" : "32.00"
}
]
}
]
}
| 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"
}
]
}
]
}
| 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 rate0.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"
}
]
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
cenario | string | --- | Tax scenariopadrao | |
tipo_pessoa | string | --- | Person typefisica | |
situacao_tributaria | string | 2 | IPI CST (tax status code)00 - Inbound with credit recovery | |
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 rate0.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"
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
cenario | string | --- | Tax scenariopadrao | |
tipo_pessoa | string | --- | Person type.fisica | |
situacao_tributaria | string | 2 | PIS CST (tax status code)01 - Taxable transaction - Tax base = transaction amount, standard rate (cumulative/non-cumulative) | |
aliquota | string | 3v2 | PIS rate0.00 |
{
"pis": [
{
"cenario": "padrao",
"tipo_pessoa": "fisica",
"situacao_tributaria": "99",
"aliquota": "0.00"
},
{
"cenario": "padrao",
"tipo_pessoa": "juridica",
"situacao_tributaria": "99",
"aliquota": "0.00"
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
cenario | string | --- | Tax scenariopadrao | |
tipo_pessoa | string | --- | Person typefisica | |
situacao_tributaria | string | 2 | COFINS CST (tax status code)01 - Taxable transaction - Tax base = transaction amount, standard rate (cumulative/non-cumulative) | |
aliquota | string | 3v2 | COFINS rate0.00 |
{
"cofins": [
{
"cenario": "padrao",
"tipo_pessoa": "fisica",
"situacao_tributaria": "99",
"aliquota": "0.00"
},
{
"cenario": "padrao",
"tipo_pessoa": "juridica",
"situacao_tributaria": "99",
"aliquota": "0.00"
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
cenario | string | --- | Tax scenariopadrao | |
tipo_pessoa | string | --- | Person typefisica | |
codigo_cfop | string | --- | CFOP (transaction code)0.000 | |
exigibilidade | string | 1 | ISS enforceability indicator 1 - Due | |
item_servico | string | --- | Item of the service list that classifies the service in the ABRASF standard00.00 | |
incentivo_fiscal | string | 1 | Tax incentive indicator1 - Yes | |
aliquota | string | 3v2 | ISSQN rate0.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"
}
]
}
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
cenario | string | --- | Tax scenariopadrao | |
tipo_pessoa | string | --- | Person typepadrao | |
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. |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
aliquota_diferimento | number | 3v4 | Deferral rate of the state IBS, city IBS or CBS, when sent. |
| 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
}
}
]
}
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.
| 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 Classnfse | |
ibs_cbs | object | --- | IBS/CBS tax data | |
iss | number | 1-100 | ISS rate0.00 | |
pis | number | 1-100 | PIS rate0.00 | |
cofins | number | 1-100 | COFINS rate0.00 | |
inss | number | 1-100 | INSS rate0.00 | |
ir | number | 1-100 | IR rate0.00 | |
csll | number | 1-100 | CSLL rate0.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"
} | 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 |
| 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. |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo_servico | string | 3-5 | Service code00.00 | |
natureza_operacao | string | 1 | Code of the nature of the transaction (natureza da operação) 1 - Taxed in the city | |
exigibilidade_iss | string | 1 | ISS enforceability 1 - Due | |
iss_retido | string | 1 | ISS withholding 1 - Yes | |
responsavel_retencao | string | 1 | Party responsible for withholding the ISS. Required when ISS is withheld. 1 - Service buyer | |
codigo_cnae | string | Up to 9 | CNAE code (economic activity code). | |
codigo_tributacao_municipio | string | 1-20 | City tax code. | |
codigo_nbs | string | 9 | NBS code of the service (Brazilian service classification), with exactly 9 digits after removing non-numeric characters. |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo_cnae | string | Up to 7 | CNAE code, with at most 7 characters. | |
codigo_servico | string | 3-5 | Service code00.00 | |
local_prestacao | string | 1 | Place where the service is provided 1 - Provider's head office | |
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 |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo_servico | string | 3-5 | Service code00.00 | |
tipo_tributacao | string | 1 | Tax type C - Exempt from ISS | |
iss_retido | string | 1 | ISS withholding 1 - Yes | |
responsavel_retencao | string | 1 | Party responsible for withholding the ISS. Required when ISS is withheld. 1 - Service buyer | |
codigo_cnae | string | Up to 9 | CNAE code, with at most 9 characters. |
| 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 | |
iss_retido | string | 1 | ISS withholding 1 - Yes |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
cenario | string | 1 | Tax scenario 1 - Outbound to the same city | |
codigo_cfps | string | 4 | Service tax code (CFPS) |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo_servico | string | 3-5 | Service code00.00 | |
regime_recolhimento | string | 2 | Collection regime code 00 - Activity | |
forma_recolhimento | string | 2 | Collection method code 00 - Normal |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo_servico | string | 3-5 | Service code00.00 | |
iss_retido | string | 1 | ISS withholding 1 - Yes | |
responsavel_retencao | string | 1 | Party responsible for withholding the ISS. Required when ISS is withheld. 1 - Service buyer | |
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 | string | 9 | NBS code of the service, with exactly 9 digits after removing the formatting. |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
cenario | number | 1 | Tax scenario 1 - With ISS withholding | |
exigibilidade_iss | string | 1 | ISS enforceability 1 - Due | |
deducoes | string | 13v2 | Deduction from the tax base0.00 | |
iss | string | 3v2 | ISS rate0.00 | |
pis | string | 3v2 | PIS rate0.00 | |
cofins | string | 3v2 | COFINS rate0.00 | |
inss | string | 3v2 | INSS rate0.00 | |
ir | string | 3v2 | IR rate0.00 | |
csll | string | 3v2 | CSLL rate0.00 |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo_servico | string | 3-5 | Service code00.00 | |
iss_retido | string | 1 | ISS withholding 1 - Yes | |
responsavel_retencao | string | 1 | Party responsible for withholding the ISS. Required when ISS is withheld. 1 - Service buyer |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
tipo_emissao | string | 1 | NFS-e issue type 1 - Normal | |
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 | |
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) | |
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 | |
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 | |
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 | |
ibs_cbs | object | --- | IBS/CBS tax object of the service class, with the fields below. | |
codigo_interno | string | 1-20 | Internal 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 | number | 1 | Final consumer indicator, normalized to an integer.0 - No | |
informacoes_complementares | string | Up to 2000 | Additional information. Spaces at both ends are removed before the length is checked. | |
codigo_nbs | string | 9 | NBS 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 | number | 2 decimal places | Social security contribution for normal issuing; numeric value normalized to two decimal places. |
| 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 | |
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 | |
cbs | object | --- | Deferral data of the CBS in the service Tax Class. Required when the tax status allows deferral; ignored in other cases.Send | |
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. |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo_servico | string | 3-5 | Service code00.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 | |
iss_retido | string | 1 | ISS withholding 1 - Yes | |
responsavel_retencao | string | 1 | Party responsible for withholding the ISS. Required when ISS is withheld. 1 - Service buyer |
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 Classnfcom | |
codigo_classificacao | string | 6-7 | Classification code of the NFCom item. See the table of classificationsSend 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
classe_imposto, send the object impostos.ibs_cbs, when required, at the root of the NFCom issue JSON, outside itens. Learn more| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
situacao_tributaria | string | 2 | ICMS CST (tax status code) 00 - Fully taxed | |
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 | |
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) rate0.00 |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
situacao_tributaria | string | 2 | PIS and COFINS CST (tax status code) 01 - Taxable transaction at the basic rate | |
aliquota | number | 0-100 | PIS or COFINS rate. Required for CST 01, 02 and 49.0.00 |
| 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. |
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": []
}
] 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 ClassSend 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."
}
] 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 |
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"
}
}
}
],
...
} 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.00We 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 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 | |
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 |
| Parameter | NF-e / NFC-e | Type | Size | Description |
|---|---|---|---|---|
aliquota_credito | string | 3v2 | Rate used to calculate the credit0.00 |
"impostos": {
"icms": {
"codigo_cfop": "5.102",
"situacao_tributaria": "101",
"aliquota_credito": "10.00"
}
} | 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.00We 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 credit0.00 | |
aliquota_reducao | string | 3v4 | ICMS tax base reduction rate0.0000 | |
aliquota_reducao_st | string | 3v4 | ICMS-ST tax base reduction rate0.0000 |
"impostos": {
"icms": {
"codigo_cfop": "5.402",
"situacao_tributaria": "201",
"aliquota_credito": "10.00",
"aliquota_mva": "20.00"
}
} | 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.00We 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 rate0.0000 | |
aliquota_reducao_st | string | 3v4 | ICMS-ST tax base reduction rate0.0000 |
"impostos": {
"icms": {
"codigo_cfop": "5.402",
"situacao_tributaria": "202",
"aliquota_mva": "20.00"
}
} 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%. | |
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 percentageThe 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 rateThe 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",
...
}
} 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.00We 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 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 | |
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 |
| Parameter | NF-e / NFC-e | Type | Size | Description |
|---|---|---|---|---|
pauta_fiscal | string | 13v2 | Fixed reference price (pauta) in reais used to calculate ICMS0.00 |
"impostos": {
"icms": {
"pauta_fiscal": "0.00"
}
} | 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"
}
} | 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.00We 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 rate0.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 |
"impostos": {
"icms": {
"codigo_cfop": "5.402",
"situacao_tributaria": "10",
"aliquota_mva": "20.00"
}
} | Parameter | NF-e / NFC-e | Type | Size | Description |
|---|---|---|---|---|
quantidade_retencao | string | 3v2-4 | Taxed quantity subject to withholding0.0000 | |
aliquota_retencao | string | 3v2-4 | Ad rem rate (fixed amount per unit) of the tax with withholding0.0000 | |
percentual_reducao | string | 3v2 | Reduction percentage of the ICMS ad rem rate0.00 | |
motivo_reducao | string | 1 | Reason for the reduction (required when you send the reduction percentage)0 - Public passenger transport | |
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"
}
} | Parameter | NF-e / NFC-e | Type | Size | Description |
|---|---|---|---|---|
aliquota_reducao | string | 3v4 | ICMS tax base reduction rate0.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 | |
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 |
"impostos": {
"icms": {
"codigo_cfop": "5.102",
"situacao_tributaria": "20",
"aliquota_reducao": "20.00",
"motivo_desoneracao": "9",
"deducao_desoneracao": "1"
}
} | 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 | |
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 |
"impostos": {
"icms": {
"codigo_cfop": "5.102",
"situacao_tributaria": "30",
"motivo_desoneracao": "9",
"deducao_desoneracao": "1"
}
} | Parameter | NF-e / NFC-e | Type | Size | Description |
|---|---|---|---|---|
motivo_desoneracao | string | 1-2 | Reason for the ICMS relief (desoneração).1 - Taxi | |
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 |
"impostos": {
"icms": {
"codigo_cfop": "5.102",
"situacao_tributaria": "40",
"motivo_desoneracao": "9",
"deducao_desoneracao": "1"
}
} | 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 |
"impostos": {
"icms": {
"codigo_cfop": "5.102",
"situacao_tributaria": "51",
"aliquota_diferimento": "20.00",
"codigo_beneficio_reducao_bc": "SC123456"
}
} | Parameter | NF-e / NFC-e | Type | Size | Description |
|---|---|---|---|---|
aliquota_diferimento | string | 3v2-4 | Deferral percentage0.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.
| 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%. | |
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 percentageThe 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 rateThe 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",
...
}
} | 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"
}
} | 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.00We 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 rate0.0000 | |
aliquota_reducao_st | string | 3v4 | ICMS-ST tax base reduction rate0.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 | |
motivo_desoneracao_st | string | 1-2 | Reason for the ICMS-ST relief (desoneração).3 - Use in agriculture and livestock | |
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 |
"impostos": {
"icms": {
"codigo_cfop": "5.402",
"situacao_tributaria": "70",
"aliquota_reducao": "10.00",
"aliquota_mva": "20.00",
"motivo_desoneracao": "9",
"deducao_desoneracao": "1"
}
} 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"
}
} 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"
}
} 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"
}
} 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 rate0.0000 | |
valor | string | 13v2 | Presumed credit amount0.00 |
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"
}
}
} 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:
6.150, 6.151, 6.152, 6.153, 6.155 or 6.156 (interstate transfer between branches of the same owner);situacao_tributaria: "90"; 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.
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 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 rate0.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"
}
} 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) Send the CST that applies. The validation of taxes sent directly has no default. | |
aliquota | string | 3v2 | PIS rate0.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"
}
} 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) Send the CST that applies. The validation of taxes sent directly has no default. | |
aliquota | string | 3v2 | COFINS rate0.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"
}
} 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 | |
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 indicator1 - Yes | |
aliquota | string | 3v2 | ISSQN rate0.00 | |
deducao | string | 13v2 | Deduction from the tax base0.00 | |
retencoes | string | 13v2 | Amount of other withholdings0.00 | |
desconto_incondicionado | string | 13v2 | Amount of the unconditional discount0.00 | |
desconto_condicionado | string | 13v2 | Amount of the conditional discount0.00 | |
iss_retido | string | 13v2 | Amount of ISS withheld0.00 | |
municipio | string | --- | City where the tax appliesE.g.: Brasília | |
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 enforceabilityThe 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"
}
} 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 amount0.00 | |
valor_cofins | string | 13v2 | Withheld COFINS amount0.00 | |
valor_csll | string | 13v2 | Withheld CSLL amount0.00 | |
bc_irrf | string | 13v2 | IRRF tax base0.00 | |
valor_irrf | string | 13v2 | Withheld IRRF amount0.00 | |
bc_previdencia | string | 13v2 | Tax base of the social security withholding0.00 | |
valor_previdencia | string | 13v2 | Amount of the social security withholding0.00 |
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"
}
}
} 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 tax0.00 (normalized to 2 decimal places) | |
iof | string | 3v2 | IOF (financial transactions tax) rate0.00 |
Example of import data inside the impostos object:
"impostos": {
"importacao": {
"aliquota": "18.00"
}
} 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"
}
} 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.
Complementary Law 214/2025 (Lei Complementar 214/2025) created three new taxes. They will gradually replace the current taxes:
| Environment | Available from | Required from |
|---|---|---|
| Sandbox (test environment) | July 7, 2025 | To be defined |
| Production | October 20, 2025 | January 1, 2026 |
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 | |
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 informationRequired 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 informationRequired for tax status code (CST) 811. | |
estorno_credito | object | - | IBS and CBS credit reversal informationRequired 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": {...}
}
}
}
]
} 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 applies | Sandbox | Production |
|---|---|---|
| New fields and Simples Nacional calculation | Already available | Invoices 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 regime | Invoices with an issue date from January 1, 2027 (see How it works) | |
| If your company is… | What to do |
|---|---|
| Simples Nacional, above the sublimit or not | Send 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 Nacional | In 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 request | Nothing changes. |
| MEI (individual micro-entrepreneur) | Nothing. The API stops sending IBS/CBS on MEI invoices, even if the integration sends it. |
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 regime | Only when the IBS/CBS CST of the item requires it | IBS and CBS |
| Simples Nacional above the sublimit, without the regular regime | Yes. 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 regime | Yes | No |
| Standard regime with a pending option for Simples Nacional, without the regular regime | Yes | IBS and CBS |
| Standard regime with a pending option for Simples Nacional above the sublimit, without the regular regime | Yes | CBS only |
| Standard regime with a pending option, with the regular regime | Yes | No |
| 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.
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 90Send 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 |
|---|---|
01 | Resale, or sale of goods manufactured by the company (Annex I) |
02 | Other tangible goods, not subject to ICMS (Annex I) |
03 | Sale of goods manufactured by the company, with incentivized manufacturing in the Manaus Free Trade Zone (Annex II) |
04 | Other tangible goods with incentivized manufacturing in the Manaus Free Trade Zone, not subject to ICMS (Annex II) |
90 | Non-taxable transaction |
| Field | Order of precedence | If it is nowhere |
|---|---|---|
| Activity code | 1. 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 rate | 1. 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.
| Case | What you do |
|---|---|
| Adjustment NF-e | Send 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-e | Send 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/ endpoint | Nothing. 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 endpoint | Nothing. 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. |
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"
}
} 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
} 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
} 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)
} 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 | |
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
}
} 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 baseConditional 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 variantConditional 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 withholdingRequired 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 withholdingRequired for classification 620002 (single-phase subject to withholding). | |
aliquota_cbs_retencao | string | 3v4 | CBS rate for withholdingRequired for classification 620002 (single-phase subject to withholding). | |
quantidade_bc_retido | string | 13v4 | Quantity of the tax base already withheld earlierRequired 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 earlierRequired 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 earlierRequired 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 taxationRequired 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 rateRequired 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 rateRequired 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 rateRequired 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 withholdingRequired 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 differenceUsed 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 differenceRequired 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 differenceRequired 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
} 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 codeSee the classification table below | |
bc | string | 13v2 | Tax base of the transaction | |
aliquota_ibs | string | 2v4 | Presumed credit percentage for the IBSRequired when the credit classification applies to the IBS and the group is used. | |
aliquota_cbs | string | 2v4 | Presumed credit percentage for the CBSRequired when the credit classification applies to the CBS and the group is used. |
| 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
} 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 transfer0.00 | |
valor_cbs | string | 13v2 | CBS amount to transfer0.00 |
Example of the credit transfer:
"transferencia_credito": {
"valor_ibs": "2.50", // IBS amount to transfer
"valor_cbs": "4.00" // CBS amount to transfer
}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 periodFormat: YYYY-MM | |
valor_ibs | string | 13v2 | IBS amount to adjust0.00 | |
valor_cbs | string | 13v2 | CBS amount to adjust0.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
}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 reverse0.00 | |
valor_cbs | string | 13v2 | CBS amount to reverse0.00 |
Example of the credit reversal:
"estorno_credito": {
"valor_ibs": "2.50", // IBS amount to reverse
"valor_cbs": "4.00" // CBS amount to reverse
} 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.
/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 | |
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
} dfe_referenciado for each product, including for codigo_cfop: "1.202". Your integration does not need to send this group. 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.
| Parameter | NF-e | Type | Size | Description |
|---|---|---|---|---|
operacao | integer | 1 | Transaction type of the invoice0 - Incoming | |
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 adjustRequired 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 adjustRequired when valor_icms is not sent. Send a numeric value; format: 0.00. | |
ambiente | integer | 1 | SEFAZ environment 1 - Production | |
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
} 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 invoice0 - Incoming | |
natureza_operacao | string | 1-60 | Nature of the transaction | |
ambiente | integer | 1 | SEFAZ environment 1 - Production | |
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
} 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 | |
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: | |
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
} 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" }
}
} | 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 complement0.00 | |
valor_icms | string | 13v2 | Amount of the ICMS complement0.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"
} | 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 complement0.00 | |
valor_icms_st | string | 13v2 | Amount of the ICMS-ST complement0.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"
} | 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 complement0.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"
} | 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 indicator1 - Enforceable | |
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 indicator1 - Yes | |
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"
} 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"
}
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 | |
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). |
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": { ... } }
}
]
} 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.
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. |
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"
]
}
} 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 |
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"
}
}
} 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.
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. |
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"
]
}
} 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.
| 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 | |
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
} 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 | |
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) | |
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": "{...}",
} 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 | |
cod_evento | string | 6 | IBS/CBS event codeSee 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 |
| 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 |
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.
| 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
} 110300 as an authorized reference event. 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.
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.
| 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.
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.
| 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.
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.
| 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.
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).
| 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.
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.
| 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.
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.
| 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.
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).
| 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.
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).
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.
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).
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.
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).
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.
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.
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 - ProductionRequired 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 |
| 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
} 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": "{...}"
} 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.
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 |
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 fileAccess 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.
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.
The token opens the XML and the PDF without a password for 24 hours, so you can share the link with your customer safely.
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.
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"
} 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
} 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
} 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.
| 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.
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/.
| 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 | |
serie | string | 1-3 | Series of the numbers | |
modelo | string | 1 | Invoice model of the numbers 1 - NF-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
} 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 timeYYYY-MM-DD or YYYY-MM-DD HH:mm:ss. | |
data_final | string | 10 or 19 | Filter by date and timeYYYY-MM-DD or YYYY-MM-DD HH:mm:ss. | |
numero_inicio | string | 10 | Filter by numberSend the start and the end. It does not replace the dates that CSV requires. | |
numero_final | string | 10 | Filter by numberSend the start and the end. It does not replace the dates that CSV requires. | |
modelo | string | 3-6 | Document modelnfe | |
relatorio | string | 3-14 | Report to export csvSimplified/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 DANFECOM0 - No | |
status | string | 8-12 | Filter by document statusemitidas (issued)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 reportdata_emissao (issue date) | |
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
} 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:
/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.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:
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 | |
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 - PendingFor 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 NacionalRequired 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. |
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.)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:
| Situation | What Webmania does |
|---|---|
| SEFAZ received the invoice but has not returned the result yet | Keeps the invoice in processamento and checks SEFAZ automatically until it gets the result. See Invoices in processing. |
| NF-e when the state SEFAZ is unavailable | Sends 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 unavailable | Issues 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. |
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.
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:
The Webmania® API runs on Amazon AWS, the global leader in cloud computing, in the us-east-1 region (US East), with a point of presence in sa-east-1 (São Paulo). The entry point is anycast and highly available: from anywhere in the world, your request goes to the server closest to you.
The same entry IPs serve the whole world. Your request goes to the server closest to you, with no setup on your side.
us-east-1 (US East) and sa-east-1 (São Paulo). Keep your infrastructure close to one of them for a shorter response time.
Fixed IPs for inbound and outbound traffic: allow them in your firewall and check the source of the notifications you receive.
13.248.145.9076.223.17.24034.196.69.3844.219.142.86The 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.
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.
Reading: lookups and lists.
Creating: issuing and other submissions. See the specific limits below.
Changing and removing resources.
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.
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"
}
429, not by the text of the error field: the message can change from one endpoint to another.Retry-After header, or 1 second if the header is missing.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.
Spread your requests through a queue that respects the per-second limit of each method, instead of sending everything at once.
The endpoints require valid access credentials in the request header. Sending them incorrectly is treated as misuse of the API.
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.
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
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
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
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
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
The documentation is now LLM-ready: copy the page or each section as Markdown, a section index and llms.txt.