ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

SEGMENT

The base brick of an EDI message: a coherent group of elements carried by a tag and terminated by a delimiter.

Definition

A segment is the elementary structural unit of an EDI message. It aggregates a coherent set of data around a single function — party identification, amount, period, item line. In EDIFACT, its syntax is codified by ISO 9735: a 3-letter tag (NAD, BGM, DTM, QTY, PRI…), followed by a sequence of data elements separated by the + character, terminated by the apostrophe '. Composite sub-elements are separated by the : character. All these delimiters can be redeclared in the optional UNA service segment, useful to transmit non-ASCII payloads safely.

An EDIFACT message is therefore an ordered sequence of segments: UNH (header), BGM (beginning), a stream of business segments (NAD, RFF, DTM, LIN, QTY, PRI…), then UNT (trailer). The UN/EDIFACT directories (D.96A, D.01B…) describe the list and the order of allowed segments per message type.

Origin

The segment concept comes straight from the standards that preceded EDIFACT, notably ANSI ASC X12 from 1979, where the same "segment + element" architecture appears. UN/EDIFACT generalised this logic with a centralised syntax and directory, formalised by ISO in 1988 (ISO 9735), revised in 2002. The term now describes a reality shared by many standards: loop / segment in X12, composite / element in EDIFACT, element / attribute in cXML and UBL.

Example in context

Three successive segments inside an ORDERS message:

Each line is a segment: NAD identifies the buyer, DTM carries the document date (qualifier 137 = "document date", 102 = CCYYMMDD format), QTY carries the ordered quantity (qualifier 21 = "ordered quantity"). All three follow the same grammar: tag + composites separated by + + closing apostrophe.

  • Qualifier — the code that pins down the role of a value inside a segment.
  • NAD — a party-identification segment.
  • BGM — a message-opening segment.
  • UNB — an interchange-level service segment.
  • EDI — the general context in which segments exist.

Last updated: May 13, 2026