EDI Examples: Real Electronic Data Interchange Messages

EDI (Electronic Data Interchange) messages are structured files that businesses use to exchange documents electronically. Below you'll find real examples of the most common EDI message types in both EDIFACT (international) and X12 (North American) formats.

Want to format your own EDI files? Paste any EDI message into our free online formatter to instantly beautify and view the structure.

EDI Purchase Order Example (EDIFACT ORDERS)

This EDIFACT ORDERS message represents a purchase order from Acme Corporation ordering 25 desks and 25 chairs from Global Supplies Inc:

EDIFACT ORDERS - Purchase Order
UNB+UNOA:2+BUYER001+SELLER001+240115:0930+12345'
UNH+1+ORDERS:D:96A:UN'
BGM+220+PO-2024-0001+9'
DTM+137:20240115:102'
NAD+BY+++Acme Corporation+123 Business Ave+Chicago+IL+60601+US'
NAD+SU+++Global Supplies Inc+456 Industrial Rd+Detroit+MI+48201+US'
LIN+1++7890123456789:EN'
IMD+F++:::Office Desk - Oak Finish'
QTY+21:25'
PRI+AAA:299.99'
LIN+2++7890123456790:EN'
IMD+F++:::Executive Chair - Black'
QTY+21:25'
PRI+AAA:449.99'
UNS+S'
MOA+79:18749.50'
UNT+17+1'
UNZ+1+12345'

Key Segments Explained:

  • BGM+220 - Document type 220 = Purchase Order
  • NAD+BY - Buyer name and address
  • NAD+SU - Supplier name and address
  • LIN - Line item with product identifier
  • QTY+21 - Ordered quantity
  • PRI+AAA - Unit price

EDI Invoice Example (EDIFACT INVOIC)

This EDIFACT INVOIC message is an invoice referencing the purchase order above, including line items, amounts, tax, and total:

EDIFACT INVOIC - Invoice
UNB+UNOA:2+SELLER001+BUYER001+240120:1400+54321'
UNH+1+INVOIC:D:96A:UN'
BGM+380+INV-2024-0042+9'
DTM+137:20240120:102'
RFF+ON:PO-2024-0001'
NAD+SU+++Global Supplies Inc+456 Industrial Rd+Detroit+MI+48201+US'
NAD+BY+++Acme Corporation+123 Business Ave+Chicago+IL+60601+US'
CUX+2:USD:4'
LIN+1++7890123456789:EN'
QTY+47:25'
MOA+203:7499.75'
LIN+2++7890123456790:EN'
QTY+47:25'
MOA+203:11249.75'
UNS+S'
MOA+77:18749.50'
MOA+124:1499.96'
MOA+176:20249.46'
UNT+19+1'
UNZ+1+54321'

Key Segments Explained:

  • BGM+380 - Document type 380 = Invoice
  • RFF+ON - Reference to original order number
  • CUX+2:USD - Currency is US Dollars
  • MOA+77 - Total line items amount
  • MOA+124 - Tax amount
  • MOA+176 - Grand total including tax

X12 Purchase Order Example (850)

For comparison, here's the same purchase order in ANSI X12 format (commonly used in North America):

ANSI X12 850 - Purchase Order
ISA*00*          *00*          *ZZ*BUYER001       *ZZ*SELLER001      *240115*0930*U*00401*000012345*0*T*>~
GS*PO*BUYER001*SELLER001*20240115*0930*12345*X*004010~
ST*850*0001~
BEG*00*SA*PO-2024-0001**20240115~
N1*BY*Acme Corporation*92*BUYER001~
N1*SE*Global Supplies Inc*92*SELLER001~
PO1*1*25*EA*299.99**UP*7890123456789~
PID*F****Office Desk - Oak Finish~
PO1*2*25*EA*449.99**UP*7890123456790~
PID*F****Executive Chair - Black~
CTT*2*50~
SE*12*0001~
GE*1*12345~
IEA*1*000012345~

Key Differences from EDIFACT:

  • X12 uses * as element delimiter (EDIFACT uses +)
  • X12 uses ~ as segment terminator (EDIFACT uses ')
  • Segment names differ: X12 BEG ≈ EDIFACT BGM

Common EDI Message Types

DocumentEDIFACTX12Purpose
Purchase OrderORDERS850Request goods/services
InvoiceINVOIC810Bill for goods/services
Advance Ship NoticeDESADV856Notify of shipment
Order ResponseORDRSP855Accept/reject order

More EDI Examples

Related Resources

Ready to Format Your EDIFACT Files?

Use our free online tool to instantly format, view, and analyze your EDIFACT and EDI messages.

Open EDIFACT Formatter →