> ## 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 NF-e 4.00

Key: `br-nfe-v4`

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

## Scenarios

### bill/invoice

<Accordion title="standard, credit-note, debit-note">
  **Filters:**

  * **Types:** `standard`, `credit-note`, `debit-note`

  **Output:**

  * **Extensions:** `br-nfe-model:55`
</Accordion>

<Accordion title="standard, credit-note, debit-note, #simplified">
  **Filters:**

  * **Types:** `standard`, `credit-note`, `debit-note`
  * **Tags:** `simplified`

  **Output:**

  * **Extensions:** `br-nfe-model:65`
</Accordion>

## Extensions

### Fiscal Document Model Code

Code used to identify the fiscal document model. It will be
determined automatically by GOBL during normalization according to
the scenario definitions.

<Accordion title="br-nfe-model">
  | Code | Name  |
  | ---- | ----- |
  | `55` | NF-e  |
  | `65` | NFC-e |
</Accordion>

### Buyer Presence Indicator

Indicator of the buyer's presence at the commercial establishment
at the time of the operation. This field is used to classify the
type of commercial transaction according to Brazilian tax regulations.

<Accordion title="br-nfe-presence">
  | Code | Name                                       |
  | ---- | ------------------------------------------ |
  | `0`  | Not applicable                             |
  | `1`  | In-person operation                        |
  | `2`  | Non-in-person operation, via Internet      |
  | `3`  | Non-in-person operation, Tele-service      |
  | `4`  | NFC-e in operation with home delivery      |
  | `5`  | In-person operation, outside establishment |
  | `9`  | Non-in-person operation, others            |
</Accordion>

### Payment Method

Code used to identify the payment method used for the transaction.

<Accordion title="br-nfe-payment-means">
  | Code | Name                                      |
  | ---- | ----------------------------------------- |
  | `01` | Cash                                      |
  | `02` | Check                                     |
  | `03` | Credit Card                               |
  | `04` | Debit Card                                |
  | `05` | Store Credit                              |
  | `10` | Food Voucher                              |
  | `11` | Meal Voucher                              |
  | `12` | Gift Voucher                              |
  | `13` | Fuel Voucher                              |
  | `15` | Bank Slip (Boleto)                        |
  | `16` | Bank Deposit                              |
  | `17` | Instant Payment (PIX)                     |
  | `18` | Bank Transfer, Digital Wallet             |
  | `19` | Loyalty Program, Cashback, Virtual Credit |
  | `90` | No Payment                                |
  | `99` | Others                                    |
</Accordion>

### CFOP (Fiscal Operations and Services Code)

Four-digit code that classifies the nature of goods movements and service
provisions for ICMS purposes in Brazil. The first digit indicates the
operation origin/destination (1–3 for entries; 5–7 for exits), and the
remaining digits identify the specific type of operation.

<Accordion title="br-nfe-cfop">
  Pattern: `^[1-7]\d{3}$`
</Accordion>

### Fiscal Incentive Indicator

Indicates whether a party benefits from a fiscal incentive.

<Accordion title="br-nfe-fiscal-incentive">
  | Code | Name                    |
  | ---- | ----------------------- |
  | `1`  | Has incentive           |
  | `2`  | Does not have incentive |
</Accordion>

### Tax Regime Code

Indicates the tax regime that a party is subject to.

<Accordion title="br-nfe-regime">
  | Code | Name                     |
  | ---- | ------------------------ |
  | `1`  | Simples Nacional         |
  | `2`  | Simples Nacional, Excess |
  | `3`  | Normal                   |
</Accordion>

### Special Tax Regime Code

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

<Accordion title="br-nfe-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) |
</Accordion>

## Validation Rules

