UBL (XRechnung) field mapping

This table shows how Tungsten AP Essentials maps internal fields to UBL fields in XRechnung format.

These field mappings apply only to UBL in XRechnung format.

UBL in XRechnung format is similar to other UBL formats. However, UBL in XRechnung format contains a BuyerReference field, which other UBL formats do not include. AP Essentials identifies a document as an XRechnung invoice only if the CustomizationID node contains "xrechnung" and the BuyerReference field is present. If either condition is not met, AP Essentials uses legacy mappings. Otherwise, AP Essentials uses the following table to map fields.

Tungsten AP Essentials internal field name

UBL in XRechnung format

For invoices, replace "…" with "/inv:Invoice"

For credit notes, replace "…" with "/cn:CreditNote"

Buyer fields
Name …/AccountingCustomerParty/Party/PartyLegalEntity/RegistrationName
Identifier …/AccountingCustomerParty/Party/PartyIdentification/ID
Street …/AccountingCustomerParty/Party/PostalAddress/StreetName
StreetSupplement …/AccountingCustomerParty/Party/PostalAddress/AdditionalStreetName
BuyerAddressPostalCode …/AccountingCustomerParty/Party/PostalAddress/PostalZone
City …/AccountingCustomerParty/Party/PostalAddress/CityName
CountryCode …/AccountingCustomerParty/Party/PostalAddress/Country/IdentificationCode
TelephoneNumber …/AccountingCustomerParty/Party/Contact/Telephone
EMail …/AccountingCustomerParty/Party/Contact/ElectronicMail
BuyerVATRegistrationNumber …/AccountingCustomerParty/Party/PartyTaxScheme/CompanyID

Only takes the value from the section in which the value of …/AccountingCustomerParty/Party/PartyTaxScheme/TaxScheme/ID is equal to "VAT".

Supplier fields
Name …/AccountingSupplierParty/Party/PartyLegalEntity/RegistrationName
Identifier …/AccountingSupplierParty/Party/PartyIdentification/ID
Street …/AccountingSupplierParty/Party/PostalAddress/StreetName
StreetSupplement …/AccountingSupplierParty/Party/PostalAddress/AdditionalStreetName
SupplierAddressPostalCode …/AccountingSupplierParty/Party/PostalAddress/PostalZone
City …/AccountingSupplierParty/Party/PostalAddress/CityName
CountryCode …/AccountingSupplierParty/Party/PostalAddress/Country/IdentificationCode
TelephoneNumber …/AccountingSupplierParty/Party/Contact/Telephone
EMail …/AccountingSupplierParty/Party/Contact/ElectronicMail
SupplierVATRegistrationNumber …/AccountingSupplierParty/Party/PartyTaxScheme/CompanyID

Only takes the value from the section in which the value of …/AccountingSupplierParty/Party/PartyTaxScheme/TaxScheme/ID is equal to "VAT".

SupplierTaxNumber1 …/AccountingSupplierParty/Party/PartyTaxScheme/CompanyID

Only takes the value from the section in which the value of …/AccountingSupplierParty/Party/PartyTaxScheme/TaxScheme/ID is equal to "TAX".

Header fields
InvoiceCredit

For invoices, the value is taken from …/InvoiceTypeCode. The value is 1 if the code is 381, 396, 261, 262, 296, or 308; otherwise the value is 0.

For credit notes, the value is always 1. No element is read.

InvoiceNumber …/ID
InvoiceDate …/IssueDate
InvoiceDueDate …/DueDate

If the node does not exist, the value is taken from this alternate location:

…/PaymentMeans/PaymentDueDate

InvoiceTypeId

For invoices: …/InvoiceTypeCode

For credit notes: …/CreditNoteTypeCode

BusinessProcessTypeId …/ProfileID
InvoiceCurrency …/DocumentCurrencyCode
InvoiceTaxCurrency …/TaxCurrencyCode
InvoiceTotalVatExcludedAmount …/LegalMonetaryTotal/TaxExclusiveAmount
InvoiceTotalVatIncludedAmount …/LegalMonetaryTotal/TaxInclusiveAmount
InvoiceTotalLineAmount …/LegalMonetaryTotal/LineExtensionAmount
InvoicePrepaidAmount …/LegalMonetaryTotal/PrepaidAmount
InvoiceTotalAmountDue …/LegalMonetaryTotal/PayableAmount
DeliveryCost …/LegalMonetaryTotal/ChargeTotalAmount
InvoiceDiscountAmount …/LegalMonetaryTotal/AllowanceTotalAmount
InvoiceTotalVATAmount …/TaxTotal/TaxAmount

