EDIFACT (Electronic Data Interchange for Administration, Commerce, and Transport) is the international standard format for electronic business document exchange. This comprehensive guide covers everything you need to know about EDIFACT format structure, syntax, and specifications.
Need to format an EDIFACT file? Use our free EDIFACT Formatter to instantly beautify and view your EDIFACT messages.
EDIFACT format is a standardized electronic data interchange format developed by the United Nations. It provides a universal syntax for structuring business documents that can be exchanged between trading partners worldwide, regardless of their internal systems or software.
The format uses a hierarchical structure with specific character separators to organize data into segments, data elements, and composite data elements. This standardization ensures that documents like invoices, purchase orders, and shipping notices can be automatically processed without human intervention.
An EDIFACT message follows a strict hierarchical structure with four main levels:
The outermost envelope containing one or more messages. UNB marks the start, UNZ marks the end, and includes sender/receiver identification and interchange reference numbers.
Each message represents a complete business document (e.g., ORDERS, INVOIC, DESADV). UNH identifies the message type and version, UNT provides the segment count.
Building blocks of the message, each identified by a 3-character tag (e.g., BGM, DTM, NAD). Segments contain related data elements and are terminated by an apostrophe (').
The smallest units of data within segments, separated by plus signs (+). Composite elements use colons (:) to separate component data elements.
Understanding EDIFACT syntax is crucial for properly formatting and parsing messages:
| Character | Purpose | Example |
|---|---|---|
| ' | Segment terminator | UNH+1+ORDERS:D:96A:UN' |
| + | Data element separator | BGM+220+ABC123+9' |
| : | Component data element separator | DTM+137:20240101:102' |
| ? | Release character (escape) | FTX+AAA+++Text with ?+ plus' |
Here's a complete example of an EDIFACT purchase order (ORDERS) message:
UNB+UNOA:2+SENDER+RECEIVER+240101:1200+1' UNH+1+ORDERS:D:96A:UN' BGM+220+PO12345+9' DTM+137:20240101:102' NAD+BY+123456789::92' NAD+SU+987654321::92' LIN+1++1234567890123:EN' QTY+21:100' PRI+AAA:25.50' LIN+2++9876543210987:EN' QTY+21:50' PRI+AAA:49.99' UNS+S' CNT+2:2' UNT+14+1' UNZ+1+1'
UNB: Interchange header with sender, receiver, and timestamp
UNH: Message header identifying this as an ORDERS message
BGM: Document type and reference number
DTM: Date/time information
NAD: Name and address (buyer and supplier)
LIN: Line item details
QTY/PRI: Quantity and price information
Purchase Order
Invoice
Despatch Advice
Order Response
Receiving Advice
Price/Sales Catalogue
Use our free online EDIFACT formatter to instantly beautify and analyze your EDI messages.
Try EDIFACT Formatter →