novair Back to EDI Reader
EDI ReaderEDIFACT file example

EDIFACT file example: an ORDERS message explained line by line

A real-shaped EDIFACT purchase order, complete from UNA to UNZ, with what each segment and code means. The companies, people and numbers are fictional; the structure is exactly what a retailer or a distributor sends.

The complete file

This is an ORDERS message, directory D96A, EANCOM subset. One segment per line here for reading; in real interchanges it is often a single line, and the apostrophe is the segment terminator either way.

UNA:+.? '
UNB+UNOA:2+5450534000000:14+5410738000008:14+260906:1200+12345'
UNH+1+ORDERS:D:96A:UN:EAN008'
BGM+220+PO-2026-0042+9'
DTM+137:20260906:102'
DTM+2:20260915:102'
RFF+CT:CONTRACT-88'
NAD+BY+5450534000000::9++ACME DISTRIBUTION+12 RUE DE LA GARE+PARIS++75010+FR'
NAD+SU+5410738000008::9++NOVAIR SUPPLIES+8 AVENUE DU PORT+LYON++69002+FR'
CTA+OC+:MARIE DUPONT'
COM+marie.dupont@acme.example:EM'
CUX+2:EUR:9'
LIN+1++3400935000019:SRV'
PIA+1+ART-1001:SA'
IMD+F++:::CABLE HDMI 2M'
QTY+21:120:PCE'
PRI+AAA:4.75'
LIN+2++3400935000026:SRV'
PIA+1+ART-1002:SA'
IMD+F++:::ADAPTATEUR USB-C'
QTY+21:48:PCE'
PRI+AAA:12.30'
UNS+S'
CNT+2:2'
UNT+23+1'
UNZ+1+12345'

Open this sample in the free online EDI viewer (nothing uploaded)

The envelope: UNA, UNB and UNZ

UNA:+.? ' is the service string advice. It declares the six special characters of the file, in order: component separator (:), element separator (+), decimal mark (.), release character (?), a reserved space, and the segment terminator ('). When UNA is absent, these default values apply.

UNB+UNOA:2+5450534000000:14+5410738000008:14+260906:1200+12345' is the interchange header: syntax UNOA version 2, the sender and the recipient identified by GS1 location numbers (qualifier 14), the preparation date and time (6 September 2026, 12:00) and the interchange control reference 12345.

UNZ+1+12345' closes the interchange. It announces one message and repeats the control reference of UNB. If either value is wrong, most translators reject the whole interchange.

The message: UNH and UNT

UNH+1+ORDERS:D:96A:UN:EAN008' opens message 1. Its identifier says everything about the format: type ORDERS, version D, release 96A, controlling agency UN, association code EAN008 (the EANCOM version).

UNT+23+1' closes it. 23 is the number of segments from UNH to UNT, both included; 1 repeats the message reference of UNH. Count the lines of the message above: there are 23.

The lines: LIN, PIA, IMD, QTY and PRI

  • LIN+1++3400935000019:SRV: line 1, item identified by its GTIN (code SRV).
  • PIA+1+ART-1001:SA: an additional identifier, the supplier's article number.
  • IMD+F++:::CABLE HDMI 2M: a free-form description.
  • QTY+21:120:PCE: qualifier 21 is the ordered quantity, 120 pieces.
  • PRI+AAA:4.75: price qualifier AAA, calculation net: 4.75 per unit.

UNS+S separates the detail section from the summary, and CNT+2:2 gives a control total: 2 line items. A partner who counts LIN segments and finds another number rejects the message.

Two more EDIFACT examples: INVOIC and DESADV

An invoice (INVOIC, document code 380, Commercial invoice) adds amounts and tax. Lines carry MOA+203 (line item amount) and TAX+7+VAT; the summary after UNS carries MOA+79 (total line items amount), MOA+124 (tax amount) and MOA+77 (invoice amount).