Takes the value from the node whose currencyID attribute matches …/DocumentCurrencyCode. If no node matches, the value is taken from the first node.

SupplierTaxNumber1 …/AccountingSupplierParty/Party/PartyTaxScheme/CompanyID

Only takes the value from the section in which the value of …/AccountingSupplierParty/Party/PartyTaxScheme/TaxScheme/ID is equal to "TAX".

TotalTaxAmountInTaxCurrency …/TaxTotal/TaxAmount

Takes the value from the node whose currencyID attribute matches …/TaxCurrencyCode.

InvoiceTotalVatRatePercent …/TaxTotal/TaxSubtotal/TaxCategory/Percent

Takes the value from the section in which the value of …/TaxTotal/TaxSubtotal/TaxCategory/ID is equal to "S". If no section matches, the value is taken from the first section.

InvoiceTaxAmount1, InvoiceTaxAmount2, InvoiceTaxAmount3, InvoiceTaxAmount4 …/TaxTotal/TaxSubtotal[n]/TaxAmount

The first TaxSubtotal node is mapped to InvoiceTaxAmount1, the second node is mapped to InvoiceTaxAmount2, and so on.

InvoiceTaxRate1, InvoiceTaxRate2, InvoiceTaxRate3, InvoiceTaxRate4 …/TaxTotal/TaxSubtotal[n]/TaxCategory/Percent

The first TaxSubtotal node is mapped to InvoiceTaxRate1, the second node is mapped to InvoiceTaxRate2, and so on.

InvoiceNetAmount1, InvoiceNetAmount2, InvoiceNetAmount3, InvoiceNetAmount4 …/TaxTotal/TaxSubtotal[n]/TaxableAmount

The first TaxSubtotal node is mapped to InvoiceNetAmount1, the second node is mapped to InvoiceNetAmount2, and so on.

InvoiceTaxCode1, InvoiceTaxCode2, InvoiceTaxCode3, InvoiceTaxCode4 …/TaxTotal/TaxSubtotal[n]/TaxCategory/ID

The first TaxSubtotal node is mapped to InvoiceTaxCode1, the second node is mapped to InvoiceTaxCode2, and so on.

InvoiceTaxType1, InvoiceTaxType2, InvoiceTaxType3, InvoiceTaxType4 …/TaxTotal/TaxSubtotal[n]/TaxCategory/TaxScheme/ID

The first TaxSubtotal node is mapped to InvoiceTaxType1, the second node is mapped to InvoiceTaxType2, and so on.

InvoiceTaxDescription1, InvoiceTaxDescription2, InvoiceTaxDescription3, InvoiceTaxDescription4 …/TaxTotal/TaxSubtotal[n]/TaxCategory/TaxExemptionReason

The first TaxSubtotal node is mapped to InvoiceTaxDescription1, the second node is mapped to InvoiceTaxDescription2, and so on.

DiscountAmount1, DiscountAmount2, DiscountAmount3, DiscountAmount4

Each of the four discount amount fields is mapped by iterating through each …/AllowanceCharge node whose child node, ChargeIndicator, equals false. The field value is then taken from …/AllowanceCharge/Amount.

The first matching node is mapped to DiscountAmount1. The second matching node is mapped to DiscountAmount2 and so on.

ChargeAmount1, ChargeAmount2, ChargeAmount3, ChargeAmount4

Each of the four charge amount fields is mapped by iterating through each …/AllowanceCharge node whose child node, ChargeIndicator, equals true. The field value is then taken from …/AllowanceCharge/Amount.

The first matching node is mapped to ChargeAmount1. The second matching node is mapped to ChargeAmount2 and so on.

