The UNB segment opens an EDIFACT interchange. It contains the syntax identifier and version, sender identification (with qualifier), recipient identification (with qualifier), preparation date and time, and the interchange control reference. Every UNB must have a matching UNZ at the end of the interchange.
UNBHover any part of the segment to see what it is. Open What your system receives to see the JSON or XML CleanEDI delivers.
UNB+UNOA:2+9322000000456:ZZ+9311000000123:ZZ+260823:0900+CTRL-001'Interchange from 9322000000456 to 9311000000123, prepared 23 August 2026 at 09:00. Control reference CTRL-001.
| 1.1 | Syntax: Character set | UNOALevel A: uppercase letters and digits |
| 1.2 | Syntax: Syntax version | 2 |
| 2.1 | Sender: ID | 9322000000456 |
| 2.2 | Sender: ID type | ZZMutually agreed |
| 3.1 | Recipient: ID | 9311000000123 |
| 3.2 | Recipient: ID type | ZZMutually agreed |
| 4.1 | Prepared: Date (YYMMDD) | 260823 |
| 4.2 | Prepared: Time (HHMM) | 0900 |
| 5 | Interchange control reference | CTRL-001 |
{
"envelope": {
"tradingPartnerId": "9322000000456",
"tradingPartnerIdType": "mutuallyAgreed",
"recipientId": "9311000000123",
"preparedAt": "2026-08-23T09:00",
"interchangeReference": "CTRL-001"
}
}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 | Syntax | 1.1 Character set, 1.2 Syntax version |
| 2 | Sender | 2.1 ID, 2.2 ID type |
| 3 | Recipient | 3.1 ID, 3.2 ID type |
| 4 | Prepared | 4.1 Date (YYMMDD), 4.2 Time (HHMM) |
| 5 | Interchange control reference | Single value |
| 6 | Recipient password | Single value |
| 7 | Application reference | Single value |
| 8 | Processing priority | Single value |
| 9 | Acknowledgement request | Single value |
| 10 | Agreement ID | Single value |
| 11 | Test indicator | Single value |
| Code | Meaning |
|---|---|
UNOA | Level A: uppercase letters and digits |
UNOB | Level B: upper and lower case |
UNOC | ISO 8859-1 (Latin-1) |
UNOD | ISO 8859-2 (Latin-2) |
UNOW | UTF-8 |
UNOY | ISO 10646 (Unicode) |
| Code | Meaning |
|---|---|
1 | DUNS number |
14 | GS1 Global Location Number (GLN) |
30 | ISO 6523 organisation ID |
ZZZ | Mutually agreed |
ZZ | Mutually agreed |
| Code | Meaning |
|---|---|
1 | DUNS number |
14 | GS1 Global Location Number (GLN) |
30 | ISO 6523 organisation ID |
ZZZ | Mutually agreed |
ZZ | Mutually agreed |
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 UNB in it? The explainer breaks down every segment and runs in your browser.
Explain my message