> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Brazil NFS-e 1.X

Key: `br-nfse-v1`

Module: [github.com/invopop/gobl.br.nfse](https://github.com/invopop/gobl.br.nfse)

## Extensions

### CNAE code

The CNAE (National Classification of Economic Activities) code for a service.

List of codes from the IBGE (Brazilian Institute of Geography and Statistics):

* [https://www.ibge.gov.br/en/statistics/technical-documents/statistical-lists-and-classifications/17245-national-classification-of-economic-activities.html](https://www.ibge.gov.br/en/statistics/technical-documents/statistical-lists-and-classifications/17245-national-classification-of-economic-activities.html)

> [accordion] br-nfse-cnae
>
> Pattern: `^\d{2}[\s\.\-\/]?\d{2}[\s\.\-\/]?\d[\s\.\-\/]?\d{2}$`

### NBS code

The NBS (Nomenclatura Brasileira de Serviços, Intangíveis e outras Operações que
produzam Variações no Patrimônio) code for a service. NBS is the Brazilian
classification system for services and intangibles, established by Decreto No.
7.708/2012 and maintained by the MDIC (Ministério do Desenvolvimento, Indústria,
Comércio e Serviços).

Official list of codes from the MDIC:

* [https://www.gov.br/mdic/pt-br/assuntos/sdic/comercio-e-servicos/nbs-nomenclatura-brasileira-de-servicos](https://www.gov.br/mdic/pt-br/assuntos/sdic/comercio-e-servicos/nbs-nomenclatura-brasileira-de-servicos)

> [accordion] br-nfse-nbs
>
> Pattern: `^\d[\.\s]?\d{4}[\.\s]?\d{2}[\.\s]?\d{2}$`

### Fiscal Incentive

Indicates whether a party benefits from a fiscal incentive.

> [accordion] br-nfse-fiscal-incentive
>
> | Code | Name |
> | - | - |
> | `1` | Has incentive |
> | `2` | Does not have incentive |

### ISS Liability

Indicates the ISS liability status, i.e., whether the ISS tax is due or not and why.

List of codes from the national NFSe ABRASF (v2.04) model:

* [https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download](https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download)
  (Section 10.2, Field B-38)

> [accordion] br-nfse-iss-liability
>
> | Code | Name |
> | - | - |
> | `1` | Liable |
> | `2` | Not subject |
> | `3` | Exempt |
> | `4` | Export |
> | `5` | Immune |
> | `6` | Suspended Judicially |
> | `7` | Suspended Administratively |

### ISS Immunity

The constitutional immunity that applies when the ISS of a service is immune,
that is, when the ISS tax combo has the `br-nfse-iss-liability` code `5`.

Maps to the `tpImunidade` field in the NFS-e national layout.

> [accordion] br-nfse-iss-immunity
>
> | Code | Name |
> | - | - |
> | `1` | Assets, income or services of government entities between each other (CF88, Art 150, VI, a) |
> | `2` | Religious entities and temples of any faith, including their assistance and charitable organisations (CF88, Art 150, VI, b) |
> | `3` | Assets, income or services of political parties, including their foundations, workers' unions, and non-profit education and social assistance institutions, as required by law (CF88, Art 150, VI, c) |
> | `4` | Books, newspapers, periodicals and the paper used to print them (CF88, Art 150, VI, d) |
> | `5` | Music recordings and music videos produced in Brazil with musical or literary-musical works by Brazilian authors or works performed by Brazilian artists, and the physical media or digital files containing them, except at the industrial replication stage of laser-read optical media (CF88, Art 150, VI, e) |

### Service Code

The service code as defined by the municipality. Typically, one of the codes listed
in the Lei Complementar 116/2003, but municipalities can make their own changes.

For further details on the list of possible codes, see:

* [https://www.planalto.gov.br/ccivil\_03/leis/lcp/lcp116.htm](https://www.planalto.gov.br/ccivil_03/leis/lcp/lcp116.htm)

For suppliers issuing through the NFS-e Nacional, the 6-digit national service code
instead, which maps to the `cTribNac` field in the national layout. List of possible
values:

* [https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/documentacao-atual/anexo\_b-nbs2-lista\_servico\_nacional-snnfse-v1-01-20260122.xlsx](https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/documentacao-atual/anexo_b-nbs2-lista_servico_nacional-snnfse-v1-01-20260122.xlsx)

> [accordion] br-nfse-service

### Opting for "Simples Nacional" regime

Indicates whether a party is opting for the "Simples Nacional" (Regime Especial
Unificado de Arrecadação de Tributos e Contribuições devidos pelas Microempresas e
Empresas de Pequeno Porte) tax regime

> [accordion] br-nfse-simples
>
> | Code | Name |
> | - | - |
> | `1` | Opt-in |
> | `2` | Opt-out |

### Simples Nacional Tax Assessment Regime

How a supplier opting for the Simples Nacional as ME/EPP pays its federal taxes and
ISS, which changes when it exceeds a Simples Nacional sublimit or limit. On the
national system, required for ME/EPP suppliers and not allowed for any other.

Maps to the `regApTribSN` field in the NFS-e national layout.

> [accordion] br-nfse-simples-regime
>
> | Code | Name |
> | - | - |
> | `1` | Federal and municipal taxes through the Simples Nacional |
> | `2` | Federal taxes through the Simples Nacional, ISS under the municipal legislation |
> | `3` | Federal and municipal taxes under their own legislation |

### Special Tax Regime

Indicates a special tax regime that a party is subject to.

> [accordion] br-nfse-special-regime
>
> | Code | Name |
> | - | - |
> | `1` | Municipal micro-enterprise |
> | `2` | Estimated |
> | `3` | Professional Society |
> | `4` | Cooperative |
> | `5` | Single micro-entrepreneur (MEI) |
> | `6` | Micro-enterprise or Small Business (ME EPP) |

### Operation Indicator

Indicates the operation type for the determination of the IBS and CBS taxes by the
tax authorities.

Maps to the `cIndOp` field in the NFS-e national layout.

List of possible values:

* [https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/rtc/anexovii-indop\_ibscbs\_v1-00-00.xlsx](https://www.gov.br/nfse/pt-br/biblioteca/documentacao-tecnica/rtc/anexovii-indop_ibscbs_v1-00-00.xlsx)

> [accordion] br-nfse-operation
>
> Pattern: `^\d{6}$`

### Tax Status Code (CST)

Indicates the tax status of the operation for the determination of the IBS and CBS
taxes by the tax authorities.

Maps to the `CST` field in the NFS-e national layout.

List of possible values:

* [https://dfe-portal.svrs.rs.gov.br/DFE/ClassificacaoTributaria](https://dfe-portal.svrs.rs.gov.br/DFE/ClassificacaoTributaria)

> [accordion] br-nfse-tax-status
>
> Pattern: `^\d{3}$`

### Tax Classification Code

Indicates the tax classification code for the determination of the IBS and CBS taxes
by the tax authorities.

Maps to the `cClassTrib` field in the NFS-e national layout.

List of possible values:

* [https://dfe-portal.svrs.rs.gov.br/DFE/ClassificacaoTributaria](https://dfe-portal.svrs.rs.gov.br/DFE/ClassificacaoTributaria)

> [accordion] br-nfse-tax-class
>
> Pattern: `^\d{6}$`

### Supply Mode

How a service exported or imported was supplied.

Maps to the `mdPrestacao` field in the NFS-e national layout.

> [accordion] br-nfse-supply-mode
>
> | Code | Name |
> | - | - |
> | `1` | Cross-border |
> | `2` | Consumption in Brazil |
> | `3` | Temporary movement of individuals |
> | `4` | Consumption abroad |

### Relationship Between Parties

Relationship between the supplier and the foreign customer, as defined in
art. 23 of Law 9.430/1996.

Maps to the `vincPrest` field in the NFS-e national layout.

> [accordion] br-nfse-relationship
>
> | Code | Name |
> | - | - |
> | `0` | No relationship |
> | `1` | Controlled |
> | `2` | Controlling |
> | `3` | Affiliated |
> | `4` | Head office |
> | `5` | Branch |
> | `6` | Other relationship |

### Total Tax Estimate

Identifies an informative charge holding the approximate percentage of the taxes
included in the price, as required by Law 12.741/2012. Either the Simples Nacional
one or the federal, state and municipal ones.

Maps to the `totTrib` group in the NFS-e national layout.

> [accordion] br-nfse-tax-estimate
>
> | Code | Name |
> | - | - |
> | `federal` | Federal |
> | `state` | State |
> | `municipal` | Municipal |
> | `simples` | Simples Nacional |

## Validation Rules

Validation rules check each struct against a set of assertions and report any
failures with a unique code and message.
[Read more about validation](https://docs.gobl.org/overview/validation.md).

> [accordion] bill.Invoice
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | Invoice | <ul><li>Can convert to \[BRL]</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-17` Invoice must be in BRL or provide exchange rate for conversion |
> | `series` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-01` Series is required |
> | `code` | <ul><li>Matches `^[1-9][0-9]*$`</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-02` Code must be a positive integer |
> | `supplier` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-03` Supplier is required |
> | `supplier.tax_id` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-04` Supplier tax ID is required |
> | `supplier.tax_id.code` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-05` Supplier tax ID code is required |
> | `supplier.name` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-06` Supplier name is required |
> | `supplier.addresses` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-07` Supplier must have at least one address |
> | `supplier.addresses[*]` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-08` Supplier address must not be empty |
> | `supplier.addresses[*].street` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-09` Supplier address requires a street |
> | `supplier.addresses[*].num` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-10` Supplier address requires a number |
> | `supplier.addresses[*].locality` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-11` Supplier address requires a locality |
> | `supplier.addresses[*].state` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-12` Supplier address requires a state |
> | `supplier.addresses[*].code` | <ul><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-13` Supplier address requires a postal code |
> | `supplier.ext` | <ul><li>Ext require \[br-ibge-municipality, br-nfse-simples, br-nfse-fiscal-incentive]</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-14` Supplier requires 'br-ibge-municipality', 'br-nfse-simples', and 'br-nfse-fiscal-incentive' extensions |
> | `supplier.ext` | <ul><li>Ext 'br-nfse-simples-regime' in \[1, 2, 3]</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-18` Supplier extension 'br-nfse-simples-regime' must be a valid code |
> | `tax.ext` | <ul><li>Ext 'br-nfse-supply-mode' in \[1, 2, 3, 4]</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-19` Tax extension 'br-nfse-supply-mode' must be a valid code |
> | `tax.ext` | <ul><li>Ext 'br-nfse-relationship' in \[0, 1, 2, 3, 4, 5, 6]</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-20` Tax extension 'br-nfse-relationship' must be a valid code |
> | `discounts` | <ul><li>Empty</li></ul> | `GOBL-BR-NFSE-BILL-INVOICE-16` Discounts are not supported by NFS-e |

> [accordion] bill.Charge
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | Charge | <ul><li>Has tax estimate ext</li><li>Informative</li></ul> | `GOBL-BR-NFSE-BILL-CHARGE-01` Tax estimate charge must be informative |
> | `ext` | <ul><li>Has tax estimate ext</li><li>Ext 'br-nfse-tax-estimate' in \[federal, state, municipal, simples]</li></ul> | `GOBL-BR-NFSE-BILL-CHARGE-02` Charge extension 'br-nfse-tax-estimate' must be a valid code |
> | `percent` | <ul><li>Has tax estimate ext</li><li>Present</li></ul> | `GOBL-BR-NFSE-BILL-CHARGE-03` Tax estimate charge requires a percent |

> [accordion] bill.Line
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | Line | <ul><li>Line has tax category ISS</li></ul> | `GOBL-BR-NFSE-BILL-LINE-01` Line taxes must include the ISS category |

> [accordion] org.Item
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `ext` | <ul><li>Ext require \[br-nfse-service]</li></ul> | `GOBL-BR-NFSE-ORG-ITEM-01` Item requires 'br-nfse-service' extension |
> | `ext` | <ul><li>Ext require all or none of \[br-nfse-operation, br-nfse-tax-status, br-nfse-tax-class]</li></ul> | `GOBL-BR-NFSE-ORG-ITEM-02` Item extensions 'br-nfse-operation', 'br-nfse-tax-status', and 'br-nfse-tax-class' must all be present or all absent |

> [accordion] tax.Combo
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `ext` | <ul><li>ISS category</li><li>Ext require \[br-nfse-iss-liability]</li></ul> | `GOBL-BR-NFSE-TAX-COMBO-01` ISS tax combo requires 'br-nfse-iss-liability' extension |
> | `ext` | <ul><li>ISS category</li><li>Ext 'br-nfse-iss-immunity' in \[1, 2, 3, 4, 5]</li></ul> | `GOBL-BR-NFSE-TAX-COMBO-02` ISS tax combo extension 'br-nfse-iss-immunity' must be a valid code |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.