InvoiceOrderNumber …/OrderReference/ID
SalesOrderNumber …/OrderReference/SalesOrderID
ContractNumber …/ContractDocumentReference/ID
DeliveryNote …/DespatchDocumentReference/ID
ReceiptAdviceReference …/ReceiptDocumentReference/ID
TenderReference …/OriginatorDocumentReference/ID
PrecedingInvoiceNumber …/BillingReference/InvoiceDocumentReference/ID
ProjectNumber …/ProjectReference/ID
BuyerContactReference …/BuyerReference
InvoiceObject …/AdditionalDocumentReference/ID

Takes the value from the first node whose DocumentTypeCode child node equals "130".

AdditionalReference1 …/AdditionalDocumentReference/ID

Takes the value from the first node whose DocumentTypeCode child node does not equal "130".

InvoiceNoteText1 …/Note

Takes the value from the first occurrence.

InvoicingPeriodStart …/InvoicePeriod/StartDate
InvoicingPeriodEnd …/InvoicePeriod/EndDate
DeliveryDate …/Delivery/ActualDeliveryDate
DeliveryAddressName …/Delivery/DeliveryParty/PartyName/Name
DeliveryAddressStreet …/Delivery/DeliveryLocation/Address/StreetName

and

…/Delivery/DeliveryLocation/Address/AdditionalStreetName

with a space between the values.

DeliveryAddressZip …/Delivery/DeliveryLocation/Address/PostalZone
DeliveryAddressCity …/Delivery/DeliveryLocation/Address/CityName
DeliveryAddressCountry …/Delivery/DeliveryLocation/Address/Country/IdentificationCode
PaymentType …/PaymentMeans/PaymentMeansCode

Takes the distinct values from all PaymentMeans nodes, separated by spaces. For example, the codes 58, 30, 30, and 58 give "58 30".

PaymentChannelCode is not read.

PaymentTerms …/PaymentTerms/Note
PaymentReferenceNumber …/PaymentMeans/PaymentID
SupplierIBAN1, SupplierIBAN2, SupplierIBAN3, SupplierIBAN4 …/PaymentMeans/PayeeFinancialAccount/ID

Takes the value from each PaymentMeans node that contains a PayeeFinancialAccount node. The first matching node is mapped to SupplierIBAN1, the second node is mapped to SupplierIBAN2, and so on.

SupplierSWIFT1, SupplierSWIFT2, SupplierSWIFT3, SupplierSWIFT4 …/PaymentMeans/PayeeFinancialAccount/FinancialInstitutionBranch/ID

Takes the value from each PaymentMeans node that contains a PayeeFinancialAccount node. The first matching node is mapped to SupplierSWIFT1, the second node is mapped to SupplierSWIFT2, and so on.

BuyerAddressPostalCode …/AccountingCustomerParty/Party/PostalAddress/PostalZone
SupplierAddressPostalCode …/AccountingSupplierParty/Party/PostalAddress/PostalZone
BuyerVATRegistrationNumber …/AccountingCustomerParty/Party/PartyTaxScheme/CompanyID

Only takes the value from the section in which the value of …/AccountingCustomerParty/Party/PartyTaxScheme/TaxScheme/ID is equal to "VAT".

SupplierVATRegistrationNumber …/AccountingSupplierParty/Party/PartyTaxScheme/CompanyID

Only takes the value from the section in which the value of …/AccountingSupplierParty/Party/PartyTaxScheme/TaxScheme/ID is equal to "VAT".

SupplierEndpointID …/AccountingSupplierParty/Party/EndpointID
BuyerEndpointID …/AccountingCustomerParty/Party/EndpointID
BuyerContactPersonName …/AccountingCustomerParty/Party/Contact/Name
Line-item fields
LIT_RowIdentifier

For invoices: …/InvoiceLine/ID

For credit notes: …/CreditNoteLine/ID

LIT_ArticleIdentifier

For invoices: …/InvoiceLine/Item/SellersItemIdentification/ID

For credit notes: …/CreditNoteLine/Item/SellersItemIdentification/ID

LIT_ArticleName

For invoices: …/InvoiceLine/Item/Name

For credit notes: …/CreditNoteLine/Item/Name

LIT_ArticleDescription

For invoices: …/InvoiceLine/Item/Description

