XML invoice standard – General XML

The General XML standard is not an official XML standard. It is provided with Smart XML to be able to process incoming invoices that do not follow any of the other officially supported standards. Usable XML invoice profiles and definitions can then be created for these invoices using it, so that they too can be processed automatically. Keywords and regular expressions have been included and are used to attempt to automatically find value matches in the invoices.

This topic has separate sections for criteria used to match regular INVOICES fields and line-item fields. Each section has two tables:

Criteria used to match regular INVOICES fields with values in invoices that belong to the General XML standard

This is the table of regular expressions used for regular INVOICES fields:

Field value format name

Regular expressions used in connection with them

REGEX_CURRENCY_CODE

^[A-Z]{3}$
REGEX_DATE ^((?:19|20)\d\d)[- /.]?(0[1-9]|1[012])[- /.]?(0[1-9]|[12][0-9]|3[01])$
REGEX_INVOICENUMBER ^[A-Z\d][A-Z\d\s\-\\\.\/]*$
REGEX_TYPE ^[A-Z\d]{1,6}$
REGEX_PONUMBER ^[A-Z\d][A-Z\d\s\-\\\.\/]*$
REGEX_POSTCODE ^[A-Z]{0,2}[\-\s]?[\dA-Z]{2,4}\s?[\dA-Z]{2,4}$
REGEX_VATORGANIZATIONNUMBER ^[A-Z]{0,2}\d+([\-]?\d+)?$

This table indicates the regular INVOICES fields that the General XML standard searches for, including the keywords and field value formats that are used for each:

Regular INVOICES fields

Keywords in path

Field value format used

BuyerAddressPostalCode

Post

Zone

Zip

REGEX_POSTCODE
BuyerVATRegistrationNumber

VATReg

Reg

Reg

REGEX_VATORGANIZATIONNUMBER
DeliveryDate

Delivery

Leverens

REGEX_DATE
InvoiceCredit Typ REGEX_TYPE
InvoiceCurrency

CURRENCY

CODE

CURR

REGEX_CURRENCY_CODE

Also looks for these value key words:

AUD, CAD, CHF, DKK, EUR, GBP, NOK, SEK, USD

InvoiceDate

InvoiceDate

Issue

FakturaD

REGEX_DATE
InvoiceDueDate

DueDate

Due

Payment

Forfallo

REGEX_DATE
InvoiceNote Note  
InvoiceNumber InvoiceNumber
FakturaN
REGEX_INVOICENUMBER
InvoiceOrderNumber

Order

Purch

Kopar

PONumber

REGEX_PONUMBER
InvoiceTotalVATAmount

TaxAmount

VATAmount

MomsBelopp

REGEX_AMOUNT
InvoiceTotalVATExcludedAmount

NetAmount

Net

Excl

Exkl

REGEX_AMOUNT
InvoiceTotalVATIncludedAmount

TotalAmount

Gross

Incl

Inkl

REGEX_AMOUNT
InvoiceTotalVATRatePercent

VAT

Tax

Percent

Procent

Rate

REGEX_PERCENT
SupplierAccountNumber1

Account

Financial

Payee

Bank

REGEX_BG_ACCOUNT
SupplierAddressPostalCode

Post

Zone

ZIP

REGEX_POSTCODE
SupplierVATRegistrationNumber

VATReg

Reg

Reg

REGEX_VATORGANIZATIONNUMBER

Criteria used to match INVOICES line-item fields with values in invoices that belong to the General XML standard

This is the table of regular expressions used for INVOICES line-item fields:

Field value format name

Regular expressions used in connection with them

REGEX_AMOUNT

^[A-Z]{3}$
REGEX_DESCRIPTION ^((?:19|20)\d\d)[- /.]?(0[1-9]|1[012])[- /.]?(0[1-9]|[12][0-9]|3[01])$
REGEX_QUANTITY ^[A-Z\d][A-Z\d\s\-\\\.\/]*$
REGEX_QUANITIY_CODE ^[A-Z\d]{1,6}$
REGEX_ROWIDENTIFIER ^[A-Z\d][A-Z\d\s\-\\\.\/]*$

This table indicates the INVOICES line-item fields that the General XML standard searches for, including the keywords and field value formats that are used for each:

INVOICES line-item fields

Keywords in path

Field value format (for regular expression)

LIT_ArticleName

Desc

Article

Name

Artikel

Product

REGEX_DESCRIPTION
LIT_DeliveredQuantity

Quantity

Qty

Kvant

REGEX_QUANTITY
LIT_DeliveredQuantityUnitCode

Unit

UOM

Measure

Enhet

REGEX_QUANTITY_CODE
LIT_RowIdentifier

ID

Number

Rad

REGEX_ROWIDENTIFIER
LIT_UnitPriceAmount

Price

Pris

REGEX_AMOUNT
LIT_VatExcludedAmount

Amount

Net

REGEX_AMOUNT

Supported XML invoice standard formats

Processing XML invoices using COLLECTOR: Overview

Optimizing XML invoice definitions

Creating rules to map values for fields in XML invoices