> ## 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

Brazil uses Notas Fiscais Eletrônicas (electronic fiscal notes) such as NFSe,
NFe, and NFCe for reporting tax information to municipal, state, and federal
authorities. The tax system is administered by the Receita Federal (Federal
Revenue Service).

Tax identification is provided through a CNPJ (Cadastro Nacional da Pessoa
Jurídica) for businesses, consisting of 14 digits, or a CPF (Cadastro de Pessoas
Físicas) for individuals, consisting of 11 digits. Both types are valid for the
issuance of NFS-e (electronic service invoices).

Brazilian addresses have three subdivisions relevant for tax purposes: bairro
(neighbourhood), município (municipality), and estado (state). Municipality codes
follow the IBGE coding system.

Service notes (NFSe) let service providers document and report taxes such as
ISS (Imposto Sobre Serviços) related to the services they provide. Municipal
governments regulate them. Special tax regimes include Simples Nacional for
simplified taxation of micro and small enterprises, and MEI (Micro-Empreendedor
Individual) for individual micro-entrepreneurs.

## Base Details

| Key              | Value               |
| ---------------- | ------------------- |
| Tax Country Code | `BR`                |
| Currency         | `BRL`               |
| Base Time Zone   | `America/Sao_Paulo` |

## Tax Categories

| Code        | Name              | Title                                                      |
| ----------- | ----------------- | ---------------------------------------------------------- |
| `ISS`       | ISS               | Municipal Service Tax                                      |
| `ICMS`      | ICMS              | State value-added tax                                      |
| `IPI`       | IPI               | Federal value-added Tax                                    |
| `PIS`       | PIS               | Social Integration Program                                 |
| `PISRet`    | PIS (Retained)    | Social Integration Program Retained                        |
| `COFINS`    | COFINS            | Contribution for the Financing of Social Security          |
| `COFINSRet` | COFINS (Retained) | Contribution for the Financing of Social Security Retained |
| `CSLL`      | CSLL              | Social Contribution on Net Profit                          |
| `INSS`      | INSS              | National Social Security Institute Withholding             |
| `IRRF`      | IRRF              | Income Tax Withheld at Source                              |
| `IBS`       | IBS               | Goods and Services Tax                                     |
| `CBS`       | CBS               | Federal Goods and Services Contribution                    |

## Correction Definitions

Auto-generation of corrective invoices or credit and debit notes is
supported.

### Invoice Types

The types of invoices that can be created with a preceding definition:

* `credit-note`

## Extensions

### IBGE Municipality Code

The municipality code as defined by the IBGE (Brazilian Institute of Geography and
Statistics).

<Accordion title="br-ibge-municipality">
  Pattern: `^\d{7}$`
</Accordion>

## Validation Rules

<AccordionGroup>
  <Accordion title="org.Party">
    | Field                | Test                                                                                                                                                                                            | Validation Code / Message                                                                       |
    | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
    | `ext`                | <ul class="gobl-test"><li>Is Brazilian party</li><li>Ext 'br-ibge-municipality' matches pattern '^\d{7}\$'</li></ul>                                                                            | `GOBL-BR-ORG-PARTY-01`<br />Brazilian party ext must define a valid 'br-ibge-municipality' code |
    | `addresses[*].state` | <ul class="gobl-test"><li>String(Country) in \['','BR']</li><li>Code in \[AC, AL, AM, AP, BA, CE, DF, ES, GO, MA, MG, MS, MT, PA, PB, PE, PI, PR, RJ, RN, RO, RR, RS, SC, SE, SP, TO]</li></ul> | `GOBL-BR-ORG-PARTY-02`<br />Brazilian state must be one of the valid states                     |
    | `addresses[*].code`  | <ul class="gobl-test"><li>String(Country) in \['','BR']</li><li>Matches ^\d{5}-?\d{3}\$</li></ul>                                                                                               | `GOBL-BR-ORG-PARTY-03`<br />Brazilian postal code must match the valid format                   |
  </Accordion>

  <Accordion title="tax.Identity">
    | Field  | Test                                                            | Validation Code / Message                                          |
    | ------ | --------------------------------------------------------------- | ------------------------------------------------------------------ |
    | `code` | <ul class="gobl-test"><li>Code in \[BR]</li><li>Valid</li></ul> | `GOBL-BR-TAX-IDENTITY-01`<br />Invalid Brazilian tax identity code |
  </Accordion>
</AccordionGroup>