<AccordionGroup>
  <Accordion title="bill.Invoice">
    | Field                                                                     | Test                                                                                           | Validation Code / Message                                                                                                    |
    | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
    | <small>Invoice</small>                                                    | <ul class="gobl-test"><li>Can convert to \[BRL]</li></ul>                                      | `GOBL-BR-NFE-BILL-INVOICE-34`<br />Invoice currency must be BRL or provide exchange rate for conversion                      |
    | <small>Invoice</small>                                                    | <ul class="gobl-test"><li>Has reason note</li></ul>                                            | `GOBL-BR-NFE-BILL-INVOICE-30`<br />Invoice requires a note with key 'reason' to describe the nature of the operation (natOp) |
    | `supplier.tax_id`                                                         | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-01`<br />Invoice supplier tax ID is required                                                       |
    | `supplier.tax_id.code`                                                    | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-02`<br />Invoice supplier tax ID code is required                                                  |
    | `supplier.addresses[*]`                                                   | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-03`<br />Invoice supplier address must not be empty                                                |
    | `supplier.addresses[*].street`                                            | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-04`<br />Invoice supplier address requires a street                                                |
    | `supplier.addresses[*].num`                                               | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-05`<br />Invoice supplier address requires a number                                                |
    | `supplier.addresses[*].locality`                                          | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-06`<br />Invoice supplier address requires a locality                                              |
    | `supplier.addresses[*].state`                                             | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-07`<br />Invoice supplier address requires a state                                                 |
    | `supplier.addresses[*].code`                                              | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-08`<br />Invoice supplier address requires a postal code                                           |
    | `supplier.addresses[*].country`                                           | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-37`<br />Invoice supplier address requires a country                                               |
    | `supplier.ext`                                                            | <ul class="gobl-test"><li>Has addresses</li><li>Ext require \[br-ibge-municipality]</li></ul>  | `GOBL-BR-NFE-BILL-INVOICE-09`<br />Invoice supplier requires 'br-ibge-municipality' extension when addresses are present     |
    | `supplier.name`                                                           | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-10`<br />Invoice supplier name is required                                                         |
    | `supplier.addresses`                                                      | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-11`<br />Invoice supplier must have at least one address                                           |
    | `customer`                                                                | <ul class="gobl-test"><li>Invoice is NFe</li><li class="gobl-test-present">Present</li></ul>   | `GOBL-BR-NFE-BILL-INVOICE-12`<br />Invoice customer is required for NF-e invoices                                            |
    | `customer.addresses`                                                      | <ul class="gobl-test"><li>Invoice is NFe</li><li class="gobl-test-present">Present</li></ul>   | `GOBL-BR-NFE-BILL-INVOICE-13`<br />Invoice customer must have at least one address for NF-e invoices                         |
    | `customer`                                                                | <ul class="gobl-test"><li>No tax ID</li><li>Has foreign country identity</li></ul>             | `GOBL-BR-NFE-BILL-INVOICE-36`<br />Invoice customer must have a tax ID or a foreign country identity                         |
    | `customer.tax_id.code`                                                    | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-15`<br />Invoice customer tax ID code is required                                                  |
    | `customer.addresses[*]`                                                   | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-16`<br />Invoice customer address must not be empty                                                |
    | `customer.addresses[*].street`                                            | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-17`<br />Invoice customer address requires a street                                                |
    | `customer.addresses[*].num`                                               | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-18`<br />Invoice customer address requires a number                                                |
    | `customer.addresses[*].locality`                                          | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-19`<br />Invoice customer address requires a locality                                              |
    | `customer.addresses[*].code`                                              | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-21`<br />Invoice customer address requires a postal code                                           |
    | `customer.addresses[*].country`                                           | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-38`<br />Invoice customer address requires a country                                               |
    | `customer.addresses[*].state`                                             | <ul class="gobl-test"><li>Is Brazilian</li><li class="gobl-test-present">Present</li></ul>     | `GOBL-BR-NFE-BILL-INVOICE-20`<br />Invoice customer address requires a state                                                 |
    | `customer.ext`                                                            | <ul class="gobl-test"><li>Has addresses</li><li>Ext require \[br-ibge-municipality]</li></ul>  | `GOBL-BR-NFE-BILL-INVOICE-22`<br />Invoice customer requires 'br-ibge-municipality' extension when addresses are present     |
    | `series`                                                                  | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-23`<br />Invoice series is required                                                                |
    | `series`                                                                  | <ul class="gobl-test"><li>Matches ^(?:0\|\[1-9]{1}\[0-9]{0,2})\$</li></ul>                     | `GOBL-BR-NFE-BILL-INVOICE-24`<br />Invoice series format is invalid; must be 0 or 1-999                                      |
    | `tax`                                                                     | <ul class="gobl-test"><li class="gobl-test-present">Present</li></ul>                          | `GOBL-BR-NFE-BILL-INVOICE-25`<br />Invoice tax is required                                                                   |
    | `tax.ext`                                                                 | <ul class="gobl-test"><li>Ext require \[br-nfe-model, br-nfe-presence]</li></ul>               | `GOBL-BR-NFE-BILL-INVOICE-26`<br />Invoice tax requires 'br-nfe-model' and 'br-nfe-presence' extensions                      |
    | `tax.ext`                                                                 | <ul class="gobl-test"><li>NFe model</li><li>Ext 'br-nfe-presence' not in \[4]</li></ul>        | `GOBL-BR-NFE-BILL-INVOICE-27`<br />NF-e invoices do not support '4' for 'br-nfe-presence'                                    |
    | `tax.ext`                                                                 | <ul class="gobl-test"><li>NFCe model</li><li>Ext 'br-nfe-presence' in \[1, 4]</li></ul>        | `GOBL-BR-NFE-BILL-INVOICE-28`<br />NFC-e invoices require in-person or delivery for 'br-nfe-presence'                        |
    | `notes[*].text`                                                           | <ul class="gobl-test"><li>Reason note</li><li>Length between 1 and 60</li></ul>                | `GOBL-BR-NFE-BILL-INVOICE-29`<br />Invoice reason note text must be between 1 and 60 characters                              |
    | `payment`                                                                 | <ul class="gobl-test"><li>Invoice not paid</li><li class="gobl-test-present">Present</li></ul> | `GOBL-BR-NFE-BILL-INVOICE-31`<br />Invoice payment is required when invoice is unpaid                                        |
    | `payment.instructions`                                                    | <ul class="gobl-test"><li>Invoice not paid</li><li class="gobl-test-present">Present</li></ul> | `GOBL-BR-NFE-BILL-INVOICE-32`<br />Invoice payment instructions are required when invoice is unpaid                          |
    | `totals.due`<br /><small class="gobl-field-calculated">Calculated</small> | <ul class="gobl-test"><li>Zero or positive</li></ul>                                           | `GOBL-BR-NFE-BILL-INVOICE-33`<br />Invoice due amount must not be negative                                                   |
    | `lines[*].ext`                                                            | <ul class="gobl-test"><li>Invoice is NFe</li><li>Ext require \[br-nfe-cfop]</li></ul>          | `GOBL-BR-NFE-BILL-INVOICE-35`<br />NF-e invoice lines require 'br-nfe-cfop' extension                                        |
  </Accordion>

  <Accordion title="bill.Line">
    | Field               | Test                                                             | Validation Code / Message                                                   |
    | ------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------- |
    | <small>Line</small> | <ul class="gobl-test"><li>Line has tax category ICMS</li></ul>   | `GOBL-BR-NFE-BILL-LINE-01`<br />Line taxes must include the ICMS category   |
    | <small>Line</small> | <ul class="gobl-test"><li>Line has tax category PIS</li></ul>    | `GOBL-BR-NFE-BILL-LINE-02`<br />Line taxes must include the PIS category    |
    | <small>Line</small> | <ul class="gobl-test"><li>Line has tax category COFINS</li></ul> | `GOBL-BR-NFE-BILL-LINE-03`<br />Line taxes must include the COFINS category |
  </Accordion>

  <Accordion title="pay.Instructions">
    | Field | Test                                                                    | Validation Code / Message                                                                            |
    | ----- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
    | `ext` | <ul class="gobl-test"><li>Ext require \[br-nfe-payment-means]</li></ul> | `GOBL-BR-NFE-PAY-INSTRUCTIONS-01`<br />Payment instructions require 'br-nfe-payment-means' extension |
  </Accordion>

  <Accordion title="pay.Record">
    | Field | Test                                                                    | Validation Code / Message                                                                  |
    | ----- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
    | `ext` | <ul class="gobl-test"><li>Ext require \[br-nfe-payment-means]</li></ul> | `GOBL-BR-NFE-PAY-RECORD-01`<br />Payment advance requires 'br-nfe-payment-means' extension |
  </Accordion>
</AccordionGroup>
