EDI Structure

EDI stands for electronic data interchange & is defined as the machine-to-machine exchange of business information in a standard & structured format

EDI Structure - X12 Primer

The rules for the X12 envelope structure ensure the integrity of the data and the efficiency of the information exchange. The X12 message structure has primary levels that are hierarchical.

From highest to the lowest, this structure is the following:

  • Interchange Envelope (Identified by ISA/IEA segment pairing)
  • Functional Group (Identified by GS/GE segment pairing)
  • Transaction Set (Identified by ST/SE segment pairing)

A schematic structure of X12 envelopes is shown in above image. Each of these levels is explained in more detail in the remainder of this section.

EDI Structure

Interchange Control Envelopes (ISA/IEA)

The Interchange Envelope, often referred to as the “outer envelope,” is the wrapper for all the data to be sent in one transmission. It can contain multiple Functional Groups. This characteristic means that transactions of different types can be included in the Interchange Envelope, with each type of transaction stored in a separate Functional Group.

The Interchange Envelope is defined by the header and trailer; the Interchange Control Header (designated ISA) appears at the beginning, and the Interchange Control Trailer (designated IEA) appears at the end.

While the typical pattern from Enterprise Systems is to create one Functional Group (GS/GE) within an Interchange Group (ISA/IEA), the X12 enveloping supports one or more Functional Groups (GS/GE) within an Interchange Group (ISA/IEA).

The ISA segment is the only segment that is fixed length record. This is done thus that EDI systems can derive the sender, receiver, element separators, sub-element separators, and segment terminators that will be used during EDI transformation.

The ISA & IEA Segments Include:
  • Data element separators and data segment terminator
  • Identification of sender and receiver
  • Control information (used to verify message was correctly received)
  • Authorization and security information, if applicable
The Sequence of Information Transmitted Is:
  • ISA
  • Optional interchange-related control segments
  • Actual message information, grouped by transaction type into Functional Groups
  • IEA

Functional Groups Envelopes (GS/GE)


Functional Groups, often referred to as the “inner envelope,” are made up of one or more Transaction Sets. One Functional Group Envelope must include transaction of all of the same type, which can be batched together into one transmission. The Functional Group is defined by the header and trailer segments.

The Functional Group Header (designated GS) segment appears at the beginning, and the Functional Group Trailer (designated GE) segment appears at the end. Many Transaction Sets of the same type can be included in the Functional Group.

Within the Functional Group, each Transaction Set is assigned a functional identifier code, which is the first data element of the header segment. The Transaction Sets that constitute a specific Functional Group are identified by this functional ID code.

Transaction Set Envelopes (ST/SE)

Each Transaction Set also known as a transaction contains:

  • Transaction Set header (designated ST)
  • Transaction Set trailer (designated SE)
  • Single message, enveloped within the header and footer

A Transaction Set has a three-digit code, a text title, and a two-letter code, for example, 850, Purchase Order (PO).

The Transaction Set is composed of logically related data grouped into units called segments. For example, one segment used in the Transaction Set might convey the address: city, state, postal code, and other geographical information. A Transaction Set will contain multiple segments. For example, the address segment might be used repeatedly to convey multiple sets of address information.