UNA:+.? '
UNB+UNOA:2+5410738000008:14+5450534000000:14+260906:1210+12346'
UNH+2+INVOIC:D:96A:UN:EAN008'
BGM+380+FA-2026-0157+9'
DTM+137:20260906:102'
DTM+35:20260904:102'
RFF+ON:PO-2026-0042'
NAD+SE+5410738000008::9++NOVAIR SUPPLIES+8 AVENUE DU PORT+LYON++69002+FR'
RFF+VA:FR36345678908'
NAD+BY+5450534000000::9++ACME DISTRIBUTION+12 RUE DE LA GARE+PARIS++75010+FR'
CUX+2:EUR:4'
PAT+1++5:3:D:30'
LIN+1++3400935000019:SRV'
QTY+47:120:PCE'
MOA+203:570.00'
PRI+AAA:4.75'
TAX+7+VAT+++:::20+S'
LIN+2++3400935000026:SRV'
QTY+47:48:PCE'
MOA+203:590.40'
PRI+AAA:12.30'
TAX+7+VAT+++:::20+S'
UNS+S'
MOA+79:1160.40'
MOA+124:232.08'
MOA+77:1392.48'
TAX+7+VAT+++:::20+S'
UNT+26+2'
UNZ+1+12346'

A despatch advice (DESADV, document code 351) describes what was shipped: DTM+11 is the despatch date, DTM+17 the estimated delivery date, CPS and PAC describe the packing, and QTY+12 is the despatched quantity.

UNA:+.? '
UNB+UNOA:2+5410738000008:14+5450534000000:14+260905:0800+12347'
UNH+3+DESADV:D:96A:UN:EAN005'
BGM+351+BL-2026-0311+9'
DTM+137:20260905:102'
DTM+11:20260905:102'
DTM+17:20260908:102'
RFF+ON:PO-2026-0042'
NAD+SU+5410738000008::9++NOVAIR SUPPLIES'
NAD+DP+5450534000000::9++ACME DISTRIBUTION+12 RUE DE LA GARE+PARIS++75010+FR'
TDT+20++30++:::TRANSPORTS MARTIN'
CPS+1'
PAC+2+++PX'
LIN+1++3400935000019:SRV'
QTY+12:120:PCE'
LIN+2++3400935000026:SRV'
QTY+12:48:PCE'
CNT+2:2'
UNT+17+3'
UNZ+1+12347'

The mistakes partners reject in a file like this

  • UNT announces 22 or 24 segments after a segment was added or removed by hand.
  • UNZ repeats another control reference than UNB, often after two files were merged.
  • A + or : inside a free text without the release character: CABLE 2+1 must be written CABLE 2?+1.
  • A NAD without its party qualifier (NAD++…), or a mandatory segment such as BGM or DTM+137 missing.
  • CNT counting a different number of lines than the LIN segments of the message.

Common EDI errors explained, with the fix for each one

EDIFACT DESADV explained: SSCC, GLN and why retailers reject a despatch advice

Frequently asked questions

What is an EDIFACT file?

A plain-text file in the UN/EDIFACT syntax: segments separated by an apostrophe, elements by +, components by :. One interchange (UNB to UNZ) holds one or more messages (UNH to UNT), each of a given type such as ORDERS, INVOIC or DESADV.

What file extension does an EDIFACT file have?

There is no fixed one: .edi, .edifact, .txt, .dat or no extension at all. What makes it EDIFACT is the content: it starts with UNA or UNB.

What does D96A mean?

It is the directory release of the message: version D, release 96A, published by the UN. The partner's implementation guide says which release they expect; EANCOM messages often use D96A or D01B.

How do I open an EDIFACT file?

Any text editor shows the raw text. To read it with every segment and code named, open it in EDI Reader for VS Code, or drop it on the free online EDI viewer, which reads it in your browser without uploading it.

Read your own files the same way

EDI Reader for VS Code names every segment and code of your EDIFACT and X12 files, on your machine. Free, no account; Pro adds the check, CSV and JSON export and folder checks.

A format or an in-house rule of your own? We build it in five working days, at a fixed price: EUR 490 + VAT where applicable, per work package. See the work packages