## Appendix: (BRA) Electronic Nota Fiscal XML Header and Detail Elements

This appendix provides an overview of XML header elements and discusses the elements included in the:

- XML detail for outbound transactions.

- XML detail for inbound transactions.

### Understanding XML Header Elements

The outbound XML file includes the transactions for which you request an electronic nota fiscal (NFe) number from the fiscal authority. The XML file includes many types of information, which are nested within the upper level elements. For example, at the top level, the entire file might be referred to as the eoTransaction. The eoTransaction file includes element headings of:

- eoTransaction-reference

- eoTransaction-header

- eoTransaction-detail

- eoTotals

Each of these four headings includes other element headings.

The sections in this appendix describe the headings, elements, and values for the elements within the outbound and inbound XML transaction files.

### XML Detail for Outbound Transactions

The headings and values for the XML detail for outbound transactions are completed in the same manner for transactions for São Paulo and for non-São Paulo transactions (national transactions). The eoTransaction file includes these headings:

- eoTransaction-reference

- eoTransaction-header

- eoTransaction-detail

- eoTotals

#### eoTransaction-reference Heading

The eoTransaction-reference heading includes these elements and values:

Element | Value
EdiUserId | System user ID.
EdiBatchNumber | System assigned number.
EdiTransactNumber | Increment sequence number for each batch number.
EdiLineNumber | 1
EdiInternalReference | The nota fiscal number, which is generated from the Nota Fiscal Header - Brazil (F7601B) table. The system uses the format DD-AA-999999, where DD is equal to the value in the DCT field, AA is equal to the value in the BSER field, and 999999 is equal to the value in the BNNF field.
EdiTransmissionDate | System date in the format defined by the user.
EdiTransmissionTime | System time in the format HH:MM:SS.
EdiTransDirection | Outbound
EdiTransType | BRNFO

#### eoTransaction-header Heading

The eoTransaction-header heading includes these sublevel headings:

- NFIdentification

- LegalCompanyInformation

- IdentificationOfAddressee

- DispatchPlace

- DeliveryPlace

- Transporter

NFIdentification

These elements and values appear under the NFIdentification heading:

Element | Value
FiscalDocumentDate | The value of ISSU in the F7601B table.
MovementDate | The value of ISSU in the F7601B table.
FiscalDocumentType | 1
NFNumber | The nota fiscal number, which is generated from the F7601B table. The system uses the format DD-AA-999999, where DD is equal to the value in the DCT field, AA is equal to the value in the BSER field, and 999999 is equal to the value in the BNNF field.
NotaFiscalTotal | The value of BVTN in the F7601B table.
NotaFiscalDiscount | The value of BDES in the F7601B table.

LegalCompanyInformation

The LegalCompanyInformation header and subordinate elements include information that is associated with the reporting company. These elements and values appear under the LegalCompanyInformation heading:

Element | Value
CO-FiscalLegalId | The value of TAX in the Address Book Master table (F0101).
CO-Name | The value of MLNM in the F0111 table.
CO-Address | The concatenated values of ADD1, ADD2, ADD3, and ADD4 in the Address by Date table (F0116).
CO-NeighborhoodCode | The neighborhood code that is set up for the address book record, based on the supplemental database and processing options.
CO-NeighborhoodName | The name that is associated with the neighborhood code as set up in the 76B/NE UDC table.
CO-MunicipalCode | The municipal code that is set up for the address book record, based on the supplemental database and processing options.
CO-MunicipalName | The name that is associated with the municipal code as set up in the 76B/FC UDC table.
CO-UFCode | A value from the 76B/UF UDC table.
CO-PostalCode | The value of ADDZ in the F0116 table.
CO-CountryCode | The code for the country from the 76B/CD UDC table.
CO-CountryName | The description for the country from the 76B/CD user-defined code (UDC) table.
CO-PhoneNumber | The values of PAR1 and PH1 in the Address Book - Phone Numbers table (F0115).
CO-StateID | The value of TX2 in the F0101 table if the value in the tax code field represents a person.
CO-MunicipalID | The value of BMUN in the Address Book Brazilian Tag Table (F76011).
CO-TaxCode | If the value of TAXC in the F0101 table is 1, 2, or P, then P. Any other value for the TAXC field will cause the system to use C.

IdentificationOfAddressee

The IdentificationOfAddressee header and subordinate elements include information that is associated with the addressee on the nota fiscal. These elements and values appear under the IdentificationOfAddressee heading:

