Skip to main content
Key: br-nfe-v4 Module: github.com/invopop/gobl.br.nfe

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
  • debit-note

Stamp Keys

Stamp keys from the previous invoice that need to be referenced:
  • sefaz-key

Scenarios

bill/invoice

Filters:
  • Types: standard, credit-note, debit-note
Output:
  • Extensions: br-nfe-model:55
Filters:
  • Types: standard, credit-note, debit-note
  • Tags: simplified
Output:
  • Extensions: br-nfe-model:65
Filters:
  • Types: standard
Output:
  • Extensions: br-nfe-operation-type:1, br-nfe-purpose:1

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.

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.

Payment Method

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

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.
Pattern: ^[1-7]\d{3}$

Fiscal Incentive Indicator

Indicates whether a party benefits from a fiscal incentive.

Tax Regime Code

Indicates the tax regime that a party is subject to. Defaults to 3 (normal regime) during normalization when not provided.

Special Tax Regime Code

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

ICMS Tax Status Code (CST)

ICMS tax status code (CST) for the line item, used by issuers under the normal regime (br-nfe-regime 3). Simples Nacional issuers must use the CSOSN code (br-nfe-icms-csosn) instead. Defaults to 00 (taxed in full) during normalization when not provided.

ICMS Simples Nacional Status Code (CSOSN)

ICMS status code (CSOSN) for the line item, used by issuers under the Simples Nacional regime (br-nfe-regime 1, 2 or 4). Normal-regime issuers must use the CST code (br-nfe-icms-cst) instead.

ICMS Goods Origin

Origin of the goods for ICMS purposes. Defaults to 0 (national) during normalization when not provided.

PIS Tax Status Code (CST)

PIS tax status code for the line item. Simples Nacional issuers typically use 49 or 99, as PIS is settled within the unified DAS collection. Defaults to 01 (standard-rate taxable operation) during normalization when not provided.

COFINS Tax Status Code (CST)

COFINS tax status code for the line item. Simples Nacional issuers typically use 49 or 99, as COFINS is settled within the unified DAS collection. Defaults to 01 (standard-rate taxable operation) during normalization when not provided.

Purpose Code

Code that identifies the purpose of the fiscal document (SEFAZ field finNFe, B25). Standard invoices are set to 1 (normal) via a tax scenario.

Operation Type Code

Code that identifies the type of operation, indicating whether it is inbound or outbound (SEFAZ field tpNF, B11). Standard invoices are set to 1 (outbound) via a tax scenario.

Credit Note Type Code

Code that identifies the type of credit note (SEFAZ field tpNFCredito, B25.2) according to the RTM (applies to IBS/CBS only).

Debit Note Type Code

Code that identifies the type of debit note (SEFAZ field tpNFDebito, B25.1) according to the RTM (applies to IBS/CBS only).

Validation Rules