Skip to main content
Key: br-nfe-v4

Scenarios

Scenarios attach notes and extensions to a document when its filters match. Read more about scenarios.
TagsTypeOutput
-standard
credit-note
debit-note
{
  “ext”: {
    “br-nfe-model”: “55”
  }
}
simplifiedstandard
credit-note
debit-note
{
  “ext”: {
    “br-nfe-model”: “65”
  }
}

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.
CodeName
55NF-e
65NFC-e

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.
CodeName
0Not applicable
1In-person operation
2Non-in-person operation, via Internet
3Non-in-person operation, Tele-service
4NFC-e in operation with home delivery
5In-person operation, outside establishment
9Non-in-person operation, others

Payment Method

Code used to identify the payment method used for the transaction.
CodeName
01Cash
02Check
03Credit Card
04Debit Card
05Store Credit
10Food Voucher
11Meal Voucher
12Gift Voucher
13Fuel Voucher
15Bank Slip (Boleto)
16Bank Deposit
17Instant Payment (PIX)
18Bank Transfer, Digital Wallet
19Loyalty Program, Cashback, Virtual Credit
90No Payment
99Others

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.
CodeName
1Has incentive
2Does not have incentive

Tax Regime Code

Indicates the tax regime that a party is subject to.
CodeName
1Simples Nacional
2Simples Nacional, Excess
3Normal

Special Tax Regime Code

Indicates a special tax regime that a party is subject to.
CodeName
1Municipal micro-enterprise
2Estimated
3Professional Society
4Cooperative
5Single micro-entrepreneur (MEI)
6Micro-enterprise or Small Business (ME EPP)

Validation Rules

Validation rules check each struct against a set of assertions and report any failures with a unique code and message. Read more about validation.
FieldTestValidation Code / Message
Invoice
  • Has reason note
GOBL-BR-NFE-V4-BILL-INVOICE-30
A note with key ‘reason’ is required to describe the nature of the operation (natOp)
supplier.tax_id
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-01
Supplier tax ID is required
supplier.tax_id.code
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-02
Supplier tax ID code is required
supplier.addresses[*]
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-03
Supplier address must not be empty
supplier.addresses[*].street
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-04
Supplier address requires a street
supplier.addresses[*].num
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-05
Supplier address requires a number
supplier.addresses[*].locality
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-06
Supplier address requires a locality
supplier.addresses[*].state
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-07
Supplier address requires a state
supplier.addresses[*].code
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-08
Supplier address requires a postal code
supplier.ext
  • Has addresses
  • Ext require [br-ibge-municipality]
GOBL-BR-NFE-V4-BILL-INVOICE-09
Supplier requires ‘br-ibge-municipality’ extension when addresses are present
supplier.name
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-10
Supplier name is required
supplier.addresses
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-11
Supplier must have at least one address
customer
  • Invoice is NFe
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-12
Customer is required for NF-e invoices
customer.addresses
  • Invoice is NFe
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-13
Customer must have at least one address for NF-e invoices
customer.tax_id
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-14
Customer tax ID is required
customer.tax_id.code
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-15
Customer tax ID code is required
customer.addresses[*]
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-16
Customer address must not be empty
customer.addresses[*].street
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-17
Customer address requires a street
customer.addresses[*].num
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-18
Customer address requires a number
customer.addresses[*].locality
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-19
Customer address requires a locality
customer.addresses[*].state
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-20
Customer address requires a state
customer.addresses[*].code
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-21
Customer address requires a postal code
customer.ext
  • Has addresses
  • Ext require [br-ibge-municipality]
GOBL-BR-NFE-V4-BILL-INVOICE-22
Customer requires ‘br-ibge-municipality’ extension when addresses are present
series
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-23
Series is required
series
  • Matches ^(?:0|[1-9][0-9])$
GOBL-BR-NFE-V4-BILL-INVOICE-24
Series format is invalid; must be 0 or 1-999
tax
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-25
Tax is required
tax.ext
  • Ext require [br-nfe-model, br-nfe-presence]
GOBL-BR-NFE-V4-BILL-INVOICE-26
Tax requires ‘br-nfe-model’ and ‘br-nfe-presence’ extensions
tax.ext
  • NFe model
  • Ext ‘br-nfe-presence’ not in [4]
GOBL-BR-NFE-V4-BILL-INVOICE-27
NF-e invoices do not support ‘4’ for ‘br-nfe-presence’
tax.ext
  • NFCe model
  • Ext ‘br-nfe-presence’ in [1, 4]
GOBL-BR-NFE-V4-BILL-INVOICE-28
NFC-e invoices require in-person or delivery for ‘br-nfe-presence’
notes[*].text
  • Reason note
  • Length between 1 and 60
GOBL-BR-NFE-V4-BILL-INVOICE-29
Reason note text must be between 1 and 60 characters
payment
  • Invoice not paid
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-31
Payment is required when invoice is unpaid
payment.instructions
  • Invoice not paid
  • Present
GOBL-BR-NFE-V4-BILL-INVOICE-32
Payment instructions are required when invoice is unpaid
totals.due
Calculated
  • Zero or positive
GOBL-BR-NFE-V4-BILL-INVOICE-33
Due amount must not be negative
FieldTestValidation Code / Message
Line
  • Line has tax category ICMS
GOBL-BR-NFE-V4-BILL-LINE-01
Line taxes must include the ICMS category
Line
  • Line has tax category PIS
GOBL-BR-NFE-V4-BILL-LINE-02
Line taxes must include the PIS category
Line
  • Line has tax category COFINS
GOBL-BR-NFE-V4-BILL-LINE-03
Line taxes must include the COFINS category
FieldTestValidation Code / Message
ext
  • Ext require [br-nfe-payment-means]
GOBL-BR-NFE-V4-PAY-INSTRUCTIONS-01
Payment instructions require ‘br-nfe-payment-means’ extension
FieldTestValidation Code / Message
ext
  • Ext require [br-nfe-payment-means]
GOBL-BR-NFE-V4-PAY-ADVANCE-01
Payment advance requires ‘br-nfe-payment-means’ extension