Electronic Data Interchange
The Interchange Header (UN/EDIFACT)

The Interchange Header is the starting control segment of the interchange envelope.  After the recipient has received the document, the interchange header is the first data segment encountered in the document.  The interchange header contains:

This topic covers:

 

Interchange Header in a Document

In the document, the interchange header is identified with the first letters "UNB" followed by the element separator.

The interchange header data stream fit into the implementation guideline defined for the interchange header as follows:

REF ELE NAME REQ TYPE MIN/MAX VALUE COMMENT
01 S001 Syntax Identifier M Composite element indicating the Syntax Version.
01 0001 Syntax Identifier M A 4/4 UNOB This value indicates UN/ECE Syntax Level B is used in the interchange.
02 0002 Syntax Version Number M AN 1/1 4 This value indicates Syntax Version 4 is used  in the interchange.
02 S002 Interchange Sender M Composite element identifying the sender of the interchange.
01 0004 Interchange Sender Identification M A 4/4 SENDERID This value is the identity of the sender.  Its meaning is qualified by the associated component element 0007.
02 0007 Partner Identification Code Qualifier C AN 1/1 ZZ This element qualifies element 0004.  The value "ZZ" indicates that the sender identification at 0004 is mutually defined which means it only has meaning to the trading partner.
03 S003 Interchange Recipient M Composite element identifying the recipient of the interchange.
01 0010 Recipient Identification M A 4/4 RECIPIENTID This value is the identity of the recipient. Its meaining is qualified by the associated component element 0007.
02 0007 Partner Identification Code Qualifier C AN 1/1 ZZ This element qualifies element 0010.  The value "ZZ" indicates that the recipient identification at 0010 is mutually defined which means it only has meaning to the trading partner.
04 S004 Date and Time of Preparation M Composite element indicating the date and time the interchange was prepared.
01 0017 Date M AN 8/8 20090419 The date the interchange was prepared.
02 0019 Time M AN 4/4 1230 The time the interchange was prepared.
05 0020 Interchange Control Reference M AN 10/10 1 Unique control number assigned to the interchange.
06 S005 Recipient Reference/Password Details C Composite element indicating the date and time the interchange was prepared.
01 0022 Recipient Reference/Password M A 1/14 MYPASSWORD The date the interchange was prepared.
02 0025 Recipient Reference/Password Qual M AN 2/2 BB The time the interchange was prepared.
07 0026 Application Reference C AN 1/14 INVOIC This value is used to aid processing of the interchange by some application, department, etc.
08 0029 Processing Priority Code C A 1/1 A The value "A" is a predefined code that indicates that the interchange is to be processed with highest priority.
09 0031 Acknowledgment Request C N 1/1 1 The value "1" is a predefined code that requests acknowledgment of interchange when it is received.
10 0032 Interchange Agreement Identifier C AN 1/35 No value is assigned but present to keep data elements that follow it and have value to maintain their position in the segment.
11 0035 Test Indicator C N 1/1 1 The value "1" is a predefined code that indicates the interchange is for testing only.

 

Programmatically Reading the Interchange Header

The following steps demonstrates how to read the interchange header.

Programmatically Generating the Interchange Header

The following steps demonstrates how to generate the interchange header.