Element | Value
AD-FiscalLegalID | The value of TAX in the F0101 table.
AD-FederalFiscalID | The value of BCPF in the F76011 table.
AD-Name | The value ofMLNM in the F0111 table.
AD-Address | The concatenated values of ADD1, ADD2, ADD3, and ADD4 in the F0116 table.
AD-NeighborhoodCode | The neighborhood code that is set up for the address book record, based on the supplemental database and processing options.
AD-NeighborhoodName | The name that is associated with the neighborhood code as set up in the 76B/NE UDC table.
AD-MunicipalCode | The municipal code that is set up for the address book record, based on the supplemental database and processing options.
AD-MunicipalName | The name that is associated with the municipal code as set up in the 76B/FC UDC table.
AD-UFCode | A value from the 76B/UF UDC table.
AD-City | The value of CTY1 in the F0116 table.
AD-PostalCode | The value of ADDZ in the F0116 table.
AD-CountryCode | The code for the country from the 76B/CD UDC table.
AD-CountryName | The description of the country from the 76B/CD UDC table.
AD-PhoneNumber | The values of PAR1 and PH1 in the F0115 table.
AD-StateID | The value of TX2 in the F0101 table if the value in the tax code field represents a person.
AD-SUFRAMA-ID | The value of BISC in the F76011 table.
AD-MunicipalID | The value of BMUN in the F76011 table.
AD-Email | The value for EMAL in the Electronic Address table (F01151).
AD-TaxCode | If the value of TAXC in the F0101 table is 1, 2, or P, then P. Any other value for the TAXC field will cause the system to use C.

DispatchPlace

The DispatchPlace header and subordinate elements include information that is associated with the location from which the nota fiscal is issued. These elements and values appear under the DispatchPlace heading:

Element | Value
DP-FiscalLegalID | The value of TAX in the F0101 table.
DP-Address | The concatenated values of ADD1, ADD2, ADD3, and ADD4 in the F0116 table.
DP-NeighborhoodCode | The neighborhood code that is set up for the address book record, based on the supplemental database and processing options.
DP-NeighborhoodName | The name that is associated with the neighborhood code as set up in the 76B/NE UDC table.
DP-MunicipalCode | The municipal code that is set up for the address book record, based on the supplemental database and processing options
DP-MunicipalName | The name that is associated with the municipal code as set up in the 76B/FC UDC table.
DP-UFCode | A value from the 76B/UF UDC table.

DeliveryPlace

The DeliveryPlace header and subordinate elements include information that is associated with the location to which the nota fiscal is delivered. These elements are populated for the delivery place address book number from the Address Number Ship-To field of the F7601B table. These elements appear under the DeliveryPlace heading:

Element | Value
LP-FiscalLegalID | The value of TAX in the F0101 table.
LP-Address | The concatenated values of ADD1, ADD2, ADD3, and ADD4 in the F0116 table.
LP-NeighborhoodCode | The neighborhood code that is set up for the address book record, based on the supplemental database and processing options.
LP-NeighborhoodName | The name that is associated with the neighborhood code as set up in the 76B/NE UDC table.
LP-MunicipalCode | The municipal code that is set up for the address book record, based on the supplemental database and processing options.
LP-MunicipalName | The name that is associated with the municipal code as set up in the 76B/FC UDC table.
LP-UFCode | A value from the 76B/UF UDC table.

Transporter

These elements are populated for the transporter address book number from the Carrier field of the F7601B table. Data for the transporter is written to the file only when the information is defined in the software tables. These elements appear under the Transporter heading:

Element | Value
TRA-FreightMode | 0
TRA-FiscalLegalID | The value of TAX in the F0101 table.
TRA-FederalFiscalID | The value of BCPF in the F76011 table.
TRA-Name | The value of MLNM in the F0111 table.
TRA-StateID | If the value of TAXC in the F0101 table is 1, 2, or P, then the value ofTX2 in the F0101 table.
TRA-Address | The concatenated values of ADD1, ADD2, ADD3, and ADD4 in the F0116 table.
TRA-NeighborhoodCode | The neighborhood code that is set up for the address book record, based on the supplemental database and processing options.
TRA-NeighborhoodName | The name that is associated with the neighborhood code as set up in the 76B/NE UDC table.
TRA-MunicipalCode | The municipal code that is set up for the address book record, based on the supplemental database and processing options.
TRA-MunicipalName | The name that is associated with the municipal code as set up in the 76B/FC UDC table.
TRA-UFCode | A value from the 76B/UF UDC table.
VEH-License | The value of LICP in the F7601B table.
VEH-UFCode | A value from the 76B/UF UDC table.
VOL-TotalQuantity | The value of TOQN in the F7601B table.
VOL-Spec | The value of EQIP in the F7601B table.
VOL-TotalWeight | The value of TOWT in the F7601B table.
VOL-UnitWeight | The value of ITWT in the F7601B table.

