EDI Document Components

A Guide for Beginners

EDI documents aren’t human-readable in the traditional sense, meaning they aren’t a self-described format. You need the EDI standards guideline, also known as a specification, to interpret the data. Even if they seem like gibberish at first glance, once you have those guidelines, they’re surprisingly easy to understand. This guide will help you read an EDI document as easily as any other business document.

Common EDI Standards

There are many different EDI standards, but the most common are:

  • ANSI X12: widely used in North America
  • EDIFACT: international standard defined by the United Nations
  • TRADACOMS: primarily used in UK retail.

All EDI standards follow the same basic structure; the main difference is in the naming conventions and data usage.

This guide focuses on ANSI X12, but the principles apply to all standards.

Understanding the Structure of an EDI Document

EDI documents follow a highly defined structure. The three main components of the structure are:

Segments

A single line of data that contains related information. Each segment starts with a tag (e.g., “ISA” or “BEG”) that defines its purpose.

Segments are made up of elements. Think of a segment as a sentence, composed of individual words (elements) that together convey a larger meaning.

Elements

An individual piece of data, like a date or purchase order number. Think of an element as a word, which can be combined with other words to make a sentence.

Loops

A set of related segments that repeat as necessary to convey additional information. For example, the segments that convey line-item detail in a purchase order (PO1 loop) repeat for each item on the order.


Separators and Delimiters

The segments, elements, and loops in an EDI document are defined by separators and delimiters. The separator is a special character that denotes the beginning and end of an element. A delimiter is a special character that denotes the end of a segment.

Any character can be used as the separator and delimiter, but it needs to be a character that doesn’t typically occur within the document data. For example, the letter ‘x’ would be a poor choice because the EDI system would interpret the word “extra” as two elements with the values “e” and “tra.”

In ANSI X12, the most used separator is the asterisk (*), and the most used delimiters are the tilde (~) or line return.


How to Read Segments and Elements

To identify the segments and elements in an EDI document, you just need to know the separator and delimiter characters. Normally the separator is an asterisk (*) and the delimiter is a tilde (~) or line return, but the values will be defined in the ISA control segment.

The value at the beginning of every segment is the tag, or segment ID. This tells you which segment it is, for example ST (transaction set header) or BEG (beginning segment for purchase order). Descriptions of each control segment are included later in this guide.

After the segment tag is the first element separator. Each time you see the separator you know one element is ending and a new one is beginning.

The delimiter tells you that the segment has ended, and a new segment is beginning.

Here's what that looks like in action:

Row midpoint Shape Decorative svg added to bottom

Correlating to ANSI X12 or Partner Specifications

These are examples of the ANSI X12 standards or trading partner specifications you would use to understand the content of the ST and BEG segments.

 

Row midpoint Shape Decorative svg added to bottom

Control Segments

EDI documents are defined by control segments. These are a specialized set of segments that provide metadata about the EDI transmission, such as sender, receiver, document type, and transmission date.

The control segments are the same for every EDI document, regardless of type.

Interchange Control Header

Interchange Control Header

Provides information about the sender, receiver, date and time of transmission, delimiters, and control number. Think of it as the “outside envelope” of an EDI transmission. ISA has a fixed character length and follows a strict format.

Interchange Control Trailer

Interchange Control Trailer

Denotes the end of the transmission and confirms the number of groups contained in the interchange. The ISA and IEA always occur in pairs (e.g. the interchange control group starts with the ISA and is closed out by the IEA).

Functional Group Header

Functional Group Header

Provides the document type, confirmation of the sender and receiver, the date and time of the group creation, the version, and control number. It organizes related transaction sets (EDI documents) within an interchange. It acts as an "inside envelope" for grouping similar documents, such as multiple 850 (Purchase Orders) in one transmission.

Functional Group Trailer

Functional Group Trailer

Denotes the end of the document group and confirms the number of documents contained in the group. The GS and GE segments always occur in pairs (e.g. the functional group starts with the GS and is closed out by the GE).

Functional Group Trailer (1)

Transaction Set Header

Confirms the document type and provides a document control number. Think of it as the “individual document” of an EDI transmission.

Set Trailer

Transaction Set Trailer

Denotes the end of the individual document and confirms the number of data segments contained in the document. The ST and SE segments always occur in pairs (e.g. every transaction set must start with an ST segment and end with an SE segment).


Data Segments

Data segments occur within the EDI transaction set (i.e., between the ST and SE segments) and provide the document content. Each EDI document type has its own unique set of data segments, such as the BEG for the 850 (Purchase Orders) or BIG for the 810 (Invoices). The EDI standards define the possible data segments for the document type, and the trading partner’s EDI specifications define their particular use of the available data segments.

Row midpoint Shape Decorative svg added to bottom

Beginner Tips

  • Start with a sample document. Reviewing a sample EDI document alongside its human-readable equivalent helps you understand how the data aligns.
  • Learn the codes. Familiarize yourself with the common codes and tags used in your industry, so you easily recognize things like purpose code or address type.
  • Leverage resources. At DCS, we offer tailored EDI training to help you and your team master EDI documents and processes.

Once you practice a bit, you’ll be able to read an EDI document with ease. For example, you’ll know that the 850 below is for PO 009600515094, requesting 400 of item 1234567 to ship to Mira Loma, CA on June 15th.

ISA*00*          *00*          *ZZ*CUSTOMERABC    *12*9529415466*240514*1214*U*00401*000000671*0*P*>

GS*PO*CUSTOMERABC*9529415466*20240514*1214*671*X*004010

ST*850*6710001

BEG*00*SA*009600515094**20240514

REF*VR*0010001800

REF*DP*26*ABC DEPARTMENT

REF*19*NW*ABC REGION

REF*ZZ*53981*BUYER VENDOR NUMBER

REF*ZZ*04*BUYER VENDOR SUFFIX

REF*YD*JSMITH*CREATED BY

FOB*CC*ZZ*NA

ITD*01*2*****60*****ROG 60

DTM*175*20240621

DTM*002*20240615

DTM*010*20240615

TD5*****CALL TRAFFIC

N9*H7*SPECIAL INSTRUCTIONS

MSG*Ship Window: 06/15/21 - 06/21/21

MSG*(MM/DD/YY)

N9*H5*LEGAL DISCLAIMER

MSG*This order incorporates Customer ABC Standard Terms,

MSG*as they may be amended from time to time, and any applicable

MSG*signed agreements between us.

N1*ST* MIRA LOMA DRY*9*1033918439999

N3*10000 RIVERSIDE DR

N4*MIRA LOMA*CA*91752

PER*RE**EM*[email protected]

PO1*1*400*EA*215.5**IN*1234567

PID*F****FLYING CAR-1PC

CTT*1*400

SE*29*6710001

GE*1*671

IEA*1*000000671

The Value of EDI Expertise

Being able to read and interpret EDI documents not only improves efficiency but also empowers your team to quickly identify and resolve errors, keeping transactions running smoothly. Partnering with an expert EDI consultant like DCS provides the guidance and tools necessary to streamline operations and enhance long-term success.

Need Help with EDI?

Since 1991, DCS has been providing customers with solid EDI solutions to a wide-range of industries throughout United States and Canada. DCS works with the leading EDI systems to help you overcome your EDI challenges. DCS consultants have successfully installed, mapped, and operated nearly all EDI systems. Our services include EDI development, EDI Managed Services, support, and training. Contact us today to start a conversation.

arrow 1