DevToolCase
Sign in Sign in

EDIFACT INVOIC: the invoice message

The EDIFACT INVOIC invoice: its parties, lines, VAT and totals (MOA, TAX), key qualifiers and an annotated EANCOM D96A example.

Where INVOIC fits in the exchanges

What is the INVOIC message for?

INVOIC is the invoice: the supplier claims payment for the goods or services delivered. The same message carries credit notes (BGM+381) and corrective invoices; only the document code in BGM changes.

It refers to the order (ORDERS) and the despatch advice (DESADV), lists the lines with their quantity, price, amount and VAT rate, then gives the totals after UNS. The buyer matches it against the order and the receiving advice (RECADV) before paying. Where e-invoicing is mandatory, INVOIC may still be exchanged, next to or converted into the legal format.

Sender: Supplier. Recipient: Buyer.

Structure of the INVOIC message

Its main segments, in the order of the D.96A directory. M means mandatory and C conditional, followed by the maximum number of repetitions; for the first segment of a segment group (SG), they apply to the whole group. Rarely used segments are left out.

SegmentGroupStatusWhat it carries
UNH Message header—M 1Message header: the message reference and its type, INVOIC:D:96A:UN:EAN008.
BGM Beginning of message—M 1Document type (380 invoice, 381 credit note) and invoice number.
DTM Date/time/period—M 35Invoice date, delivery date, tax point date.
FTX Free text—C 10Free text: legal mentions.
RFF ReferenceSG1C 99References: order, despatch advice, delivery note.
NAD Name and addressSG2C 99Parties: supplier, buyer, invoicee, delivery point.
RFF ReferenceSG2 › SG3C 9999References of the party: VAT number, company registration number.
CUX CurrenciesSG7C 5Invoice currency.
PAT Payment terms basisSG8C 10Payment terms: due date, discount, penalties.
ALC Allowance or chargeSG15C 9999Allowances and charges on the whole invoice.
LIN Line itemSG25C 9999999Invoice line: line number and GTIN.
QTY QuantitySG25C 5Quantity invoiced.
MOA Monetary amountSG25 › SG26C 5Line amount.
PRI Price detailsSG25 › SG28C 25Unit price.
TAX Duty/tax/fee detailsSG25 › SG33C 99VAT rate of the line.
UNS Section control—M 1Separates the lines from the summary section (UNS+S).
CNT Control total—C 10Control totals, such as the number of lines.
MOA Monetary amountSG48M 100Totals: lines, taxable amount, VAT, amount due.
TAX Duty/tax/fee detailsSG50C 10VAT breakdown, one per rate, with its amount.
UNT Message trailer—M 1Message trailer: number of segments and message reference.

Codes worth knowing

SegmentData elementCodeMeaning
BGM1001380Commercial invoice
BGM1001381Credit note
DTM2005137Invoice date
DTM200535Actual delivery date
RFF1153VAVAT registration number
NAD3035IVInvoicee
QTY606347Invoiced quantity
MOA5025203Line item amount
MOA502579Total of the line amounts
MOA5025125Taxable amount
MOA5025176Total VAT amount
MOA502577Invoice amount: the total to pay, VAT included
TAX5153VATValue added tax
TAX5305SStandard rate

Example of INVOIC message

UNA:+.? '
UNB+UNOC:3+8712345000011:14+5412345000013:14+261128:0900+INV0001'
UNH+1+INVOIC:D:96A:UN:EAN008'
BGM+380+INV2026001+9'
DTM+137:20261128:102'
DTM+35:20261127:102'
RFF+ON:PO12345'
RFF+AAK:DES5678'
NAD+SU+8712345000011::9'
RFF+VA:NL123456782B01'
NAD+BY+5412345000013::9'
RFF+VA:BE0123456749'
CUX+2:EUR:4'
PAT+1++5:3:D:30'
LIN+1++8712345100018:EN'
QTY+47:48'
MOA+203:228'
PRI+AAA:4.75'
TAX+7+VAT+++:::21+S'
LIN+2++8712345100025:EN'
QTY+47:8'
MOA+203:100'
PRI+AAA:12.5'
TAX+7+VAT+++:::21+S'
UNS+S'
CNT+2:2'
MOA+77:396.88'
MOA+79:328'
MOA+125:328'
MOA+176:68.88'
TAX+7+VAT+++:::21+S'
MOA+124:68.88'
UNT+31+1'
UNZ+1+INV0001'
Convert it to JSON

The example, segment by segment

SegmentMeaning
BGM+380+INV2026001+9Commercial invoice (380) number INV2026001, original.
RFF+VA:NL123456782B01VAT number of the supplier: an RFF right after its NAD.
PAT+1++5:3:D:30Payment due 30 days (D, days) after (3) the invoice date (5).
MOA+203:228Line amount: 48 × 4.75 = 228.
TAX+7+VAT+++:::21+SVAT at the standard rate (S) of 21%.
QTY+47:88 units invoiced: the quantity received, not the 10 despatched.
MOA+79:328Total of the lines: 228 + 100 = 328.
MOA+77:396.88Amount to pay: 328 + 68.88 of VAT.
UNT+31+1End of the message: the number of segments from UNH to UNT included, then the reference given in UNH.

Related messages

In the ANSI X12 standard, used mostly in North America, the equivalent of INVOIC is the 810 transaction set (Invoice), which you can read with the X12 viewer.

Add this browser’s favorites to your account?

This browser has 0 favorites that your account does not have:

Either way, this browser keeps its favorites: you find them again after signing out.