EDIFACT UNH segment: message header.

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.

Tag
UNH
Full name
Message header
Part of the message
Message header
Data elements
2

A UNH segment, explained

Hover any part of the segment to see what it is. Open What your system receives to see the JSON or XML CleanEDI delivers.

  1. UNH+1+ORDERS:D:96A:UN:EAN008'
    UNHMessage header

    Start of ORDERS message (purchase order), directory D:96A, EAN008 subset. Reference 1.

    UNH
    Message header

UNH structure

Elements are separated by + and their parts by :. Positions match the explainer, so 2.3 is the third part of the second element.

PositionElementParts
1Message referenceSingle value
2Message type2.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.

UNH segment FAQ

Have a real message with UNH in it? The explainer breaks down every segment and runs in your browser.

Explain my message

What is the UNH segment in EDIFACT?

UNH is the Message Header segment. 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.

Where does UNH appear in an EDIFACT message?

UNH belongs to the message header part of a message, alongside BGM, DTM, FTX, RFF.

How do I read a UNH segment in my own message?

Paste the message into the free CleanEDI explainer. It breaks every UNH segment into its elements, translates the codes and shows the JSON and XML your system would receive. Nothing you paste leaves your browser.

Related segments in message header