The UNH segment opens an individual message within an interchange. It contains the message reference number, the message type (ORDERS, DESADV, INVOIC etc), the version (D96A, D01B etc), the controlling agency (UN or EAN), and optionally the association code (EAN008 for EANCOM). Every UNH must have a matching UNT.
UNHHover any part of the segment to see what it is. Open What your system receives to see the JSON or XML CleanEDI delivers.
UNH+1+ORDERS:D:96A:UN:EAN008'Start of ORDERS message (purchase order), directory D:96A, EAN008 subset. Reference 1.
| 1 | Message reference | 1 |
| 2.1 | Message type: Type | ORDERS |
| 2.2 | Message type: Version | D |
| 2.3 | Message type: Release | 96A |
| 2.4 | Message type: Controlling agency | UN |
| 2.5 | Message type: Association code | EAN008 |
{
"envelope": {
"messageType": "ORDERS",
"version": "D96A",
"subset": "EAN008",
"messageReference": "1"
}
}Example shape. In production the field names and structure follow your own API contract.
Elements are separated by + and their parts by :. Positions match the explainer, so 2.3 is the third part of the second element.
| Position | Element | Parts |
|---|---|---|
| 1 | Message reference | Single value |
| 2 | Message type | 2.1 Type, 2.2 Version, 2.3 Release, 2.4 Controlling agency, 2.5 Association code |
Common EANCOM and UN/EDIFACT values. Your trading partner's implementation guide is the final word on which codes they send.
Have a real message with UNH in it? The explainer breaks down every segment and runs in your browser.
Explain my message