The Webmania® REST API issues the NFCom at SEFAZ, the state tax authority. It generates the XML file and the DANFECOM (the printed summary of the NFCom), sends you the result by notification, and lets you look up and cancel each invoice. To start, read the Quick guide. To issue other document types, see all the APIs.
What is the NFCom? The NFCom, model 62, is the telecom invoice: the Brazilian electronic tax document for telecommunication services:
Telecommunication service providers, such as landline and mobile telephone, broadband internet, pay TV, data communication and multimedia services. See General information.
The NFCom identifies the customer who pays for the service (the tomador) in the cliente object and the subscriber in the assinante object. The subscriber contract is required for normal billing and centralized billing (tipo_faturamento 0 and 1). It is optional for co-billing (2), when another operator bills the service.
The XML and the DANFECOM, which prints on common printers. Webmania also sends the NFCom by email.
Brazilian tax terms you will see. They keep their Brazilian names in the payload and on the NFCom:
SEFAZ: the state tax authority. It authorizes each NFCom and answers with a status code; 100 = authorized.
ICMS: the state tax on communication services, tax base × rate on each item. Group icms of impostos; its CST (tax status code) goes in situacao_tributaria.
CFOP: the 4-digit code that says what kind of transaction it is, for example 5307 = communication service inside the state. Field codigo_cfop.
PIS / COFINS: federal contributions on revenue, each with its own CST. Groups pis and cofins.
FUST / FUNTTEL: federal telecom funds. Groups fust and funttel of impostos.
IBS / CBS / cClassTrib: the new taxes of the tax reform and the code that says how they apply. Group ibs_cbs; see Tax reform.
CNPJ / CPF / IE: the company ID (14 digits), the individual taxpayer ID (11 digits) and the state registration of the customer.
Every term in plain English: glossary of Brazilian tax terms.
Send every API request over encrypted HTTPS to the URL https://api.webmania.com.br. The /2/ prefix means that you are using version 2.0 of the API.
| URL | HTTP Verb | Function |
|---|---|---|
/2/nfcom/emissao | POST | Issue an NFCom or generate a preview (finalidade 1-4) |
/2/nfcom/cancelar | PUT | Cancel an NFCom |
/2/nfcom/consulta/{identifier} | GET | Look up an NFCom by UUID or access key |
/2/nfcom/status | GET | SEFAZ service status |
/xmlnfcom/{uuid|chave} | GET | Download the XML of the issued NFCom or of the preview |
/danfecom/{uuid|chave} | GET | Download the DANFECOM |
Issuing, lookup, cancellation and status respond in JSON. The XML and DANFECOM downloads return the file itself. Send Authorization: Bearer YOUR_ACCESS_TOKEN in every call, and Content-Type: application/json in calls that have a body. See Authentication.
status field in the issuing or lookup response. If something fails, read the response body, even with HTTP 200. Errors can come in the error field, as in this authentication error with HTTP 401 ("restricted access, token missing or invalid"; API messages are in Portuguese):{
"error": "Acesso restrito. Token não informado ou inválido."
} How to integrate the NFCom:
Authorization header. classe_imposto, send the reference of a communication Tax Class registered in the panel, or send the taxes of each item in the impostos object. finalidade = 1) or a replacement NFCom, with the substituicao object. previa_danfecom = true, the API only generates a preview of the DANFECOM and does not issue the NFCom. The response returns only the danfecom URL. /2/nfcom/emissao, with ambiente = 2 (sandbox) for tests. The response returns the uuid and the status of the NFCom. Store the uuid in your system. url_notificacao in the request, Webmania notifies you when the NFCom is authorized, rejected or issued in contingency mode. xml and danfecom URLs from the response, the lookup or the notification. Every NFCom gets a uuid when the document is created, before it is sent to SEFAZ (state tax authority). From then on, it goes through the statuses below. They appear in the response, in the lookup and in the notifications:
contingencia already has its XML and DANFECOM and can be printed. Follow the same uuid with the lookup or the notification, without issuing it again.| Status | What it means | What to do |
|---|---|---|
processando | The NFCom was created and SEFAZ has not given the result yet. | Webmania checks SEFAZ automatically. Wait for the notification or look up the NFCom. Do not issue it again. |
contingencia | SEFAZ was unavailable: the NFCom was issued in offline contingency mode (tpEmis=2) and already has its XML and DANFECOM. | The NFCom can be printed. Webmania sends it again automatically: follow the same uuid and do not issue it again. See Contingency mode. |
aprovado | SEFAZ authorized the NFCom. The protocolo, the XML and the DANFECOM are available. | Download the XML and the DANFECOM. To void the NFCom, cancel it. |
reprovado | SEFAZ or the API validation rejected the NFCom. motivo gives the reason. | Fix the data shown in motivo and issue a new NFCom. |
cancelado | SEFAZ approved the cancellation. | Store the xml_cancelamento. |
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/
Test the NFCom REST API without writing a line of code, and speed up your integration with the official Webmania® tools.
To use the API, authenticate every request with an HTTP header. Use the Authorization header in this format:
Authorization: Bearer {Access-Token} You find the API 2.0 Access-Token in the Webmania® Panel. Include it in every request.
In requests with a body, send JSON with the Content-Type: application/json header. In operations that return JSON, also send Accept: application/json. GET lookups have no body.
Keep your credentials safe. Never publish the Access Token in the source code of a website, app or system where other people can easily read it.
For mobile apps (iOS and Android), we recommend issuing from your server (back end). The app code should only send the request, and your server should process the issuing.
To keep your platform up to date, Webmania® sends automatic notifications with the result of the NFCom. With them, you do not need a routine of periodic lookups: wait for the webhook and update the NFCom in your system when it arrives.
The notification is sent by POST, in JSON, to the URL you sent in url_notificacao when issuing. Without this parameter, the NFCom is not notified.
| Notified status | When it is sent |
|---|---|
aprovado | SEFAZ authorized the NFCom, when it was issued or when it was reprocessed after contingency mode. The body includes the chave, the protocolo, the xml and the danfecom. |
reprovado | SEFAZ rejected the NFCom, when it was issued or when it was reprocessed after contingency mode. The body includes the motivo. |
contingencia | The NFCom was issued in offline contingency mode. The body includes contingencia = true, the xml and the danfecom. The final result arrives in a new notification. |
cancelado | Webmania found the cancellation when it checked the NFCom at SEFAZ. A cancellation made with PUT /2/nfcom/cancelar returns the result in the response itself. |
What is the UUID? The UUID (Universally Unique Identifier) is a unique identifier of 36 characters, in the 8-4-4-4-12 format, that Webmania assigns to each NFCom.
The UUID is generated when a new tax document is created, before it is sent to SEFAZ. A request rejected before that point can return an error without a UUID. Once a document exists, its UUID identifies it whatever the tax result.
The UUID identifies the same document during reprocessing and contingency mode. A new issuing request can create another document with another UUID. The access key is a different field and can change. That is why the UUID, not the access key, should be your reference in the database.
The notification body has the same format as the issuing response:
| Parameter | Type | Description |
|---|---|---|
uuid | string | Unique identifier of the NFComUse the UUID to match the notification you receive. |
chave | string | Access key of the NFCom at SEFAZ |
serie | number | Issuing series |
nfcom | number | NFCom numberManaged automatically by the issuer. |
status | string | NFCom statusExamples: aprovado |
motivo | string | Reason for the statusMay be omitted when the NFCom is authorized and no reason is recorded. |
modelo | string | Returned modelFixed value: nfcom |
xml | string | URL of the NFCom XML |
xml_cancelamento | string or null | URL of the XML of the canceled NFComReturns null when the status is not cancelado. |
danfecom | string | URL of the DANFECOM |
log | object or array | SEFAZ response or details of the XML validationCan return an object with the available data or an empty array. |
protocolo | string | Authorization protocolIncluded when the status is aprovado and an authorization protocol is recorded. |
contingencia | boolean | Whether the NFCom is in contingency mode |
The notification is sent with the POST method, in the application/json format:
-X POST \
-H "Content-type: application/json" \ Example notification for an authorized NFCom:
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"chave": "35240712345678901234620010000001191234567890",
"serie": 1,
"nfcom": 119,
"status": "aprovado",
"motivo": "Autorizado o uso da NFCom",
"modelo": "nfcom",
"contingencia": false,
"xml": "https://api.webmaniabr.com/xmlnfcom/550e8400-e29b-41d4-a716-446655440000",
"xml_cancelamento": null,
"danfecom": "https://api.webmaniabr.com/danfecom/550e8400-e29b-41d4-a716-446655440000",
"log": [],
"protocolo": "135240000123456"
} The issue request creates the NFCom (telecom invoice), sends it to SEFAZ (state tax authority) in the same request and returns the result in the response. When SEFAZ is unavailable, the NFCom is issued in offline contingency mode. See the Lifecycle.
To issue an NFCom, send a POST request to the URL /2/nfcom/emissao.
The finalidade field (purpose of the NFCom) accepts the values 1, 2, 3 and 4:
Bills a service you provided. Send finalidade = 1: the XML is generated with finNFCom = 0.
Replaces an NFCom or references an invoice of model 21/22 (the earlier communication and telecom invoices). Send finalidade = 3 and the substituicao object, with the access key of the replaced NFCom or the referenced invoice, and the motivo (reason). See Replacement NFCom.
The XML has no adjustment type: finalidade 2, 3 or 4 generates finNFCom = 3, a replacement. To adjust an NFCom, issue a replacement with the substituicao object. See Adjustment NFCom.
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @nfcom.json \
https://api.webmania.com.br/2/nfcom/emissao Sample nfcom.json file, for illustration only. Replace the fictitious data and the tax values with the data of your transaction. The sample does not guarantee authorization by SEFAZ.
{
"ambiente": 2,
"natureza_operacao": "Prestação de serviços de telecomunicação",
"tipo_operacao": 1,
"finalidade": 1,
"municipio_fato_gerador": "3550308",
"consumidor_final": 1,
"presenca_comprador": 2,
"cliente": {
"cnpj": "12345678000199",
"razao_social": "Empresa Exemplo LTDA",
"indicador_ie": 2,
"endereco": {
"logradouro": "Rua das Flores",
"numero": "123",
"bairro": "Centro",
"codigo_municipio": "3550308",
"municipio": "São Paulo",
"uf": "SP",
"cep": "01310100"
}
},
"assinante": {
"codigo": "ASS123456",
"tipo": 3,
"tipo_servico": 4,
"contrato": {
"numero": "CONT2024001",
"data_inicio": "2024-01-01",
"data_fim": "2024-12-31"
}
},
"itens": [{
"codigo": "SERV001",
"codigo_classificacao": "400401",
"descricao": "Internet Banda Larga 100MB",
"unidade": "MES",
"quantidade": 1,
"valor_unitario": 99.90,
"valor_total": 99.90,
"indicador_total": 1,
"impostos": {
"icms": {
"origem": 0,
"situacao_tributaria": "00",
"codigo_cfop": "5307",
"valor_base_calculo": 99.90,
"aliquota_icms": 18.00,
"valor_icms": 17.98
},
"pis": {
"situacao_tributaria": "01",
"valor_base_calculo": 99.90,
"aliquota": 0.65,
"valor": 0.65
},
"cofins": {
"situacao_tributaria": "01",
"valor_base_calculo": 99.90,
"aliquota": 3.00,
"valor": 3.00
}
}
}],
"url_notificacao": "https://exemplo.com/webhook"
} Sample HTTP 200 response for an authorized NFCom. Once the document is created, the fields are the ones listed in Notification fields:
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"chave": "35240712345678901234620010000001191234567890",
"modelo": "nfcom",
"serie": 1,
"nfcom": 119,
"status": "aprovado",
"motivo": "Autorizado o uso da NFCom",
"contingencia": false,
"protocolo": "135240000123456",
"xml": "https://api.webmaniabr.com/xmlnfcom/550e8400-e29b-41d4-a716-446655440000",
"xml_cancelamento": null,
"danfecom": "https://api.webmaniabr.com/danfecom/550e8400-e29b-41d4-a716-446655440000",
"log": []
} Validation or processing errors may return other fields. With previa_danfecom = true, the response returns only the danfecom URL of the preview. When you send url_notificacao, the result is also sent by notification.
The NFCom (Nota Fiscal Fatura de Serviços de Comunicação Eletrônica) is the telecom invoice. It is an electronic tax document, model 62, that records the provision of telecommunication services.
Providers of telecommunication services must issue the NFCom, for example:
Fill in the fields according to the purpose of the NFCom. Issue parameters:
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
ID | Optional | string | Up to 100 | Purchase order number or processing IDIdentifies the order in your integration. Do not assume that sending the same ID again creates a new NFCom: duplicate control by ID depends on the company settings. Learn more (in Portuguese) |
ambiente | Required | integer | 1 | SEFAZ environment1 - Production |
natureza_operacao | Required | string | 1-60 | Nature of the transaction (a short text that describes it) |
tipo_operacao | Required | integer | 1 | Type of transaction0 - Inbound |
finalidade | Required | integer | 1 | Purpose of the NFComValues accepted by the API: 1 - Normal; 2, 3 or 4 - Mapped to replacement in the XML. |
consumidor_final | Optional | integer | 1 | Whether the customer is a final consumer0 - No |
presenca_comprador | Optional | integer | 1 | How the buyer was present1 - In person |
processo_emissao | Optional | integer | 1 | Issue process0 - Taxpayer application (default) |
origem | Optional | string | Up to 100 | Identifies where the issue request came from. It is stored with the request data |
url_notificacao | Optional | string | Up to 500 | Valid URL that receives notifications about the processing and status updates of the NFCom. A notification for every step, or an early response, is not guaranteed |
municipio_fato_gerador | Optional | string | 7 | IBGE code of the city where the taxable event takes placeDefault: the city code of the customer when not sent |
indicador_pre_pago | Optional | integer | 1 | Whether the service is prepaid1 - Prepaid service |
indicador_cessao_meios_rede | Optional | integer | 1 | Whether network resources are assigned to another provider1 - Network resource assignment |
indicador_nota_entrada | Optional | integer | 1 | Whether it is an inbound invoice1 - Inbound invoice |
tipo_faturamento | Optional | integer | 1 | Billing type0 - Normal billing (default) |
previa_danfecom | Optional | boolean | - - - | Generate only a preview of the DANFECOM (printed NFCom summary), without issuingtrue - Generates only a preview |
assinante | Required as described in the note | object | - - - | Information about the subscriber of the service (the contract is required when tipo_faturamento = 0 or 1) |
cliente | Required | object | - - - | Data of the customer (the tomador) |
itens | Required | array | 1-990 items | Array with the services provided |
fatura | Optional | object | - - - | Billing and collection data |
autorizar_download | Optional | array | - - - | CPF (11-digit individual taxpayer ID) or CNPJ (14-digit company ID) numbers allowed to download the XMLArray with up to 10 CPFs/CNPJs |
informacoes_complementares | Optional | string | Up to 5000 | Additional information of interest to the taxpayer |
emitente.inscricao_suframa | Optional | string | 8-9 | Registration of the issuer with SUFRAMA (the agency of the Manaus Free Trade Zone)Send it when the issuer is registered in a tax incentive area. Accepts the formatted value (1.2.3.456789) or digits only. |
data_emissao | Optional | string | - - - | Date and time the document is issuedAccepted formats: YYYY-MM-DD, YYYY-MM-DDTHH:MM:SS±HH:MM or YYYY-MM-DD HH:MM:SS. When omitted, the API uses the processing date and time. The date must be between 120 hours before processing, minus the safety margin (10 minutes by default), and 5 minutes after processing (clock tolerance). |
The NFCom supports indicators that are specific to the telecommunications sector. The details of each one are in Special indicators:
| Indicator | Field | When to use |
|---|---|---|
| Prepaid | indicador_pre_pago = 1 | Prepaid service (depends on the classification code). |
| Network resource assignment | indicador_cessao_meios_rede = 1 | Sharing of network infrastructure. |
| Inbound invoice | indicador_nota_entrada = 1 | Inbound invoice, when it applies. |
Send the information about the subscriber of the service in the assinante object.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo | Optional | string | 1-60 | Subscriber codeUnique ID of the subscriber in the provider's system (if missing, the CPF/CNPJ of the customer is used) |
tipo | Optional | integer | 1-2 | Subscriber type1 - Commercial |
tipo_servico | Optional | integer | 1 | How the service is used1 - Telephony |
contrato | Required for normal or centralized billing | object | - - - | Contract dataRequired when tipo_faturamento = 0 or 1 |
terminal_principal | Optional | object | - - - | Data of the main terminal of the contracted serviceUsed to calculate IBS and CBS, to define the destination of the tax |
When tipo_faturamento is 0 (Normal) or 1 (Centralized), you must send the contract data in the assinante.contrato object:
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
numero | Required for normal or centralized billing | string | 1-60 | Contract numberRequired for tipo_faturamento 0 or 1. Example: 12345/2025 |
data_inicio | Required for normal or centralized billing | string | 10 | Contract start dateRequired for tipo_faturamento 0 or 1. Format: YYYY-MM-DD |
data_fim | Required for normal or centralized billing | string | 10 | Contract end dateRequired for tipo_faturamento 0 or 1. Format: YYYY-MM-DD; equal to or later than data_inicio |
Sample excerpt of a subscriber with a contract, for illustration only. Add the other required fields of the issue request; this excerpt is not a complete request:
{
"tipo_faturamento": 0,
"assinante": {
"codigo": "ASS123456",
"tipo": 3,
"tipo_servico": 4,
"contrato": {
"numero": "12345/2025",
"data_inicio": "2025-01-01",
"data_fim": "2025-12-31"
}
}
} assinante.contrato object and its three fields are required when tipo_faturamento = 0 (Normal) or 1 (Centralized). This also applies when tipo_faturamento is omitted (default 0). For co-billing (tipo_faturamento = 2), the contract is optional. If you send it, its fields are validated and the data you send goes into the XML. Send the main terminal of the contracted service in the optional assinante.terminal_principal object. The city of the terminal is used to calculate IBS and CBS, to define the destination of the tax. For corporate, family or similar phone plans, send the number of the main phone line of the plan.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
numero | Required | string | 7-12 | Number of the main terminalDigits only, from 7 to 12 digits. Example: 48987654321 |
uf | Required | string | 2 | State where the terminal is activatedState abbreviation. Must be the same state as the issuer. Example: SC |
codigo_municipio | Optional | string | 7 | IBGE code of the city of the terminalThe city must exist and belong to the state you send. Example: 4205407 |
Main terminal example:
{
...
"assinante": {
"codigo": "ASS123456",
"tipo": 3,
"tipo_servico": 1,
"terminal_principal": {
"numero": "48987654321",
"uf": "SC",
"codigo_municipio": "4205407"
}
},
...
} Send the data of the customer (the tomador) in the cliente object, following the rules below.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
cnpj | Required for a company | string | 14 | CNPJ (company ID) |
cpf | Required for an individual | string | 11 | CPF number (individual taxpayer ID) |
razao_social | Required when you send a CNPJ | string | 2-60 | Legal company name (company)Do not use it with a CPF: in that case, use nome_completo. |
nome_completo | Required when you send a CPF | string | 2-60 | Full name (individual)Do not use it with a CNPJ: in that case, use razao_social. |
indicador_ie | Required for a CNPJ | integer | 1 | IE (Inscrição Estadual, state registration) indicator1 - ICMS taxpayer |
inscricao_estadual | Required when indicador_ie = 1 | string | 2-14 | IE number: the state registration of a company that pays ICMSRequired for an ICMS taxpayer (indicador_ie = 1). It goes into the XML only in that case. |
inscricao_municipal | Optional | string | 1-15 | IM (Inscrição Municipal, city registration) number |
email | Optional | string/array | - - - | Email addressCan be a string or an array of strings for several email addresses |
endereco | Required | object | - - - | Address of the customer |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
logradouro | Required | string | 2-60 | Street of the address |
numero | Required | string | 1-60 | Street number |
complemento | Optional | string | 1-60 | Address line 2 (suite, apartment, etc.) |
bairro | Required | string | 2-60 | Neighborhood |
codigo_municipio | Required | string | 7 | IBGE city codeSend 9999999 for transactions with a foreign country. |
municipio | Required | string | 2-60 | City nameSend 'EXTERIOR' for transactions with a foreign country. |
uf | Required | string | 2 | State abbreviationSend 'EX' for transactions with a foreign country. |
cep | Required | string | 8 | Postal code (CEP) of the addressRequired (use 00000000 for a foreign address when it applies) |
pais | Optional | string | 2-60 | Country nameDefault: Brasil |
codigo_pais | Optional | string | 4 | Country code (BACEN, the Brazilian Central Bank table), digits onlyDefault: 1058 (Brazil) |
telefone | Optional | string | 6-14 | Phone number, digits onlyThe input accepts 6 to 14 digits. The phone goes into the XML only if it ends up with 10 or 11 digits (area code + number). The country code 55 is removed first when an input has more than 11 digits. |
Sample cliente object with fictitious data, for illustration only. Combine this JSON excerpt with the other required fields of the issue request:
{
"cliente": {
"cpf": "12345678909",
"nome_completo": "João da Silva",
"indicador_ie": 9,
"email": ["joao@email.com", "joao.silva@email.com"],
"endereco": {
"logradouro": "Avenida Paulista",
"numero": "1000",
"complemento": "Apto 501",
"bairro": "Bela Vista",
"codigo_municipio": "3550308",
"municipio": "São Paulo",
"uf": "SP",
"cep": "01310100",
"telefone": "1133334444"
}
}
} Send the services provided and the related goods or products in the itens array. Each element is one service or product.
The net value of each item and the net total of the invoice are generated automatically in the XML. They are calculated from the total value and the quantity you send. This applies in the sandbox and, in production, to invoices issued from December 14, 2026. You do not need to send any parameter for this. The net values are not generated for the whole invoice when any item has indicador_total equal to 0, is a return item or uses a deduction classification code (starting with 5).
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo | Optional | string | 1-60 | Item/service code |
codigo_classificacao | Required as described in the note | string | 6-7 | Classification code of the itemRequired here, or in impostos.codigo_classificacao, or through classe_imposto |
descricao | Required | string | 1-120 | Item/service description |
unidade | Required | string | 1-6 | Unit of measureAccepts values such as MIN, MB, GB, UN, MES. They are converted to the code the NFCom requires |
quantidade | Required | number | 0.0001 to 99999999999.9999 | Item quantityNumeric value within the range shown. When the XML is generated, the quantity is formatted with 4 decimal places. |
valor_unitario | Required | number | 0 to 99999999999.99 | Unit value of the item |
valor_total | Required | number | 0 to 99999999999.99 | Total value of the item |
indicador_total | Required | integer | 1 | Whether the item counts in the NFCom total0 - Does not count in the total |
valor_desconto | Optional | decimal | 15v2 | Discount value |
outras_despesas | Optional | decimal | 15v2 | Other ancillary expenses |
classe_imposto | Optional | string | - - - | Automatic tax setup: send the reference of the Tax Class registered in the Webmania® PanelFormat: REF followed by one or more digits (e.g. REF000000000). Use the reference of a communication class registered for the company. |
impostos | Required as described in the note | object | - - - | Taxes set in the API, for specific transactions such as FUNTTEL and FUST (federal telecom funds), or when you need more flexibilityRequired when you do not use a classe_imposto. In that case, send at least one of the icms, pis or cofins groups. Sending only fust and/or funttel does not pass validation. |
cnpj_cobranca_terceiro | Required as described in the note | string | 14 | CNPJ of the third party that bills the itemWhen NT 2026.002 is in force for the issue date, it is required for items with an explicit classification code of group 110 - Third-party billing. Before that date, the field is not included in the XML. |
Sample item/service, for illustration only. Combine this JSON excerpt with the other required fields of the issue request. The tax values are not tax advice:
{
"itens": [
{
"codigo": "SERV001",
"codigo_classificacao": "400401",
"descricao": "Internet Banda Larga 100MB",
"unidade": "MES",
"quantidade": 1,
"valor_unitario": 99.90,
"valor_total": 99.90,
"indicador_total": 1,
"impostos": {
"icms": {
"origem": 0,
"situacao_tributaria": "00",
"codigo_cfop": "5307",
"valor_base_calculo": 99.90,
"aliquota_icms": 18.00,
"valor_icms": 17.98
},
"pis": {
"situacao_tributaria": "01",
"valor_base_calculo": 99.90,
"aliquota": 0.65,
"valor": 0.65
},
"cofins": {
"situacao_tributaria": "01",
"valor_base_calculo": 99.90,
"aliquota": 3.00,
"valor": 3.00
}
}
}
]
} There are two ways to set the taxes of the NFCom: with a Tax Class or directly in the API.
The Tax Class groups the tax settings of the classification code, ICMS, PIS, COFINS, FUST and FUNTTEL, so the taxes are calculated automatically. You set it up once, and it speeds up every later issue.
In classe_imposto, send the reference of a communication class registered for the company, in the format REF followed by digits. The reference does not replace the other required fields of the item, such as valor_total and indicador_total. Sample JSON excerpt, for illustration only. Replace the references with your registered classes before you integrate:
{
"itens": [
{
"descricao": "Plano Internet Fibra 200MB",
"unidade": "GB",
"quantidade": 1,
"valor_unitario": 99.90,
"valor_total": 99.90,
"indicador_total": 1,
"classe_imposto": "REF000000000"
},
{
"descricao": "Modem hwauei fibra",
"unidade": "un",
"quantidade": 1,
"valor_unitario": 280.50,
"valor_total": 280.50,
"indicador_total": 1,
"classe_imposto": "REF000000000"
}
]
} To register a communication Tax Class, see Create a communication Tax Class. After you register it, the reference of the class appears in the Webmania® Panel, under the Impostos (Taxes) button.
Send the tax information in the impostos object of each item. Without classe_imposto, send this object with at least one of the icms, pis or cofins groups. The NFCom supports these taxes: ICMS, the state tax on communication services, calculated on each item as tax base × rate; PIS and COFINS, federal contributions on revenue (the CBS replaces them from 2027); and FUST and FUNTTEL (federal telecom funds).
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
codigo_classificacao | Required as described in the note | string | 6-7 | Classification code of the itemRequired here or in the item when you do not use classe_imposto. See the classification table. |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
origem | Required | integer | 1 | Origem (origin) of the goods: 0 = national; the other values identify imported goods or imported content0 - Domestic |
situacao_tributaria | Required when the icms group is sent | string | 2 | CST (tax status code) of ICMS: tells the tax authority how ICMS applies to the item (taxed, exempt, deferred, tax substitution…)00, 10, 20, 30, 40, 41, 45, 50, 51, 60, 70 or 90 |
codigo_cfop | Optional | string | 4 | CFOP, the 4-digit code that says what kind of transaction it is. The first digit gives the place: 5 = inside the state, 6 = to another stateExamples: |
valor_base_calculo | Optional | decimal | 11v2 | Tax base valueFrom 0 to 99999999999.99. |
aliquota_icms | Optional | decimal | 0-40 | ICMS rateWhen you fill in the taxes manually, the rate must be between 0% and 40%. |
valor_icms | Optional | decimal | 11v2 | ICMS valueFrom 0 to 99999999999.99. |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
icms_previsto | Required as described in the note | decimal | 13v2 | Value of the ICMS that will apply to the future supply, for invoices billed before the service is provided.Send it only in an invoice with tipo_pagamento_antecipado equal to 1 or 2, or in a government purchase with |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
situacao_tributaria | Required when the matching pis or cofins group is sent | string | 2 | CST (tax status code) of PIS or COFINS01, 02, 03, 04, 05, 06, 07, 08, 09, 49, 50, 51, 52, 53, 54, 55, 56, 60, 61, 62, 63, 64, 65, 66, 67, 70, 71, 72, 73, 74, 75, 98 or 99 |
valor_base_calculo | Optional | decimal | 11v2 | Tax base valueFrom 0 to 99999999999.99. When you fill in the taxes manually and omit it, the API uses the item total for codes 01 and 02, and zero for the others. |
aliquota | Optional | decimal | 0-100 | Tax rateWhen you fill in the taxes manually, the limit is 2.1% for PIS and 9.65% for COFINS. |
valor | Optional | decimal | 11v2 | Calculated tax valueFrom 0 to 99999999999.99. When you fill in the taxes manually, the value is recalculated from the base and the rate. |
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
valor_base_calculo | Optional | decimal | 11v2 | Tax base valueFrom 0 to 99999999999.99. |
aliquota | Optional | decimal | 0-100 | RateFrom 0% to 100% in input validation. When you fill in the taxes manually and omit it, the default is 1.0% for FUST and 0.5% for FUNTTEL. |
valor | Optional | decimal | 11v2 | Tax valueFrom 0 to 99999999999.99. |
Sample impostos object of one item, for illustration only; it is not a complete request. The values are not tax advice: fill in the other required fields and use the taxes that apply to your transaction.
{
"impostos": {
"codigo_classificacao": "400401",
"icms": {
"origem": 0,
"situacao_tributaria": "00",
"codigo_cfop": "5307",
"valor_base_calculo": 99.90,
"aliquota_icms": 18.00,
"valor_icms": 17.98
},
"pis": {
"situacao_tributaria": "01",
"valor_base_calculo": 99.90,
"aliquota": 0.65,
"valor": 0.65
},
"cofins": {
"situacao_tributaria": "01",
"valor_base_calculo": 99.90,
"aliquota": 3.00,
"valor": 3.00
},
"fust": {
"valor_base_calculo": 99.90,
"aliquota": 1.0,
"valor": 1.00
},
"funttel": {
"valor_base_calculo": 99.90,
"aliquota": 0.5,
"valor": 0.50
}
}
} Prepayment lets you issue an NFCom to bill a service before it is provided. Later, you issue the NFCom for the supply that uses that prepayment. The prepayment invoice states the prepayment type in tipo_pagamento_antecipado. The matching supply invoice references, item by item, the NFCom that already billed for it.
Normal invoices do not send any of these fields: leaving them out is the default behavior. These fields become available with the rollout of the tax reform, in force in all environments from August 31, 2026.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
tipo_pagamento_antecipado | Optional | integer | 1 | Role of the invoice in the prepayment1 - Prepayment of a non-continuous service |
itens[].pagamento_antecipado | Optional | object | - - - | Links the item to the prepayment NFCom that already billed for itSend it only when tipo_pagamento_antecipado is 3. |
itens[].pagamento_antecipado.chave | Required as described in the note | string | 44 | Access key of the prepayment NFComRequired when the pagamento_antecipado object has data. Format: 6 digits, 12 alphanumeric characters and 26 digits. The base CNPJ (company root) must match the issuer's. |
itens[].pagamento_antecipado.numero_item | Optional | integer | 1-990 | Item number in the prepayment NFComDo not send it when that invoice has a single item. |
itens[].pagamento_antecipado.tipo_referenciado | Optional | integer | 1 | Optional statement of the prepayment type of the referenced invoice1 - Non-continuous service |
Rules:
tipo_pagamento_antecipado = 1, every item of the invoice must have a classification code of a non-continuous service.tipo_pagamento_antecipado = 2, every item of the invoice must have a classification code of a continuous service.tipo_pagamento_antecipado = 3, at least one item must include pagamento_antecipado.pagamento_antecipado is accepted only when tipo_pagamento_antecipado = 3.pagamento_antecipado must have the same base CNPJ as the issuer of the supply invoice.Sample excerpt of a supply invoice whose payment was made in advance on an earlier invoice, for illustration only. It is not a complete request: add the other required fields of the invoice and of the item, and replace the key of zeros with the real access key of the prepayment NFCom, with the same base CNPJ as the issuer.
{
"tipo_pagamento_antecipado": 3,
"itens": [
{
"descricao": "Serviço medido",
"codigo_classificacao": "300101",
"pagamento_antecipado": {
"chave": "00000000000000000000000000000000000000000000",
"numero_item": 1
}
}
]
} Send the billing and collection information in the fatura object (the bill). With indicador_cessao_meios_rede = 1, the bill group is not generated in the XML.
fatura object, every field of the group is required, except numero_debito_automatico. That field is optional (1 to 60 characters when sent) and you send it only when the bill is paid by automatic debit. | Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
competencia_fatura | Required when fatura is sent | string | 6 | Reference month of the billFormat: YYYYMM, with year 20XX and month 01 to 12 (you can send MMYYYY, which is normalized) |
data_vencimento | Required when fatura is sent | string | 10 | Due dateFormat: YYYY-MM-DD (>= today) |
data_periodo_inicial | Required when fatura is sent | string | 10 | Start date of the billing periodFormat: YYYY-MM-DD |
data_periodo_final | Required when fatura is sent | string | 10 | End date of the billing periodFormat: YYYY-MM-DD (>= start date) |
codigo_barras_fatura | Required when fatura is sent | string | 1-60 | Barcode of the billText of 1 to 60 characters in input validation. |
numero_debito_automatico | Optional | string | 1-60 | Automatic debit numberText of 1 to 60 characters in input validation. |
The current NFCom v1.00 layout does not use the bill periods group in this API. Use only the fields listed in the fatura object above.
Sample billing excerpt, for illustration only; it is not a complete request. Adjust the reference month, the periods and the due date to the real bill. The due date cannot be earlier than the date you send the request.
{
"fatura": {
"competencia_fatura": "202610",
"data_vencimento": "2026-11-10",
"data_periodo_inicial": "2026-10-01",
"data_periodo_final": "2026-10-31",
"codigo_barras_fatura": "34191234567890123456789012345678901234567890",
"numero_debito_automatico": "DEB123456"
}
} Optional groups of the issuing request: send only the ones that apply to the transaction.
You can authorize specific CPFs (individual taxpayer IDs) or CNPJs (company IDs) to download the NFCom XML directly from SEFAZ. This is useful for accountants, business partners or integrated systems.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
autorizar_download | Optional | array | Max. 10 | Array of strings with the authorized CPFs or CNPJsThe system detects automatically whether it is a CPF (11 digits) or a CNPJ (14 characters) |
Example:
{
...
"autorizar_download": [
"12345678909", // Fictitious CPF
"12345678000195", // Fictitious CNPJ
"98765432100" // CPF
],
...
} The NFCom lets you send indicators specific to the telecommunications sector. They affect the taxes and the characteristics of the service.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
indicador_pre_pago | Optional | integer | 1 | Whether the service is prepaid1 - Prepaid service |
indicador_cessao_meios_rede | Optional | integer | 1 | Whether it is a network resource assignment1 - The bill group (gFat) is not generated |
indicador_nota_entrada | Optional | integer | 1 | Whether it is an inbound invoice1 - Inbound invoice |
Example with indicators:
{
...
"indicador_pre_pago": 1,
...
} 1 when sent. Leave out the indicators that do not apply; do not send 0. When an indicator is not sent, its tag is not included in the XML. Use the substituicao object to replace an NFCom or to reference a model 21/22 document (the earlier communication and telecommunication invoices). Send the access key of the replaced NFCom or the data of the referenced invoice, plus the reason. When you send nf_referenciada, its fields cnpj, modelo, serie, numero and competencia are required, even if you also send the access key.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
substituicao.chave_nfcom_substituida | Required depending on the note | string | 44 | Access key of the replaced NFComRequired when nf_referenciada is not sent |
substituicao.motivo | Required | string | 2 | Reason for the replacement01 - Price error |
substituicao.nf_referenciada.cnpj | Required depending on the note | string | 14 | CNPJ of the issuer of the referenced invoiceRequired when nf_referenciada is sent |
substituicao.nf_referenciada.modelo | Required depending on the note | string | 2 | Model of the referenced invoice21 or 22 |
substituicao.nf_referenciada.serie | Required depending on the note | string | 3 | Series of the referenced invoice |
substituicao.nf_referenciada.numero | Required depending on the note | integer | 1-9 | Number of the referenced invoice |
substituicao.nf_referenciada.competencia | Required depending on the note | string | 6 | Billing period of the referenced invoiceFormat: YYYYMM (year and month) |
substituicao.nf_referenciada.hash115 | Optional | string | - - - | Hash of ICMS Agreement 115 (optional) |
Example:
{
...
"finalidade": 3,
"substituicao": {
"chave_nfcom_substituida": "35240112345678901234620010000001231234567890",
"motivo": "04"
}
} Co-billing information. Use it when another operator does the billing under a co-billing arrangement. When you send the cofaturamento object, fill in chave_nfcom_local or nf_referenciada. When you send nf_referenciada, its fields cnpj, modelo, serie, numero and competencia are required; hash115 is optional.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
cofaturamento.chave_nfcom_local | Required depending on the note | string | 44 | Access key of the NFCom issued by the local operator |
cofaturamento.nf_referenciada.cnpj | Required depending on the note | string | 14 | CNPJ of the referenced invoice (model 21/22) |
cofaturamento.nf_referenciada.modelo | Required depending on the note | string | 2 | Model of the referenced invoice |
cofaturamento.nf_referenciada.serie | Required depending on the note | string | 3 | Series of the referenced invoice |
cofaturamento.nf_referenciada.numero | Required depending on the note | integer | 1-9 | Number of the referenced invoice |
cofaturamento.nf_referenciada.competencia | Required depending on the note | string | 6 | Billing period of the referenced invoice |
cofaturamento.nf_referenciada.hash115 | Optional | string | - - - | Hash of ICMS Agreement 115 (optional) |
Example:
{
...
"cofaturamento": {
"chave_nfcom_local": "35240712345678901234620010000001191234567890"
},
...
} For inbound invoices, use indicador_nota_entrada = 1, described in Special indicators. The NFCom API has no separate nota_entrada group.
The replacement NFCom replaces an NFCom or references a model 21/22 invoice. The substituicao object accepts the access key of the replaced NFCom or the data of the model 21/22 invoice, plus the reason.
To issue a replacement NFCom, send a POST request to the URL /2/nfcom/emissao, with finalidade = 3 and the substituicao object filled in.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
substituicao | Optional | object | - - - | Optional object in the API validation; send it to include the replacement reference in the XML |
substituicao.chave_nfcom_substituida | Required depending on the note | string | 44 | Access key of the NFCom to be replacedRequired when there is no referenced invoice |
substituicao.motivo | Required | string | 2 | Reason for the replacement01 - Price error |
substituicao.nf_referenciada | Required depending on the note | object | - - - | Data of the model 21/22 invoice: cnpj, modelo, serie, numero, competencia and hash115 (optional)Required when chave_nfcom_substituida is not sent; the first five fields are required when this object is sent |
Partial example of a replacement NFCom, with fictitious data. Fill in the other required issuing fields and use the real access key of the referenced document. This example does not prove authorization by SEFAZ.
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ambiente": 2,
"finalidade": 3,
"tipo_operacao": 1,
"cliente": {
"cnpj": "12345678000195",
"razao_social": "Empresa Exemplo LTDA",
"indicador_ie": 2,
"endereco": {
"logradouro": "Rua Exemplo",
"numero": "123",
"bairro": "Centro",
"codigo_municipio": "3550308",
"municipio": "São Paulo",
"uf": "SP",
"cep": "01310100"
}
},
"assinante": {
"tipo": 1,
"tipo_servico": 4,
"contrato": {
"numero": "CONTRATO-EXEMPLO",
"data_inicio": "2026-01-01",
"data_fim": "2026-12-31"
}
},
"substituicao": {
"chave_nfcom_substituida": "35240112345678901234620010000001231234567890",
"motivo": "04"
},
"itens": [
{
"descricao": "Internet Banda Larga 100MB - Correção Tributária",
"codigo_classificacao": "400401",
"unidade": "MES",
"quantidade": 1,
"valor_unitario": 99.90,
"valor_total": 99.90,
"indicador_total": 1,
"impostos": {
"icms": {
"situacao_tributaria": "40",
"codigo_cfop": "5307"
}
}
}
]
}' \
https://api.webmania.com.br/2/nfcom/emissao The finalidade field accepts the values 1, 2, 3 or 4. In the XML, the value 1 produces finNFCom = 0; the values 2, 3 and 4 produce finNFCom = 3 (replacement). The XML has no separate adjustment or supplementary type: an NFCom adjustment is issued as a replacement.
To issue an adjustment NFCom, send a POST request to the URL /2/nfcom/emissao, with the finalidade and the substituicao object.
substituicao object described in the previous section. The example below shows request fields and does not prove authorization by SEFAZ; the tax values are for illustration only. Partial example of a request with finalidade = 3, with fictitious data. Fill in the other required issuing fields and use the real access key of the referenced document.
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ambiente": 2,
"finalidade": 3,
"tipo_operacao": 1,
"cliente": {
"cpf": "12345678909",
"nome_completo": "João da Silva",
"indicador_ie": 9,
"endereco": {
"logradouro": "Av. Principal",
"numero": "500",
"bairro": "Jardim",
"codigo_municipio": "3550308",
"municipio": "São Paulo",
"uf": "SP",
"cep": "04567890"
}
},
"assinante": {
"tipo": 3,
"tipo_servico": 1,
"contrato": {
"numero": "CONTRATO-EXEMPLO",
"data_inicio": "2026-01-01",
"data_fim": "2026-12-31"
}
},
"substituicao": {
"chave_nfcom_substituida": "35240112345678901234620010000001231234567890",
"motivo": "04"
},
"itens": [
{
"descricao": "Ajuste de Cobrança - Telefonia Móvel",
"codigo_classificacao": "300101",
"unidade": "MIN",
"quantidade": 100,
"valor_unitario": 0.50,
"valor_total": 50.00,
"indicador_total": 1,
"impostos": {
"icms": {
"situacao_tributaria": "00",
"codigo_cfop": "5307",
"valor_base_calculo": 50.00,
"aliquota_icms": 18,
"valor_icms": 9.00
}
}
}
]
}' \
https://api.webmania.com.br/2/nfcom/emissao Send the codigo_classificacao (service classification code) of each item, in itens[] or in impostos.codigo_classificacao, exactly as shown in the tables below. Codes have 6 or 7 digits; do not add leading zeros. For example, send 100101 for a subscription to telephone services. When it generates the XML, the API pads the code to 7 digits (0100101 in this example).
The classification code sets the validations applied when the NFCom is authorized. It also sets how the item value counts in the invoice total: codes that start with the digit 5 are deducted from the invoice total, and the others, which start with zero in the XML, are added to the total.
Each group shows four characteristics, with a Yes or No icon: Deducted (deducted value), Prepaid, Central billing (centralized billing) and COFAT (co-billing).
| Code | Description |
|---|---|
100101 | Subscription to telephone services |
100201 | Subscription to data communication services |
100301 | Subscription to pay TV services |
100401 | Subscription to multimedia communication services |
| Code | Description |
|---|---|
200101 | Activation of telephone services |
200201 | Activation of data communication services |
200301 | Activation of pay TV |
| Code | Description |
|---|---|
300101 | Metered service - Local calls |
300102 | Metered service - National long-distance calls |
300103 | Metered service - International long-distance calls |
300104 | Metered service - Calls made while roaming |
300105 | Metered service - Calls received while roaming |
300106 | Metered service - Call surcharge |
300107 | Metered service - Special numbers (0300/0500/0600/0800/etc.) |
300108 | Metered service - SMS message |
300109 | Metered service - MMS message |
300201 | Metered service - Data communication |
300301 | Metered service - Pay-per-view (TV programming) |
300401 | Metered service - Multimedia communication |
| Code | Description |
|---|---|
400101 | Unmetered service - Telephone |
400201 | Unmetered service - Data communication |
400301 | Unmetered service - Pay TV |
400401 | Unmetered service - Internet access |
400501 | Unmetered service - Multimedia communication |
| Code | Description |
|---|---|
450101 | Bundled services (data, voice, messages and others) |
| Code | Description |
|---|---|
500101 | Phone card - Landline telephone |
500102 | Credit load / top-up - Landline telephone |
500201 | Credit load / top-up - Mobile telephone |
500301 | Credit load / top-up - Multimedia communication service |
500401 | Credit load / top-up - Pay TV |
500501 | Credit top-up - Advance |
500601 | Prepaid pass-through |
| Code | Description |
|---|---|
600101 | Additional features (caller ID, voicemail, do not disturb, etc.) |
600201 | Video and audio streaming |
600301 | Tracking service |
600401 | Placement of advertising in any medium |
0600401 | Placement of advertising in any medium (alternative format accepted by the API, equivalent to 600401) |
600501 | Other services (number change, device exchange, installation, software, technical visit, etc.) |
600601 | Other value-added services |
| Code | Description |
|---|---|
700101 | Interconnection |
700201 | Roaming |
700301 | Industrial use of a dedicated line (EILD) |
700401 | ICMS entry proportional to exempt, non-taxed or reduced-base outputs (§ 1, third clause, ICMS Agreement 17/2013) |
700501 | ICMS entry proportional to network resource assignments for own consumption (§ 1, third clause, ICMS Agreement 17/2013) |
700601 | Supplementary ICMS entry, as the party liable for the tax |
| Code | Description |
|---|---|
800101 | Telephone set |
800201 | Caller ID device |
800301 | Modem |
800401 | Rack |
800501 | Room/premises |
800601 | Router |
800701 | Server |
800801 | Multiplexer |
800901 | Decoder/converter |
801001 | Other equipment |
| Code | Description |
|---|---|
1000101 | Insurance charges |
1000201 | Installment charges |
1000301 | Late payment interest |
1000401 | Late payment fine |
1000402 | Fine for breach of contract (loyalty period) |
1000501 | Charges for bills of previous months |
1000601 | Inflation adjustment |
1000701 | Fees |
| Code | Description |
|---|---|
5900101 | Deduction for disputed services |
5900201 | Deduction for bill adjustment |
5900301 | Deduction for the fine for service interruption |
5900401 | Deduction for duplicate payment |
5900501 | Other deductions |
| Code | Description |
|---|---|
1200101 | Item entered in another NFCom - Centralized billing |
| Code | Description |
|---|---|
1300101 | Item entered in another NFCom - Co-billing |
From 2026, the new taxes of the Brazilian tax reform start to apply gradually. The Webmania® API already accepts the IBS and CBS data of the NFCom, described in the subsections below.
Complementary Law 214/2025 created three new taxes that will gradually replace the current taxes:
State and city goods and services tax (Imposto sobre Bens e Serviços), a value-added tax shared by states and cities. Replaces ICMS and ISS gradually. Glossary
Federal goods and services tax (Contribuição sobre Bens e Serviços), the new federal value-added tax. Replaces PIS and COFINS. Glossary
Selective tax (Imposto Seletivo), on goods harmful to health or the environment, such as tobacco and alcoholic drinks. It starts in 2027. Glossary
The move to the new taxes happens gradually until 2033. Simplified schedule of the rates:
| Year | IBS | CBS | Current taxes |
|---|---|---|---|
| 2026 | 0.1% state | 0.90% | No changes |
| 2027 | 0.05% state and 0.05% municipal | 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 send the IBS and the CBS, use the ibs_cbs object. You can send it at document level, in impostos.ibs_cbs, and/or in each item, in itens[].impostos.ibs_cbs. Attention: when the item uses classe_imposto, the ibs_cbs sent in that item is discarded, because the Tax Class defines the taxes of the item. In that case, send the group at document level; otherwise the issuing request is rejected because the IBS/CBS data is missing. The table below lists the parameters of the group:
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
impostos.ibs_cbs.situacao_tributaria | Required depending on the note | string | 3 | CST (tax status code) of IBS/CBS. Together with the cClassTrib, it says how IBS and CBS apply See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese. Required when the related ibs_cbs group is sent. Send a string with exactly 3 characters and a code valid for NFCom. |
impostos.ibs_cbs.classificacao_tributaria | Required depending on the note | string | 6 | cClassTrib (tax classification code) of IBS/CBS: standard rate, reduced rate, exemption and so on See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese. Required when the related ibs_cbs group is sent. Send a string with exactly 6 characters and a classification valid for the CST and for NFCom. |
impostos.ibs_cbs.indicador_doacao | Optional | boolean | 1 | Whether the transaction is a donationSend a JSON boolean true/false or 1/0. |
impostos.ibs_cbs.situacao_tributaria_regular | Required depending on the note | string | 3 | CST (tax status code) under the regular regime See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese. Required when the combination of CST and cClassTrib requires regular taxation. Send a string with exactly 3 characters; later normalization does not waive this length in the validation. |
impostos.ibs_cbs.classificacao_tributaria_regular | Required depending on the note | string | 6 | cClassTrib (tax classification code) under the regular regime See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese. Required when situacao_tributaria_regular is sent or when the combination of CST and cClassTrib requires regular taxation. Send a string with exactly 6 characters. |
impostos.ibs_cbs.ibs_estadual | Required depending on the note | object | - - - | State share of the IBSRequired with aliquota_diferimento when the CST enables deferral; optional in all other cases. |
impostos.ibs_cbs.ibs_municipal | Required depending on the note | object | - - - | Municipal share of the IBSRequired with aliquota_diferimento when the CST enables deferral; optional in all other cases. |
impostos.ibs_cbs.cbs | Required depending on the note | object | - - - | Federal goods and services tax (CBS)Required with aliquota_diferimento when the CST enables deferral; optional in all other cases. |
impostos.ibs_cbs.estorno_credito | Optional | object | - - - | IBS/CBS credit reversal |
You can also send all the parameters above per item, in itens[].impostos.ibs_cbs, except when the item uses classe_imposto, which discards the item group. When the item has its own ibs_cbs, that object fully replaces the document group; the fields of the two levels are not merged.
Partial example of IBS/CBS at document level and at item level. It is not a complete issuing request:
{
"impostos": {
"ibs_cbs": {
"situacao_tributaria": "000",
"classificacao_tributaria": "000001"
}
},
"itens": [
{
"descricao": "Serviço de comunicação",
"impostos": {
"ibs_cbs": {
"situacao_tributaria": "000",
"classificacao_tributaria": "000001"
}
}
}
]
} In one sentence: in the NFCom of companies under the Simples Nacional (small business regime: several taxes in one monthly payment), and of companies in the standard regime (outside Simples Nacional) with a pending request to join the Simples Nacional, the invoice now states the company's IBS/CBS regime and, in each item, the IBS/CBS calculated at the Simples Nacional rates.
| When it applies | Sandbox | Production |
|---|---|---|
| New fields, regime rules and Simples Nacional calculation | Since October 26, 2026 | Invoices with an issue date from December 14, 2026 (Brasília time) |
| Zero CBS for companies above the revenue sublimit without the regular regime | Invoices with an issue date from January 1, 2027 | |
| If your company is… | What to do |
|---|---|
| Simples Nacional, above the revenue sublimit or not | Send ibs_cbs in the document or in the items and, if you want, the Simples Nacional rates. If the company chose the regular IBS/CBS regime, mark this option in the company settings. |
| Standard regime, with a pending request to join the Simples Nacional | In the company settings, mark the pending option and choose the intended regime. Without an intended regime and without the regular regime, the issuing request is rejected. |
| Standard regime, with no pending request | Nothing changes. |
| MEI (individual micro-entrepreneur) | Nothing changes: the IBS/CBS works as before, without the Simples calculation. |
The API reads the company's tax regime and the IBS/CBS regime options from the company settings. It then decides on its own how the IBS and the CBS go into the invoice. You do not send the regime when issuing. The regular IBS/CBS regime is the option of a Simples Nacional company to pay IBS and CBS under the general rules. A pending option is the situation of a standard-regime company that asked to join the Simples Nacional and is waiting for the decision.
| If your company is… | IBS/CBS under the general rules (state IBS, city IBS and CBS) | IBS/CBS calculated under the Simples Nacional |
|---|---|---|
| Simples Nacional, without the regular regime | No | IBS and CBS |
| Simples Nacional above the revenue sublimit, without the regular regime | Yes. From January 1, 2027, the API sets the CBS rate to zero, even if cbs.aliquota is sent. | CBS only |
| Simples Nacional, above the revenue sublimit or not, with the regular regime | Yes | No |
| Standard regime with a pending option for the Simples Nacional, without the regular regime | Yes | IBS and CBS |
| Standard regime with a pending option for the Simples Nacional above the revenue sublimit, without the regular regime | Yes | CBS only |
| Standard regime with a pending option, with the regular regime | Yes | No |
| Standard regime, with no pending request | Yes | No |
| MEI | As before | No |
The API only calculates IBS/CBS for an item that has ibs_cbs in the item itself or in the document. Without ibs_cbs at either level, the item goes out without IBS/CBS. The choice of the regular regime takes effect from January 1, 2027. The API sends the regime according to the company settings.
| Parameter | NFCom | Type | Size | Description |
|---|---|---|---|---|
impostos.ibs_cbs.aliquota_ibs_snitens[].impostos.ibs_cbs.aliquota_ibs_sn | string | 3v4 | IBS rate under the Simples Nacional, in %, in the document or in the item.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 the Simples (see How it works). | |
impostos.ibs_cbs.aliquota_cbs_snitens[].impostos.ibs_cbs.aliquota_cbs_sn | string | 3v4 | CBS rate under the Simples Nacional, in %, in the document or in the item.From 0 to 100, with a dot and up to four decimal places. E.g. "0.9000" |
A rate with a comma or a percent sign makes the issuing request fail.
| If in the item… | The API uses |
|---|---|
the rate was sent, including "0" | The item rate |
| the rate was left out | The document rate. Each rate is resolved separately. |
the rate came as null or blank | 0.00. The document is not checked. |
the item uses classe_imposto | Both document rates |
| there is no rate in the item or in the document | 0.00 |
Rates in the document; the second item overrides the CBS. The item ibs_cbs replaces the document one, so the item repeats the CST and the cClassTrib:
{
"impostos": {
"ibs_cbs": {
"situacao_tributaria": "000",
"classificacao_tributaria": "000001",
"aliquota_ibs_sn": "0.1000",
"aliquota_cbs_sn": "0.9000"
}
},
"itens": [
{ ... },
{
...
"impostos": {
"ibs_cbs": {
"situacao_tributaria": "000",
"classificacao_tributaria": "000001",
"aliquota_cbs_sn": "0" // zero wins; the IBS comes from the document
}
}
}
]
} For the state share of the IBS, add the ibs_estadual object inside ibs_cbs.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
aliquota_diferimento | Required depending on the note | decimal | 5v4 | Deferral rate of the state IBSRequired in all three shares when the CST sent enables deferral in the API. The input validation requires a numeric value. |
percentual_devolvido | Optional | decimal | 5v4 | Percentage of the state IBS refunded to the buyerSend a value from 0 to 100. The API calculates the refunded amount from this percentage. |
valor_devolvido | Optional | decimal | 15v2 | Amount of the state IBS refunded to the buyerOptional. The amount issued is always the one the API calculates from percentual_devolvido. If you send valor_devolvido, it must match the percentage (tolerance of R$ 0.01); otherwise the issuing request is rejected before it is sent to SEFAZ. |
Example of the state IBS:
"ibs_estadual": {
"aliquota_diferimento": 10.0000,
"percentual_devolvido": 50.0000
} For the municipal share of the IBS, add the ibs_municipal object inside ibs_cbs.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
aliquota_diferimento | Required depending on the note | decimal | 5v4 | Deferral rate of the city IBSRequired in all three shares when the CST sent enables deferral in the API. The input validation requires a numeric value. |
percentual_devolvido | Optional | decimal | 5v4 | Percentage of the city IBS refunded to the buyerSend a value from 0 to 100. The API calculates the refunded amount from this percentage. |
valor_devolvido | Optional | decimal | 15v2 | Amount of the city IBS refunded to the buyerOptional. The amount issued is always the one the API calculates from percentual_devolvido. If you send valor_devolvido, it must match the percentage (tolerance of R$ 0.01); otherwise the issuing request is rejected before it is sent to SEFAZ. |
Example of the city IBS:
"ibs_municipal": {
"aliquota_diferimento": 10.0000,
"percentual_devolvido": 50.0000
} For the CBS, add the cbs object inside ibs_cbs.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
aliquota_diferimento | Required depending on the note | decimal | 5v4 | Deferral rate of the CBSRequired in all three shares when the CST sent enables deferral in the API. The input validation requires a numeric value. |
percentual_devolvido | Optional | decimal | 5v4 | Percentage of the CBS refunded to the buyerSend a value from 0 to 100. The API calculates the refunded amount from this percentage. |
valor_devolvido | Optional | decimal | 15v2 | Amount of the CBS refunded to the buyerOptional. The amount issued is always the one the API calculates from percentual_devolvido. If you send valor_devolvido, it must match the percentage (tolerance of R$ 0.01); otherwise the issuing request is rejected before it is sent to SEFAZ. |
alc_zfm_cbs | Optional | object | - - - | Transaction in an incentive area with a zero CBS rate |
Example of the CBS:
"cbs": {
"aliquota_diferimento": 10.0000,
"percentual_devolvido": 50.0000
} For the zero CBS rate on transactions in the Manaus Free Trade Zone (ZFM) or in free trade areas (ALC), add the alc_zfm_cbs object inside the cbs field. The group requires emitente.inscricao_suframa (the issuer's SUFRAMA registration) to be filled in. See General information.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
aliquota_efetiva_referencia | Required depending on the note | decimal | 5v4 | Effective reference rate of the CBSWhen you use this name in the alc_zfm_cbs group, send a numeric value from 0 to 100, zero included. Do not combine it with another compatibility rate key in the same group. The group requires exactly one filled rate; null and an empty string do not count as filled. The API calculates the reference amount; do not send it. |
Example of the zero CBS rate group:
"cbs": {
"alc_zfm_cbs": {
"aliquota_efetiva_referencia": 20.0000
}
} To send an IBS/CBS credit reversal, add the estorno_credito object inside ibs_cbs. The API rejects this group when the cClassTrib sent does not allow a credit reversal.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
valor_ibs | Required depending on the note | decimal | 15v2 | Reversed IBS amountRequired when the estorno_credito object is sent. |
valor_cbs | Required depending on the note | decimal | 15v2 | Reversed CBS amountRequired when the estorno_credito object is sent. |
Illustrative fragment of the credit reversal structure; it is not a valid issuing request. The codes below are examples: replace them with a combination that allows a credit reversal. The codes shown here do not enable this group in the API:
"ibs_cbs": {
"situacao_tributaria": "000",
"classificacao_tributaria": "000001",
"estorno_credito": {
"valor_ibs": 10.00,
"valor_cbs": 1.00
}
} The XML and the DANFECOM (PDF) of each NFCom are at the xml and danfecom URLs returned in the issuing response, the lookup and the notification. For security, Webmania restricts access to these files.
The tax document is encrypted with a password. You can only view it after confirming the CPF/CNPJ (individual taxpayer ID or company ID) of the customer on the invoice, or with one of these authentication methods: Access credentials, Token, Issuing IP or Webmania® Panel.
Ways to access the files:
| Authentication | Access granted | Password required? | Description |
|---|---|---|---|
Access credentials | ✅ | No | When you send the company's access credentials in the request HEADER, you can access every tax document issued by the company. Authorization: Bearer YOUR_ACCESS_TOKEN |
Token | ✅ | No | When you send the encrypted token in the URL, the tax document can be accessed for 24 hours without a password. Ideal for sharing a link.?token=[TOKEN]The token is not available for tax documents without a customer. |
Issuing IP | ✅ | No | When you issue an invoice, the IP of the computer/server is registered as authorized permanently. It 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 in your account. Access lasts while you are logged in to the Webmania® Panel.Access while logged in |
No authentication | ❌ | Yes | When the URL is opened publicly without authentication, the tax documents are encrypted with a password. To open them, enter the CPF/CNPJ of the customer on the invoice (digits only, no punctuation).PDF = password-protected PDF fileAccess without authentication is not available for tax documents without a customer. |
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 the file, send a GET request to the XML URL (/xmlnfcom/{uuid|chave}) or the DANFECOM URL (/danfecom/{uuid|chave}), with the credentials in the header. Example with the DANFECOM:
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://api.webmania.com.br/danfecom/00000000-0000-0000-0000-000000000000 The response is the file itself, as application/pdf or text/xml.
The token unlocks the XML and the DANFECOM 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://api.webmania.com.br/danfecom/00000000-0000-0000-0000-000000000000?token=[TOKEN] The step-by-step guide to generate the token, with functions in PHP, Python, Java, C# and Ruby, is on Webmania's GitHub: https://github.com/webmaniabr/DFeToken.
The lookup returns the current status of an NFCom of the authenticated company, including while it is in processando or contingencia. Day-to-day tracking happens through the notifications: use the lookup to check a single NFCom when needed.
To look up an NFCom, send a GET request to the URL /2/nfcom/consulta/{identifier}, replacing {identifier} with the uuid or the access key of the NFCom.
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://api.webmania.com.br/2/nfcom/consulta/00000000-0000-0000-0000-000000000000 Example of an HTTP 200 response. The fields are those of Notification fields. When available, the lookup also returns protocolo and data_autorizacao, the date and time of the authorization:
{
"uuid": "00000000-0000-0000-0000-000000000000", // Unique identification number
"chave": "00000000000000000000000000000000000000000000", // Access key at SEFAZ
"serie": 1, // NFCom series
"nfcom": 123, // NFCom number
"modelo": "nfcom",
"status": "aprovado", // aprovado, reprovado, cancelado, processando or contingencia
"motivo": "Autorizado o uso da NFCom", // Reason for the status
"contingencia": false,
"protocolo": "135240000123456",
"data_autorizacao": "10/01/2025 09:30:00",
"xml": "https://api.webmania.com.br/xmlnfcom/[uuid]",
"xml_cancelamento": null,
"danfecom": "https://api.webmania.com.br/danfecom/[uuid]",
"log": { ... } // SEFAZ response log
} The cancellation registers an event at SEFAZ that voids an NFCom. Only an NFCom with status aprovado can be canceled.
To cancel an NFCom, send a PUT request to the URL /2/nfcom/cancelar, with the access key in chave (44 characters) and the reason for the cancellation in justificativa. The key accepts the numeric format and the format with an alphanumeric CNPJ: 6 digits, 12 alphanumeric characters and 26 digits.
| Parameter | Required | Type | Size | Description |
|---|---|---|---|---|
chave | Required | string | 44 | NFCom access key |
justificativa | Required | string | 15-255 | Reason for the cancellation |
curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"chave": "00000000000000000000000000000000000000000000",
"justificativa": "Cancelado por motivos administrativos."
}' \
https://api.webmania.com.br/2/nfcom/cancelar The result comes in the response itself, without a notification:
| Situation | Response | What to do |
|---|---|---|
| Cancellation approved | status = cancelado | Store the xml_cancelamento. The lookup now shows the NFCom as cancelado. |
| Cancellation not approved | status other than cancelado, with the motivo | The NFCom stays authorized. Read the motivo before you try again. |
Example of an HTTP 200 response for an approved cancellation:
{
"uuid": "00000000-0000-0000-0000-000000000000", // Unique identification number
"chave": "00000000000000000000000000000000000000000000", // Access key at SEFAZ
"status": "cancelado",
"motivo": "Cancelado por motivos administrativos.", // Reason for the status
"serie": 1, // NFCom series
"numero": 123, // NFCom number
"xml": "https://api.webmania.com.br/xmlnfcom/[uuid]",
"xml_cancelamento": "https://api.webmania.com.br/xmlnfcom/[uuid]/cancelamento",
"danfecom": "https://api.webmania.com.br/danfecom/[uuid]",
"log": { ... } // SEFAZ response log
} The service status tells you whether the NFCom service of SEFAZ is running. Use it to diagnose a communication failure: issuing already detects when SEFAZ is unavailable and switches to contingency mode on its own.
To check the service status, send a GET request to the URL /2/nfcom/status.
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://api.webmania.com.br/2/nfcom/status Example of an HTTP 200 response. operacional = true means the service is running, and mensagem describes the situation:
{
"operacional": true,
"mensagem": "Serviço NFCom operacional"
} Contingency mode is the backup procedure that lets you keep issuing when the tax authority is offline. Webmania® detects automatically when SEFAZ (state tax authority) is unavailable and issues the NFCom in offline contingency mode. Your application does not need to send anything again:
| Situation | Status | What Webmania does |
|---|---|---|
| SEFAZ is available | aprovado or reprovado | Sends the NFCom in the same request and returns the result in the response. |
| SEFAZ is unavailable or does not answer the request | contingencia | Issues the NFCom in offline contingency mode (tpEmis=2), with the XML and the DANFECOM in the response, and reprocesses it automatically. |
| The NFCom does not have the SEFAZ result yet | processando | Checks SEFAZ automatically before any new attempt, until it gets the result. |
contingencia, follow it through the lookup, without issuing it again. The url_notificacao receives the final result.| Step | What happens |
|---|---|
| Detection | Webmania detects the communication failure with SEFAZ and turns on contingency mode automatically. |
| Offline issuing | The NFCom is issued with tpEmis=2 (contingency because there is no communication) and the status contingencia. Webmania stores it until SEFAZ is back. |
| Notification | If you sent a url_notificacao, it receives the contingencia notification. |
| Reprocessing | The automatic reprocessing uses growing intervals. Before sending again, Webmania checks the NFCom at SEFAZ. If that check is not conclusive, the document stays pending and is not sent again in that attempt. |
| Final result | When the NFCom is sent successfully, the status changes to aprovado or reprovado and a new notification is sent. |
| Attempt limit | After 21 contingency attempts, Webmania checks SEFAZ. If the answer is still not conclusive, it keeps the NFCom in contingency mode and stops the automatic attempts for manual reconciliation. The limit is not a guaranteed completion time. |
Automatic activation covers transport failures, such as a timeout or a connection error with SEFAZ. The response codes below are examples of failures or unavailability. On their own, they do not guarantee that contingency mode turns on: the handling depends on the response received.
| Code | Description |
|---|---|
109 | Service stopped with no forecast |
508 | Failure processing the request |
999 | Uncatalogued error |
timeout | Communication timeout |
connection | Connection error with SEFAZ |
Example of an HTTP 200 response for an NFCom issued in contingency mode:
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"chave": "35240712345678901234620010000001191234567890",
"serie": 1,
"nfcom": 120,
"modelo": "nfcom",
"status": "contingencia",
"motivo": "NFCom emitida em contingência. Será processada quando a SEFAZ retornar.",
"contingencia": true,
"xml": "https://api.webmania.com.br/xmlnfcom/550e8400-e29b-41d4-a716-446655440000",
"xml_cancelamento": null,
"danfecom": "https://api.webmania.com.br/danfecom/550e8400-e29b-41d4-a716-446655440000",
"log": { ... }
} uuid and do not issue it again.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 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 |
|---|---|---|
| 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. The API sends the message in Portuguese; it means “Request limit reached. Try again in a few seconds.”:
{
"error": "Limite de requisições atingido. Tente novamente em alguns segundos."
}
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.
NFCom has a new section, IBS/CBS — Simples Nacional: what changes for each type of company, the tax regime set in the company record, the Simples rates on the invoice and per item, and the dates per environment.
Changed section: reforma-tributaria-simples-nacional-nfcom
The contingency system now has a flowchart of offline issuing, of the lookup before each resend and of manual reconciliation.
Changed section: sistema-contingencia
The documentation is now LLM-ready: copy the page or each section as Markdown, a section index and llms.txt.