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.
This EDIFACT ORDERS message represents a purchase order from Acme Corporation ordering 25 desks and 25 chairs from Global Supplies Inc:
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'
BGM+220 - Document type 220 = Purchase OrderNAD+BY - Buyer name and addressNAD+SU - Supplier name and addressLIN - Line item with product identifierQTY+21 - Ordered quantityPRI+AAA - Unit priceThis EDIFACT INVOIC message is an invoice referencing the purchase order above, including line items, amounts, tax, and total:
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'
BGM+380 - Document type 380 = InvoiceRFF+ON - Reference to original order numberCUX+2:USD - Currency is US DollarsMOA+77 - Total line items amountMOA+124 - Tax amountMOA+176 - Grand total including taxFor comparison, here's the same purchase order in ANSI X12 format (commonly used in North America):
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~
* as element delimiter (EDIFACT uses +)~ as segment terminator (EDIFACT uses ')BEG ≈ EDIFACT BGM| Document | EDIFACT | X12 | Purpose |
|---|---|---|---|
| Purchase Order | ORDERS | 850 | Request goods/services |
| Invoice | INVOIC | 810 | Bill for goods/services |
| Advance Ship Notice | DESADV | 856 | Notify of shipment |
| Order Response | ORDRSP | 855 | Accept/reject order |
Use our free online tool to instantly format, view, and analyze your EDIFACT and EDI messages.
Open EDIFACT Formatter →