Documentation › NF-e issuance
NF-e by spreadsheet and in batches
The Básica NF-e spreadsheet (one row per product), the products spreadsheet, and the batch with type nfe.
For those who do not integrate: NF-e by spreadsheet, in the dashboard or via
POST /v1/lotes with "tipo": "nfe". The spreadsheet has no path of its own:
each invoice becomes the body of POST /v1/nfe in calcular mode, and the
per-row result is the same in the dashboard and through the API.
1. Products, just once
The invoice spreadsheet refers to the product by code only. A new product
comes in through the products spreadsheet (or POST /v1/produtos), with the
same validations: NCM, CEST and GTIN refused on the row, with the reason.
| Column | Note |
|---|---|
| Código | The code used in the invoice spreadsheet. |
| Descrição, NCM, Unidade | Required. |
| Origem | Blank: 0 (domestic). |
| GTIN, CEST | Optional. |
| Perfil fiscal | The name of a profile already approved for the company (perfil_fiscal_nome). |
2. The invoice spreadsheet (Básica)
One row per product. Rows with the same number in the Nota column (1, 1, 2...) become a single NF-e. Invoice data (recipient, payment) may be left blank on the following rows; a different value within the same invoice puts the whole invoice in error, pointing at both rows.
| Column | In the API |
|---|---|
| Nota | Groups the rows (not sent to the API). |
| CPF ou CNPJ do destinatário | /destinatario/documento |
| Nome, CEP, Número | CPF only: /destinatario/nome, /destinatario/endereco/cep and /numero. |
| Código do produto | /itens/*/produto |
| Quantidade, Valor unitário | /itens/*/quantidade, /itens/*/valor_unitario |
| Forma de pagamento | /pagamentos/0/forma. Blank: Pix (pix_estatico). |
The Completa spreadsheet adds operation, discount, freight, who pays the
freight, recipient e-mail and additional information. Everything else comes
from rules and appears in ajustes: operation venda
(venda_consumidor_final for CPF), presence outros, the spreadsheet's
series, calcular mode, no freight.
An item outside the engine's coverage is marked with an error and the engine's reason; the invoice never goes out with an estimated value.
3. The NF-e batch
POST /v1/lotes with "tipo": "nfe": JSON (itens = bodies of
POST /v1/nfe) or multipart with planilha. Same states, same
ao_validar and the same LOTE_EMISSAO_CONCLUIDO webhook as the NFS-e batch.
The limit (5,000, or 100 with the test key) counts the invoice items, not
the invoices. GET /v1/lotes/{id}/itens returns one entry per NF-e, with the
spreadsheet linhas and each one's error (linha, coluna, campo).
4. The recipient receives the XML and the DANFE
With a recipient e-mail, Sudrel sends the XML and the DANFE on authorization, and the XML of the cancellation and of the correction letter. Homologação does not send e-mail.