> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents/brazil-nfe.md).

# BRAZIL NF-E

| Property             | Value                                                           |
| -------------------- | --------------------------------------------------------------- |
| **Country / Region** | Brazil                                                          |
| **Document Types**   | Invoice (Nota Fiscal Eletrônica)                                |
| **Format**           | XML                                                             |
| **Standard**         | NF-e 4.0 (Nota Fiscal Eletrônica — goods & interstate commerce) |
| **Locale**           | `pt_BR`                                                         |

NF-e (Nota Fiscal Eletrônica, `<mod>55</mod>`) is the Brazilian electronic invoice for goods and interstate commerce, regulated by SEFAZ. Each NF-e contains a unique 44-digit access key (`chNFe`), detailed product line items, and multi-tier tax data (ICMS, IPI, PIS, COFINS). DocBits classifies NF-e by detecting the `http://www.portalfiscal.inf.br/nfe` namespace.

## Support Status

| Component        | Status      |
| ---------------- | ----------- |
| Preview          | ✅ Supported |
| Field Extraction | ✅ Supported |
| Transformation   | ✅ Supported |

## Default Preview

<figure><img src="/files/OJGaEvLkBx7JUq9bwnuE" alt="Brazil NF-e preview in DocBits"><figcaption><p>Default DocBits preview for a BRAZIL NF-E document</p></figcaption></figure>

## Field Mapping

### Header Fields

| DocBits Field   | Source XPath                                               | Notes                               |
| --------------- | ---------------------------------------------------------- | ----------------------------------- |
| `invoice_id`    | `//*[local-name()='ide']/*[local-name()='nNF']`            | Nota Fiscal number                  |
| `invoice_date`  | `//*[local-name()='ide']/*[local-name()='dhEmi']`          | ISO 8601 with BRT offset            |
| `currency`      | Fixed: `BRL`                                               | Always Brazilian Real               |
| `total_amount`  | `//*[local-name()='ICMSTot']/*[local-name()='vNF']`        | Total NF-e value                    |
| `net_amount`    | `//*[local-name()='ICMSTot']/*[local-name()='vProd']`      | Total products value                |
| `tax_amount`    | `//*[local-name()='ICMSTot']/*[local-name()='vICMS']`      | ICMS tax total                      |
| `supplier_name` | `//*[local-name()='emit']/*[local-name()='xNome']`         | Emitter company name                |
| `supplier_id`   | `//*[local-name()='emit']/*[local-name()='CNPJ']` or `CPF` | CNPJ (14 digits) or CPF (11 digits) |
| `buyer_name`    | `//*[local-name()='dest']/*[local-name()='xNome']`         | Recipient company name              |
| `buyer_id`      | `//*[local-name()='dest']/*[local-name()='CNPJ']` or `CPF` | CNPJ or CPF                         |

### Line Item Table (`INVOICE_TABLE`)

Row path: `//*[local-name()='det']`

| Column          | Relative XPath                                                                  | Notes                      |
| --------------- | ------------------------------------------------------------------------------- | -------------------------- |
| `POSITION`      | `@nItem`                                                                        | Item sequence number       |
| `ITEM_CODE`     | `*[local-name()='prod']/*[local-name()='cProd']`                                | Product code               |
| `DESCRIPTION`   | `*[local-name()='prod']/*[local-name()='xProd']`                                | Product description        |
| `NCM_CODE`      | `*[local-name()='prod']/*[local-name()='NCM']`                                  | NCM customs classification |
| `CFOP_CODE`     | `*[local-name()='prod']/*[local-name()='CFOP']`                                 | Operation fiscal code      |
| `UNIT`          | `*[local-name()='prod']/*[local-name()='uCom']`                                 | Unit of measure            |
| `QUANTITY`      | `*[local-name()='prod']/*[local-name()='qCom']`                                 | Commercial quantity        |
| `UNIT_PRICE`    | `*[local-name()='prod']/*[local-name()='vUnCom']`                               | Unit price                 |
| `TOTAL_AMOUNT`  | `*[local-name()='prod']/*[local-name()='vProd']`                                | Line total                 |
| `ICMS_AMOUNT`   | `*[local-name()='imposto']/*[local-name()='ICMS']//*[local-name()='vICMS']`     | ICMS tax per line          |
| `PIS_AMOUNT`    | `*[local-name()='imposto']/*[local-name()='PIS']//*[local-name()='vPIS']`       | PIS tax per line           |
| `COFINS_AMOUNT` | `*[local-name()='imposto']/*[local-name()='COFINS']//*[local-name()='vCOFINS']` | COFINS tax per line        |
| `VAT_RATE`      | `*[local-name()='imposto']/*[local-name()='ICMS']//*[local-name()='pICMS']`     | ICMS rate (%)              |

## Classification Rule

DocBits detects BRAZIL NF-E documents by checking for the string:

```
http://www.portalfiscal.inf.br/nfe
```

in the XML namespace (`mod=55` for NF-e, `mod=65` for NFC-e are distinguished separately).

## Related

* [BRAZIL NFC-E](/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents/brazil-nfce.md)
* [BRAZIL CT-E](/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents/brazil-cte.md)
* [BRAZIL NFS-E](/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents/brazil-nfse.md)
* [Supported Electronic Documents](/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.docbits.com/administration-and-setup/settings/global-settings/document-types/edi/supported-electronic-documents/brazil-nfe.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