#### eoTransaction-detail Heading

The eoTransaction-detail heading includes these sublevel headings:

- NFLine

- NFL-ICMSOperation

- NFL-ICMSSubstitution

- NFL-IPI

- NFL-ImportTax

- NFL-PIS

- NFL-COFINS

- NFL-ISS

- NFL-AdditionalInformation

- NFL-ServiceDescriptionCode

- NFL-ServiceDescription

NFLine

The NFLine header and subordinate elements include information for each line of the nota fiscal. These elements and values appear under the NFLine heading:

Element | Value
LNLineNumber | The value of UKID in the Nota Fiscal Detail - Brazil table (F7611B).
LNProductType | If the transaction nature code (BNOP) in the F7611B table exists in the 76B/TT UDC table, then the system uses Goods for this element. Otherwise, the system uses Services for this element.
LNItemNumber | The value of LITM in the F7611B table. If the LITM field is blank, then the system writes CFOP9999.
LNItemDescription | The value for DSC1 in the F7611B table.
LNTaxCodeICMS | The value for BSTT in the F7611B table.
LNTransactionNatureCode | The value for BNOP in the F7611B table.
LNServiceCode | If the value for BNOP in the F7611B table exists in the 76B/TC UDC table, then the system uses the value from the Description 02 field of the UDC value for the BNOP.
LNTaxableUnit | The value for UOM in the F7611B table.
LNTaxableQuantity | The value for UORG in the F7611B table.
LNAmountPerUnit | The value for UPRC in the F7611B table.
LNAmountFreights | The value for BFRT in the F7611B table.
LNAmountInsurance | The value for BSEG in the F7611B table.
LNAmountDiscount | The value for BDES in the F7611B table.

NFL-ICMSOperation

These elements and values appear under the NFL-ICMSOperation heading:

Element | Value
ICMSO-CalcMode | 3
ICMSO-Discount | The value of BISR in the ICMS Tax Rates table (F7608B).
ICMSO-Taxable | The value of BBCL in the F7611B table.
ICXMO-TaxRate | The value of TRX1 in the F7611B table.
ICMSO-Amount | The value of BICM in the F7611B table.

NFL-ICMSSubstitution

These elements and values appear under the NFL-ICMSSubstitution heading:

Element | Value
ICMSS-CalcMode | 0
ICMSS-PercentageMargin | The value of BISF in the F7608B table.
ICMSS-Discount | The value of BISR in the F7608B table.
ICMSS-Taxable | The value of BBIS in the F7611B table.
ICMSS-TaxRate | The value of TRX1 in the F7611B table.
ICMSS-Amount | The value of BVIS in the F7611B table.

NFL-IPI

These elements and values appear under the NFL-IPI heading:

Element | Value
IPI-CalcMode | 2
IPI-Taxable | The value of BBTP in the F7611B table.
IPI-TaxRate | The value of TRX2 in the F7611B table.
IPI-Amount | The value of BIPI in the F7611B table.

NFL-ImportTax

These elements and values appear under the NFL-ImportTax heading:

Element | Value
II-Taxable | The value of BBCI in the F7611B table.
II-Amount | The value of BITT in the F7611B table.

NFL-PIS

These elements and values appear under the NFL-PIS heading:

Element | Value
PIS-CalcMode | 3
PIS-Taxable | Using a value of 05 for the BRTX field, the system finds the value of BRTXB in the F76B011 table.
PIS-TaxRate | Using a value of 05 for the BRTX field, the system finds the value of BRTXR in the F76B011 table.
PIS-Quantity | The value of UORG in the F7611B table.
PIS-Amount | Using a value of 05 for the BRTX field, the system finds the value of BRTXA in the F76B011 table.

NFL-COFINS

These elements appear under the NFL-COFINS heading:

Element | Value
COFINS-CalcMode | 3
COFINS-Taxable | Using a value of 06 for the BRTX field, the system finds the value of BRTXB in the F76B011 table.
COFINS-TaxRate | Using a value of 06 for the BRTX field, the system finds the value of BRTXR in the F76B011 table.
COFINS-Quantity | The value of UORG in the F7611B table.
COFINS-Amount | Using a value of 06 for the BRTX field, the system finds the value of BRTXA in the F76B011 table.

NFL-ISS