For credit notes: …/CreditNoteLine/Item/Description

LIT_BuyerArticleNumber

For invoices: …/InvoiceLine/Item/BuyersItemIdentification/ID

For credit notes: …/CreditNoteLine/Item/BuyersItemIdentification/ID

LIT_UniqueArticleNumber

For invoices: …/InvoiceLine/Item/StandardItemIdentification/ID

For credit notes: …/CreditNoteLine/Item/StandardItemIdentification/ID

LIT_DeliveredQuantity

For invoices: …/InvoiceLine/InvoicedQuantity

For credit notes: …/CreditNoteLine/CreditedQuantity

LIT_DeliveredQuantityUnitCode

For invoices: …/InvoiceLine/InvoicedQuantity/@unitCode

For credit notes: …/CreditNoteLine/CreditedQuantity/@unitCode

LIT_UnitPriceAmount

For invoices: …/InvoiceLine/Price/PriceAmount

For credit notes: …/CreditNoteLine/Price/PriceAmount

LIT_UnitPriceBasis

For invoices: …/InvoiceLine/Price/BaseQuantity

For credit notes: …/CreditNoteLine/Price/BaseQuantity

LIT_VatExcludedAmount

For invoices: …/InvoiceLine/LineExtensionAmount

For credit notes: …/CreditNoteLine/LineExtensionAmount

LIT_VatRate

For invoices: …/InvoiceLine/Item/ClassifiedTaxCategory/Percent

For credit notes: …/CreditNoteLine/Item/ClassifiedTaxCategory/Percent

LIT_VatCode

For invoices: …/InvoiceLine/Item/ClassifiedTaxCategory/ID

For credit notes: …/CreditNoteLine/Item/ClassifiedTaxCategory/ID

LIT_PO_RowIdentifier

For invoices: …/InvoiceLine/OrderLineReference/LineID

For credit notes: …/CreditNoteLine/OrderLineReference/LineID

LIT_DeliveryDate1

For invoices: …/InvoiceLine/InvoicePeriod/StartDate

For credit notes: …/CreditNoteLine/InvoicePeriod/StartDate

LIT_DeliveryDate2

For invoices: …/InvoiceLine/InvoicePeriod/EndDate

For credit notes: …/CreditNoteLine/InvoicePeriod/EndDate

LIT_DiscountAmount

For invoices, the value is the sum of …/InvoiceLine/AllowanceCharge/Amount for each node whose child node, ChargeIndicator, equals false.

For credit notes, the value is the sum of …/CreditNoteLine/AllowanceCharge/Amount for each node whose child node, ChargeIndicator, equals false.

LIT_DiscountPercent

For invoices, takes the value from the first …/InvoiceLine/AllowanceCharge/MultiplierFactorNumeric node whose child node, ChargeIndicator, equals false.

For credit notes, takes the value from the first …/CreditNoteLine/AllowanceCharge/MultiplierFactorNumeric node whose child node, ChargeIndicator, equals false.

LIT_DeliveryCost

For invoices, the value is the sum of …/InvoiceLine/AllowanceCharge/Amount for each node whose child node, ChargeIndicator, equals true.

For credit notes, the value is the sum of …/CreditNoteLine/AllowanceCharge/Amount for each node whose child node, ChargeIndicator, equals true.

LIT_AdditionalReference

For invoices: …/InvoiceLine/DocumentReference/ID

For credit notes: …/CreditNoteLine/DocumentReference/ID

Takes the value from the first node whose DocumentTypeCode child node equals "130".

Attachment fields
Id …/AdditionalDocumentReference/ID
DataURI …/AdditionalDocumentReference/Attachment/ExternalReference/URI
DataType …/AdditionalDocumentReference/DocumentTypeCode
AdditionalInfo …/AdditionalDocumentReference/Attachment/EmbeddedDocumentBinaryObject/@mimeCode
EmbeddedValue …/AdditionalDocumentReference/Attachment/EmbeddedDocumentBinaryObject
Filename …/AdditionalDocumentReference/Attachment/EmbeddedDocumentBinaryObject/@filename
Invoice note field
InvoiceNote …/Note

Takes the value from all occurrences, joined with a line break.