Structure of X12 Envelopes

Structure of X12 Envelopes

  • Interchange Envelope

  • Functional Group

  • Transaction Set

The structure of a X12 envelopes is shown below. Each of these levels is explained at a basic level detail in the remainder of this section.


Header Segments

The Header is made up of the following 3 segments: the ISA, GS and ST segments.

The ISA segment identifies the sender and receiver of the EDI transmission. The ISA is used to begin an Interchange of one or more GS segments, also known as Functional Groups.

The GS segment identifies the application type for the interchange for both sender and receiver. This segment can be used to route EDI data to various systems or locations by trading partners. The GS segment is also the beginning of a functional group. This segment is also used to provide control information.

The ST segment identifies the type of document you are sending or receiving during EDI transmission. This segment is the beginning of the document, or transaction set.

Trailer Segments

The Trailer Segment is made up of the following 3 segments: the SE, GE and IEA segment.

The SE segment identifies the end of the document or transaction. This segment will display a total quantity of Data Segments sent including the ST and SE segments. This quantity can be used to verify all EDI data transmitted was received by the trading partner.

The GE segment indicates the end of the data provided under a GS segment, or functional group. Multiple GS segments can be included in an EDI transmission, so this segment can indicate the end of a document type or application type.

The IEA segment is the last segment sent or received in an EDI transmission. The IEA indicates this is the end of the current EDI file.

Control Numbers

Control Numbers are included in all header and trailer segments as an additional way of tracking EDI files. Control numbers displayed in the header segments must match control numbers displayed in the trailer segments. The ISA/IEA control numbers must match. The GS/GE control numbers must match, and the ST/SE control numbers must match. If these numbers don’t match the payer may reject your file. Control numbers are created when generating your EDI files.