Skip to main content

UBL XML to FatturaPA Mapping Reference

This document describes how UBL XML (Universal Business Language) invoice fields are mapped to the Italian FatturaPA XML invoice format.

DatiTrasmissione​

Fields below fatturaElettronicaHeader.datiTrasmissione
FatturaPA FieldUBL XML
AccountingCustomerParty > Party > EndpointID[@schemeID="0205" and string-length(normalize-space(.))=7 and translate(normalize-space(.), "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "")=""]Only when: EndpointID scheme 0205 is a 7 character private SDI code

CedentePrestatore​

Fields below fatturaElettronicaHeader.cedentePrestatore* required
FatturaPA FieldUBL XML
AccountingSupplierParty > Party > PartyTaxScheme[TaxScheme > ID="VAT"] > CompanyID
AccountingSupplierParty > Party > PartyTaxScheme[TaxScheme > ID="VAT"] > CompanyID
AccountingSupplierParty > Party > PartyLegalEntity > RegistrationNameOnly when: seller declares a legal registration name
Only when: business registry provides RegimeFiscale
AccountingSupplierParty > Party > PostalAddress > StreetName
AccountingSupplierParty > Party > PostalAddress > PostalZone
AccountingSupplierParty > Party > PostalAddress > CityName
AccountingSupplierParty > Party > PostalAddress > CountrySubentity[string-length(normalize-space(.))=2 and translate(normalize-space(.), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "")=""]
AccountingSupplierParty > Party > PostalAddress > Country > IdentificationCode

CessionarioCommittente​

Fields below fatturaElettronicaHeader.cessionarioCommittente* required
FatturaPA FieldUBL XML
AccountingCustomerParty > Party > PartyTaxScheme[TaxScheme > ID="VAT"] > CompanyIDOnly when: buyer has an explicit VAT identifier
AccountingCustomerParty > Party > PartyTaxScheme[TaxScheme > ID="VAT"] > CompanyIDOnly when: buyer has an explicit VAT identifier
AccountingCustomerParty > Party > PartyIdentification[ID > @schemeID="IT:CF" or ID > @schemeID="CF"] > IDOnly when: buyer has an explicit Italian fiscal code
AccountingCustomerParty > Party > PartyLegalEntity > RegistrationNameOnly when: buyer declares a legal registration name
AccountingCustomerParty > Party > PostalAddress > StreetName
AccountingCustomerParty > Party > PostalAddress > PostalZone[string-length(normalize-space(.))=5 and translate(normalize-space(.), "0123456789", "")=""]Only when: buyer country is Italy
AccountingCustomerParty > Party > PostalAddress > CityName
AccountingCustomerParty > Party > PostalAddress > CountrySubentity[string-length(normalize-space(.))=2 and translate(normalize-space(.), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "")=""]
AccountingCustomerParty > Party > PostalAddress > Country > IdentificationCode

DatiGeneraliDocumento​

Fields below fatturaElettronicaBody[0].datiGenerali.datiGeneraliDocumento* required
FatturaPA FieldUBL XML
cbc:InvoiceTypeCode
cbc:DocumentCurrencyCode
cbc:IssueDate
cbc:ID

DatiOrdineAcquisto​

Fields below fatturaElettronicaBody[0].datiGenerali.datiOrdineAcquisto[0]
FatturaPA FieldUBL XML
OrderReference > ID

DatiTrasporto​

Fields below fatturaElettronicaBody[0].datiGenerali.datiTrasporto.indirizzoResa* required
FatturaPA FieldUBL XML
Delivery > DeliveryLocation > Address > StreetNameOnly when: invoice contains a delivery address node
Delivery > DeliveryLocation > Address > PostalZoneOnly when: invoice contains a delivery address node; delivery address is in Italy
Delivery > DeliveryLocation > Address > CityNameOnly when: invoice contains a delivery address node
Delivery > DeliveryLocation > Address > CountrySubentity[string-length(normalize-space(.))=2 and translate(normalize-space(.), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "")=""]Only when: invoice contains a delivery address node
Delivery > DeliveryLocation > Address > Country > IdentificationCodeOnly when: invoice contains a delivery address node

DettaglioLinee​

Fields below fatturaElettronicaBody[0].datiBeniServizi* required
FatturaPA FieldUBL XML
cac:InvoiceLine

fatturaElettronicaBody[0].datiBeniServizi.dettaglioLinee​

FatturaPA FieldUBL XML
cbc:ID
(Item > Description | Item > Name)[1]
InvoicedQuantity > @unitCode
cbc:InvoicedQuantity
Price > PriceAmountOnly when: the UBL price base is strictly positive
cbc:LineExtensionAmount
Item > ClassifiedTaxCategory > Percent
Item > AdditionalItemProperty[Name="Natura"] > Value[contains("|N1|N2.1|N2.2|N3.1|N3.2|N3.3|N3.4|N3.5|N3.6|N4|N5|N6.1|N6.2|N6.3|N6.4|N6.5|N6.6|N6.7|N6.8|N6.9|N7|", concat("|", normalize-space(.), "|"))]Only when: line VAT rate is zero; line contains an explicit FatturaPA Natura
Fields below fatturaElettronicaBody[0]
FatturaPA FieldUBL XML
Only when: invoice contains at least one source line
Only when: invoice contains at least one source line

DatiPagamento​

Fields below fatturaElettronicaBody[0].datiPagamento[0]* required
FatturaPA FieldUBL XML
PaymentTerms > NoteOnly when: payment terms explicitly use TP01, TP02 or TP03
PaymentMeans > PaymentMeansCodeOnly when: payment terms explicitly use TP01, TP02 or TP03
cbc:DueDateOnly when: payment terms explicitly use TP01, TP02 or TP03
LegalMonetaryTotal > PayableAmountOnly when: payment terms explicitly use TP01, TP02 or TP03
PaymentMeans > PayeeFinancialAccount > IDOnly when: payment terms explicitly use TP01, TP02 or TP03
PaymentMeans > PaymentIDOnly when: payment terms explicitly use TP01, TP02 or TP03

Allegati​

Fields below fatturaElettronicaBody[0]
FatturaPA FieldUBL XML
AdditionalDocumentReference[Attachment > EmbeddedDocumentBinaryObject]

fatturaElettronicaBody[0].allegati​

FatturaPA FieldUBL XML
Attachment > EmbeddedDocumentBinaryObject > @filename
Attachment > EmbeddedDocumentBinaryObject > @filename
Attachment > EmbeddedDocumentBinaryObject