StediDOCS

Glossary

Composite element

A single element that contains multiple values of different types, similar to a struct or record. The specification will specify which fields makes up a composite element. The values in a composite element are kept apart by a delimiter. The delimiter to use is specified in the interchange header. In the following example, values are delimited using a :.

PRV*LA***ORT:HS:Y~

Delimiter

A delimiter is used in the X12 EDI Format to mark the end of a segment or element. The end of a segment is delimited by a ~ and the end of an element by a *. Here's an example of two segments, both with three elements.

SE*2*0000~
GE*1*987654321~

There are also delimiters for repeated elements and composite elements, but these aren't standardized. Instead, these delimiters are specified in the interchange.

Element

An element is a data field within a segment. In the X12 EDI Format, elements in a segment are delimited by a *. For example, here's a segment with several elements.

GS*SO*00*00*20210902*1200*987654321*X*008010~

The values an element may contain, are described in a specification.

EDI (Electronic Data Interchange)

EDI allows businesses to exchange electronic documents, like invoices, insurance applications, train sheets, credit reports. There are several standards related to EDI. Most relevant to working with Stedi are the specifications of transaction sets and the X12 EDI Format.

Functional group

Within an EDI file, a functional group is a set of transaction sets. Typically, all the transaction sets within a functional group are intended for the same department within an organization.

The beginning of a functional group is marked by the GS segment and the end is marked by the GE [segment][#segment]. A functional group must be part of an interchange.

Interchange

Within an EDI file, an interchange is a set of functional groups which in turn contain transaction sets. Typically, the contents of an interchange is intended for a specific organization and the contents of a functional group is intended for a specific department within that organization.

The beginning of an interchange is marked by the ISA segment and the end is marked by the IEA segment. Every EDI file must have at least one interchange and consequently, every EDI file starts with an ISA segment and ends with an IEA segment.

JEDI (JSON EDI)

A file format for encoding EDI data in a JSON representation, developed by Stedi. You can find details in the JEDI Format Guide.

Loop

A loop is a collection of segments that can appear multiple times in a transaction set. The segments in a loop typically have a semantic relationalship, for example, the segments Party Identification, Geographic Location, and Communication Contact Information together can tell you about a single trading partner and a loop of those segments allows you to refer to multiple trading partners in a transaction set.

In X12 EDI Format, there's no special delimiter for loops, nor is there a set of segments that mark the begin and end of the loop, like there is for interchanges, functional groups, and transaction sets. Instead, the segments in the loop are just repeated.

N1*21*Stedi*ZZ*ID001~
N4*New York**US~
COM*16*stedi.com~
N1*21*Basic Bits*ZZ*ID002~
N4*Haarlem**NL~
COM*16*basicbits.tech~

Repeated element

A single element that contains multiple values of the same type, similar to a homogeneous array. Not every element can be repeated; the specification must indicate that it's okay to do so.

In X12 EDI Format, the values in a repeated element are kept apart by a delimiter. The delimiter to use is specified in the interchange header. In the following example, values are delimited using a /.

AAA*Y***NF/NR/TO~

Repeated segment

Within an EDI file, some segments can occur multiple times in a row. The specification will tell when a segment can be repeated.

In X12 EDI Format], a repeated segment appears as, well, a segment that's repeated.

NTE**When a segment has need to repeat,~
NTE**How does one accomplish that feat?~
NTE**It's really no bother.~
NTE**One after the other.~
NTE**A solution that's simple and neat.~

Segment

Within an EDI file, a segment is a set of elements, where the segment is like a record and the elements are its fields. Each segment starts with a segment identifier that tells you which elements will follow. The different types of segments and their elements are listed in the specification.

In the X12 EDI Format, segments are delimited by a ~. It's also common to add a new line character after the delimiter, but that's for human readability only and has no semantic value.

Specification

A specification describes the data schema of a transaction set. It lists the loops and segments, the order in which they appear, and the elements within the segments. The specification gives you all the information you need to write or interpret an EDI document that conforms to that specification.

X12 has published many specifications. A trading partner can use these specifications directly, or they can base their own specification on one of them.

Trading partner

Any business that sends or receives business transactions.

Transaction set

A transaction set is a type of business document, for example a purchase order, or a booking cancellation. Each transaction set is based on a specification that describes what data the transaction set can and must contain. There is a list of standardized transaction sets.

The standard transaction sets are designed to be widely applicable. A trading partner can take a transaction set, base its own specification on it, and only accept the data it knows how to handle. Many of these business-specific transaction sets are available on Stedi.

X12

An organization that has published many standards related to EDI.

X12 EDI Format

A file format for encoding EDI data, standardized by X12. It's text-based and makes use of delimiters to mark the segments and elements. It looks something likes this.

ISA*00*          *00*          *ZZ*               *ZZ*               *210902*1200*|*00801*123456789*1*T*:~
GS*SO*00*00*20210902*1200*987654321*X*008010~
ST*326*0000~
SE*2*0000~
GE*1*987654321~
IEA*1*123456789~

API Reference