The Comprehensive Technical Guide to UN/EDIFACT Messaging: DESADV, INVOIC & Global Supply Chain Data Standards
In international maritime logistics, cross-border freight forwarding, ocean container shipping, and global supply chain automation, the United Nations Electronic Data Interchange for Administration, Commerce and Transport (UN/EDIFACT) represents the mandatory international standard for electronic B2B communication. Developed under the auspices of the United Nations Economic Commission for Europe (UNECE) and maintained by UN/CEFACT, UN/EDIFACT is the operational backbone across Europe, Asia-Pacific, Latin America, and global customs authorities.
While ANSI ASC X12 is the prevailing EDI protocol in North America, global multi-national corporations, port terminal operators, and international freight carriers rely on UN/EDIFACT message directories (such as D96A, D01B, and D21A). Among the dozens of standardized message types, two transaction sets dominate international commerce: DESADV (Despatch Advice / Advance Shipping Notice) and INVOIC (Commercial Invoice). Converting raw, delimited EDIFACT text streams into clean, human-readable Excel spreadsheets is vital for cross-dock warehouse receiving, customs clearance declarations, and three-way accounts payable matching.
Anatomy of UN/EDIFACT Segment Architecture & Service String Advice (UNA)
A UN/EDIFACT transmission is composed of standardized alphanumeric segments separated by special service characters. The optional UNA (Service String Advice) segment at the very beginning of the transmission defines the exact delimiter characters used throughout the file:
UNA:+.? ' (Service String Advice Definition)
Where : (Colon) is the Component Data Element Separator, + (Plus) is the Data Element Separator, . (Period) is the Decimal Mark, ? (Question Mark) is the Release / Escape Character, and ' (Single Quote) is the Segment Terminator.
Core UN/EDIFACT Segment Hierarchy Reference Table
| Segment Tag | Functional Segment Name | Key Business Data Elements Contained | Mandatory / Optional in DESADV |
|---|---|---|---|
| UNB / UNZ | Interchange Header & Trailer | Sender GLN/EORI ID, Receiver ID, Date/Time Stamp (YYMMDD:HHMM), Interchange Control Reference | Mandatory (Interchange Level) |
| UNH / UNT | Message Header & Trailer | Message Reference Number, Message Type Identifier (DESADV:D:96A:UN), Controlling Agency |
Mandatory (Message Level) |
| BGM | Beginning of Message | Document Message Name Code (351 = Despatch Advice, 380 = Commercial Invoice), Document Number | Mandatory |
| DTM | Date / Time / Period | Date Qualifier (137 = Document Date, 11 = Despatch Date, 132 = Arrival Date), Format Qualifier (102 = CCYYMMDD) | Mandatory |
| NAD | Name and Address Loop | Party Qualifier (BY = Buyer, SE = Seller, CN = Consignee, CZ = Consignor, CA = Carrier), Address Details | Mandatory (Party Loop) |
| CPS / PAC | Consignment Packing Sequence | Hierarchical packing level (Pallet / Outer Master Carton / Inner Box), Package Quantity, Packaging Type Code | Mandatory in DESADV |
| LIN / PIA / QTY | Line Item & Product Details | Line Item Number, GTIN-13 / EAN Barcode, Supplier Part Number, Despatch Quantity, Unit of Measure (C62 = Piece, KGM = Kilogram) | Mandatory (Item Loop) |
| MOA / TAX | Monetary Amount & Duty | Amount Qualifier (77 = Invoice Total, 203 = Line Item Total, 124 = VAT/Tax Amount), Currency Code (EUR, USD, GBP) | Mandatory in INVOIC |
❌ Disorganized Manual EDIFACT Processing
- Manually parsing nested plus (+) and colon (:) delimiters in text editors like Notepad.
- Experiencing port demurrage and customs delays due to late Advance Shipping Notice logging.
- Paying $400+/month for expensive desktop EDI translation software with complex licensing.
- Uploading proprietary international shipping manifests to insecure third-party cloud tools.
✅ 100% Client-Side Automated Excel Conversion
- Instant browser-based parsing of UNA, UNB, BGM, NAD, CPS, and LIN message segment loops.
- Direct multi-tab Excel (.xlsx) export ready for warehouse management systems (WMS) and ERP ingestion.
- 100% private in-browser execution ensuring confidential commercial trade data never leaves your device.
- Complete validation of segment syntax, control counts, and line item quantity checksums.
Step-by-Step UN/EDIFACT Translation Protocol
To convert complex EDIFACT message files into standardized Excel reports, execute the following operational workflow:
- Step 1: Ingest EDIFACT File: Paste the raw EDIFACT text stream or upload your
.edior.txtfile into the local converter console. - Step 2: Service String Parsing: The parser scans for the initial
UNAsegment or applies standard ISO delimiters (+element separator,:component separator,'segment terminator). - Step 3: Interchange & Message Header Extraction: The parser extracts sender/receiver IDs from the
UNBsegment and identifies message type (DESADV vs. INVOIC) from theUNHsegment. - Step 4: Hierarchical Loop Construction:
- For DESADV: Structures the Consignment Packing Sequence (
CPS) mapping pallets to cartons to individual SKU line items (LIN/QTY). - For INVOIC: Extracts header invoice totals, payment terms (
PAT/DTM), and line-item unit pricing (LIN/PRI/MOA).
- For DESADV: Structures the Consignment Packing Sequence (
- Step 5: Excel (.xlsx) Generation: Using SheetJS, the parsed data is compiled into formatted worksheets (Header Summary, Party Addresses, Line Item Details) and downloaded directly to your local drive.
Comparison: UN/EDIFACT vs. ANSI ASC X12 Standards
| Standard Dimension | UN/EDIFACT (International Standard) | ANSI ASC X12 (North American Standard) |
|---|---|---|
| Primary Geographic Usage | Europe, Asia, Latin America, Australia, Global Maritime Ocean Freight | United States, Canada, North American Retail & Healthcare |
| Standard Element Separator | Plus Sign (+) |
Asterisk (*) |
| Standard Segment Terminator | Single Quote (') |
Tilde (~) |
| Component Separator | Colon (:) |
Colon (:) or Caret (^) |
| Despatch Advice / ASN | DESADV | EDI 856 (Ship Notice/Manifest) |
| Commercial Invoice | INVOIC | EDI 810 (Invoice) |
| Purchase Order | ORDERS | EDI 850 (Purchase Order) |
? (e.g. John?'s Goods or 100?+200) to prevent parser corruption.
Frequently Asked Questions (FAQ)
D96A and D01B represent different semi-annual release directories published by UN/CEFACT (D = Draft directory, 96/01 = Year, A/B = First/Second release of that year). While core segments are identical, newer directories support expanded data elements for international customs reporting, environmental hazardous materials, and advanced tracking.
The CPS (Consignment Packing Sequence) segment establishes a parent-child hierarchy: Level 1 represents the outer transport unit (Pallet/Container), Level 2 represents inner master packaging (Carton), and Level 3 represents the individual consumer item (LIN). This allows warehouse management systems to verify which cartons reside on which physical pallets upon scanning.
Yes. The parsing engine extracts standard header, party, and line item arrays across all UN/EDIFACT message types, including ORDERS (Purchase Orders), ORDRSP (Purchase Order Responses), and IFTMIN (Instruction for Transport).
Completely secure. 100% of parsing and Excel file generation executes locally inside your web browser's JavaScript memory runtime. No shipment records, pricing data, or customs manifests are ever transmitted over the network.
UN/EDIFACT Customs & Port Authority Messaging: CUSCAR, CUSDEC & IFTMIN
In addition to commercial DESADV and INVOIC messages, global maritime shipping lines and port container terminal operators exchange specialized customs and manifest transmissions:
| EDIFACT Message Type | Full Functional Message Name | Operational Maritime & Customs Role |
|---|---|---|
| CUSCAR | Customs Cargo Report | Transmitted by ocean carriers to national customs authorities (such as EU Import Control System ICS2) to report complete inward vessel cargo manifests prior to port arrival. |
| CUSDEC | Customs Declaration Message | Lodged by licensed customs brokers to declare commercial import/export shipments for statutory duties, VAT assessments, and statistical release. |
| IFTMIN | Instruction for Transport | Sent by shippers or freight forwarders to ocean carriers instructing the movement of booking containers and specifying bill of lading terms. |
| COPRAR | Container Discharge / Loading Order | Exchanged between shipping lines and automated container port terminals to sequence crane discharge and vessel stowage operations. |
Automated 3-Way Invoice Matching: INVOIC, Purchase Orders (ORDERS) & DESADV
In enterprise supply chain operations, automated accounts payable matching algorithms compare three core EDIFACT message streams:
- Step 1: PO Line Reconciliation: Comparing line item unit prices in the
INVOICagainst the original agreed prices in theORDERSmessage. - Step 2: Physical Receipt Verification: Matching billed quantities in the
INVOICagainst the actual delivered quantities recorded in the warehouse receipt scan from theDESADV. - Step 3: Automated Tolerance Clearance: If quantities and prices match within corporate tolerance thresholds (e.g. ±0.5%), the ERP automatically schedules electronic payment without human clerk intervention.
UN/EDIFACT Error Handling & Control Messages: CONTRL & APERAK
When transmitting UN/EDIFACT interchanges between global trading partners, automated error detection and receipt acknowledgment is handled by dedicated functional response messages:
| Acknowledgment Message | Technical Verification Role | Automated EDI System Action |
|---|---|---|
| CONTRL (Syntax Acknowledgment) | Verifies syntactical correctness of the received interchange (UNB to UNZ), checking segment delimiters and mandatory fields. | Returns acceptance status (Action Code 7) or flags specific syntax error segments (Action Code 4). |
| APERAK (Application Error Acknowledgment) | Transmitted by the recipient's ERP application if business logic errors are detected (e.g. unknown SKU number or invalid unit price). | Alerts the EDI coordinator to correct line-item pricing and resubmit the invoice. |
AS2 & OFTP2 Secure Communication Protocols in Global EDI
While UN/EDIFACT defines message formatting, secure internet transmission relies on encrypted B2B transport protocols:
- AS2 (Applicability Statement 2 - RFC 4130): The global retail and consumer goods standard, encrypting transmissions with S/MIME and requiring cryptographic Message Disposition Notifications (MDN) as legal proof of receipt.
- OFTP2 (Odette File Transfer Protocol 2 - RFC 5024): The mandatory protocol across the European automotive supply chain, supporting peer-to-peer certificate authentication and automated transmission restart.
UN/EDIFACT Implementation Guidelines & Message Implementation Guidelines (MIG)
When onboarding new international suppliers and freight forwarders, corporate logistics departments publish a formal Message Implementation Guideline (MIG):
- Specification of Mandatory vs. Optional Segments: Defining exactly which conditional segments (such as
MEAfor dimensions andLOCfor port terminals) are mandatory for your enterprise. - Code List Dictionaries: Restricting permissible ISO codes (e.g. ISO 3166 country codes, ISO 4217 currency codes, and UN/ECE Recommendation 20 unit of measure codes).
- Automated Pre-Flight Testing: Establishing an automated staging sandbox where trading partners must successfully transmit test interchanges with zero syntax errors before production cutover.
Summary of EDIFACT Supply Chain Integration Benefits
Implementing standardized UN/EDIFACT message parsing provides transformative operational advantages for international logistics organizations:
- Elimination of Data Entry Transcription Errors: Automated conversion of DESADV and INVOIC transmissions eliminates manual retyping of thousands of SKU numbers, quantities, and customs duty rates.
- Accelerated Port Container Turnaround: Direct ingestion of Advance Shipping Notices into warehouse management systems allows cross-dock logistics hubs to pre-allocate receiving bay doors, reducing container dwell time and eliminating demurrage charges.
- Global Regulatory Customs Alignment: Seamless integration with international customs clearance electronic portals across the European Union (ICS2), United Kingdom (CDS), and Asia-Pacific trade corridors.
UN/EDIFACT Global Implementation Case Study: European Automotive Supply Chain
In the European automotive industry (governed by the ODETTE standards body), Tier-1 automotive suppliers exchange over 50,000 EDIFACT messages daily with OEMs (such as BMW, Volkswagen, and Renault):
- Synchronized Just-in-Time (JIT) Deliveries: Transmitting
DELJIT(Delivery Just in Time) andDESADVmessages allows manufacturing plants to sequence parts directly to assembly lines within 30-minute delivery windows. - Automated Self-Billing Invoicing: OEMs generate automated evaluated receipt settlement invoices using EDIFACT
INVOICmessages, paying suppliers based on physical barcode receipt scans at assembly dock doors.
Summary of Key UN/EDIFACT Formatting Rules
UN/EDIFACT transmissions remain the mandatory international standard for global ocean carriers, cross-dock distribution hubs, and automotive JIT manufacturing networks worldwide, providing uncompromised data integrity and structured message exchange across 200+ countries.
UN/EDIFACT Global Trade Compliance Checklist
Before launching EDIFACT production data exchanges with global retail or automotive partners:
- Validate the
UNAservice string character set and verify character escape rules for apostrophes and plus signs. - Confirm party identifiers in the
NADsegment match official Global Location Numbers (GLNs) or EORI IDs. - Ensure line item quantity units of measure (
QTYsegment) follow UN/ECE Recommendation 20 standards. - Implement automated
CONTRLsyntax acknowledgment tracking to monitor transmission health.