These elements and values appear under the NFL-ISS heading:

Element | Value
ISS-NonTaxable | The value of BBCL in the F7611B table.
ISS-Taxable | The value of BBCS in the F7611B table.
ISS-TaxRate | The value of TXR3 in the F7611B table.
ISS-Amount | The value of BISS in the F7611B table.
ISS-PIS-Services | The value of the PIS-Taxable element.
ISS-COFINS-Services | The value of the COFINS-Taxable element.

NFL-AdditionalInformation, NFL-ServiceDescriptionCode, and NFLServiceDescription

The NFL-AdditionalInformation, NFL-ServiceDescriptionCode, and NFL-ServiceDescription headings do not have other elements within them. This table shows the values for these headings:

Element | Value
NFL-AdditionalInformation | The value of DSC2 in the F7611B table.
NFL-ServiceDescriptionCode | The value of BINM in the F7611B table.
NFL-ServiceDescription | Using the value of BINM from the F7611B table, the system finds the value for the Description 01 field in the 40/PM UDC table.

#### eoTotals

The eoTransaction-header heading includes these sublevel headings:

- Total-ICMS

- Total-ISSQN

Total-ICMS

The Total-ICMS heading and subordinate elements include the totals for all lines on each nota fiscal. These elements and values appear under the Total-ICMS heading:

Element | Value
Total-ICMS-Taxable | The sum of all of the ICMSO-Taxable elements.
Total-ICMS | The sum of all of the ICMSO-Amount elements.
Total-ICMS-ST-Taxable | The sum of all of the ICMSS-Taxable elements.
Total-ICMS-ST | The sum of all of the ICMSS-Amount elements.
Total-Amount | The sum of all of the LNAmountPerUnit elements.
Total-Freight | The sum of all of the LNAmountFreights elements.
Total-Insurance | The sum of all of the LNAmountInsurance elements.
Total-Discount | The sum of all of the LNAmountDiscount elements.
Total-II | The sum of all of the II-Amount elements.
Total-IPI | The sum of all of the IPI-Amount elements.
Total-PIS | The sum of all of the PIS-Amount elements.
Total-COFINS | The sum of all of the COFINS-Amount elements.
Total-FinancialExpenses | The sum of the values for the BDFN field in the F7611B table for all reported records.
Total-NF | The total of the nota fiscal.

Total-ISSQN

These elements appear under the Total-ISSQN heading:

Element | Value
Total-NonTaxable | The sum of all of the ISS-NonTaxable elements.
Total-ISS-Taxable | The sum of all of the ISS-Taxable elements.
Total-ISS | The sum of all of the ISS-Amount elements.
Total-PIS-Services | The sum of all of the ISS-PIS-Services elements.
Total-COFINS-Services | The sum of all of the ISS-COFINS-Services elements.

### XML Detail for Inbound Transactions

The transactions in the inbound XML file for São Paulo have a transaction type of BRNFI-SP. The transactions in the inbound XML file for national transactions have a transaction type of BRNFI-NA. The eoTransaction file includes these headings:

- eoTransaction-reference

- eoTransaction-header

- eoTransaction-detail

  Note. This heading is found in the XML file for São Paulo only.

#### eoTransaction-reference (Inbound São Paulo and National)

The eoTransaction-reference heading includes these sublevel headings and values:

Element | Value
EdiUserId | System user ID.
EdiBatchNumber | A system assigned number.
EdiTransactNumber | Increment sequence number for each batch number.
EdiLineNumber | 1
EdiInternalReference | The reference number of the outbound transaction file.
EdiTransmissionDate | System date in the format DD/MM/YY.
EdiTransmissionTime | System time in the format HH:MM:SS.

#### eoTransaction-header (Inbound São Paulo and National)

The elements for the inbound file are written to these fields in the NF Header table (F76B01TE):

Element | Value
LegalNumber | B76ELN
LegalNumberDate | B76ELND
LegalNumberTime | B76ELNT
VerificationCode | B76EREF
ReceiptSerie | B76ERN
DocumentStatus | B76EST
DocumentStatusDate | B76ESTD
GuideNumber Note. This element is found in São Paulo transactions only. | B76EAN
ErrorCode | B76ESTC
ErrorDescription | Blob
ErrorDescriptionExt | Blob

#### eoTransaction-detail (Inbound São Paulo)

Each detail section can include multiple NFLine elements. The NFLine elements are written to these fields in the F76B11TE table:

Element | Value
LineNumber | UKID
NewISSAmount | B76ECSS
CreditAmount | B76EGA1