Skip to content
X12 ISA/GS/ST — X12 Interchange EnvelopePublished Dec 2, 2026

EDI ISA Segment and X12 Envelope: ISA, GS, ST Explained

The X12 envelope explained: all 16 ISA elements with lengths, GS functional ID codes and versions, ST/SE, GE and IEA counts, delimiters, and the errors that cause rejections.

Every X12 file is three envelopes deep. The ISA/IEA pair wraps the whole interchange, GS/GE wraps groups of the same document type, and ST/SE wraps each individual 850, 856 or 810. Get the business data perfect and the envelope wrong, and the file is rejected before anyone reads a single line item.

Envelope errors are also the hardest to see by eye, because the ISA is padded with spaces to fixed widths and its delimiters are defined by position rather than declared. This guide covers every ISA element with its length, the GS and ST segments, how the trailers count and match, how delimiters work, a full annotated example and the mistakes that produce TA1 and 997 rejections.

What Is the ISA Segment in EDI?

The ISA segment is the Interchange Control Header defined in the X12.5 interchange control structure. It is always the first 106 characters of an X12 interchange, and it is the only X12 segment with fixed-length elements: every value is padded with trailing spaces (or leading zeros for the control number) so each element sits at the same position in every file.

That fixed layout is deliberate. A receiver has to find the delimiters before it can parse anything, and it does so by position: the character immediately after ISA is the element separator, character 105 is the component separator and character 106 is the segment terminator. Everything else in the file is then read using those characters.

The ISA is closed by the IEA (Interchange Control Trailer), which repeats the control number and counts the functional groups inside.

The Three Envelope Levels

LevelHeaderTrailerWhat it wrapsAcknowledged by
InterchangeISAIEAEverything sent in one transmission between one sender ID and one receiver IDTA1 Interchange Acknowledgment
Functional groupGSGEOne or more transaction sets of the same type (all 850s, all 810s)997 Functional Acknowledgment or 999 Implementation Acknowledgment
Transaction setSTSEOne business document: a single PO, ship notice or invoice997 or 999 (AK2/IK2 level)

One interchange can hold several groups, and one group can hold many transaction sets. A retailer sending you 40 purchase orders overnight usually sends one ISA, one GS with code PO, and 40 ST/SE pairs.

ISA Segment Elements: All 16 Explained

ElementNameType and lengthExampleNotes
ISA01Authorization Information QualifierID, 20000 = no authorization information present
ISA02Authorization InformationAN, 1010 spacesAlmost always blank, padded to 10
ISA03Security Information QualifierID, 20000 = no security information; 01 = password
ISA04Security InformationAN, 1010 spacesBlank unless ISA03 is 01
ISA05Interchange ID Qualifier (sender)ID, 2ZZ01 DUNS, 08 UCC EDI Communications ID, 12 phone, 14 DUNS plus suffix, 16 DUNS plus 4, ZZ mutually defined
ISA06Interchange Sender IDAN, 15BIGBOXRETAIL Padded with trailing spaces to 15
ISA07Interchange ID Qualifier (receiver)ID, 2ZZSame code list as ISA05
ISA08Interchange Receiver IDAN, 15NORTHSTARFOODS Padded to 15
ISA09Interchange DateDT, 6261202YYMMDD, the only two-digit year in the envelope
ISA10Interchange TimeTM, 40930HHMM, 24-hour
ISA11Repetition Separator (00402 and later)1^In version 00401 and earlier this is the Interchange Control Standards Identifier, always U
ISA12Interchange Control Version NumberID, 500501Version of the envelope itself: 00401, 00501
ISA13Interchange Control NumberN0, 9000004127Zero-padded to 9 digits; must equal IEA02
ISA14Acknowledgment RequestedID, 100 = no TA1 requested, 1 = send a TA1
ISA15Interchange Usage IndicatorID, 1PP production, T test, I information
ISA16Component Element Separator1>Splits composite elements; often > or :

Add the 3-character ISA tag, 16 element separators and 86 characters of data, and you get 105 characters. The segment terminator makes 106. If your ISA is not exactly 106 characters, something is padded wrong.

ISA05 to ISA08: sender and receiver IDs

These four elements are how the receiving system and your VAN route the file. The qualifier and ID together must match what the partner has set up, character for character. ZZ with NORTHSTARFOODS is a different identity from 01 with a DUNS number, even if both describe the same company. Most new-partner connection failures trace back to a qualifier or ID that differs from the one in the partner's setup sheet.

ISA11: repetition separator or standards identifier

From version 00402 onward, ISA11 holds the repetition separator, the character used when an element repeats within one segment. ^ is the common choice in 005010, including all HIPAA files. In 004010 files, ISA11 is the Interchange Control Standards Identifier and is always U. If your partner trades 004010 and you send ^ in ISA11, expect a TA1 rejection.

ISA13: interchange control number

A unique, sequential number for each interchange between a sender and receiver. The receiver uses it to detect duplicates and gaps, and it must match IEA02 exactly, including leading zeros. Never reuse a control number in production; many retailers reject a duplicate ISA13 as a resend.

ISA14 and ISA15: acknowledgment and test flag

ISA14 set to 1 asks the receiver for a TA1 interchange acknowledgment. ISA15 tells the receiver whether to process the data. Sending T files into production, or P files during testing, is one of the most common go-live mistakes.

X12 Delimiters

X12 has no fixed delimiters. Each interchange declares its own in the ISA:

DelimiterWhere it is definedCommon values
Element separatorCharacter 4 (immediately after ISA)*
Repetition separatorISA11, version 00402 and later^
Component element separatorISA16 (character 105)>, : or \
Segment terminatorCharacter 106, right after ISA16~, sometimes a newline or '

Two practical rules. First, never hard-code * and ~ in a parser: read them from the ISA. Second, X12 has no escape or release character, so a delimiter can never appear inside data. If a product description contains *, it has to be removed or replaced before the file is built. (EDIFACT handles this with the ? release character; see X12 vs EDIFACT.)

Line breaks after each segment terminator are common and harmless for most receivers, but some strict translators treat a carriage return as data. If a partner reports a segment they cannot read, check for stray line breaks first.

The GS Segment: Functional Group Header

The GS segment groups transaction sets of the same functional type and tells the receiver which X12 release to validate against.

ElementNameExampleNotes
GS01Functional Identifier CodePOMust match the transaction sets inside (see the table below)
GS02Application Sender's CodeBIGBOXRETAILOften the same as ISA06 without padding, but can differ
GS03Application Receiver's CodeNORTHSTARFOODSOften the same as ISA08
GS04Date20261202CCYYMMDD
GS05Time0930HHMM, optionally with seconds
GS06Group Control Number4127Up to 9 digits, no padding; must equal GE02
GS07Responsible Agency CodeXX = ASC X12
GS08Version / Release / Industry Identifier Code005010See versions below

GS01 functional identifier codes

A group must not mix types. If you put an 856 inside a GS*PO group, the receiver's 997 will reject the whole group.

GS08 version codes

GS08 tells the receiver which release, and sometimes which industry convention, the documents follow:

  • 004010: version 4, release 1. Still the most common release in US retail.
  • 004010VICS and 004010UCS: 4010 under the retail (VICS) or grocery (UCS) industry conventions.
  • 005010: version 5, release 1. Common in newer retail programs and in transportation.
  • 005010X222A1, 005010X221A1: HIPAA implementation guides for the 837P and the 835. In healthcare the guide ID also goes into ST03.

GS08 is a different field from ISA12. ISA12 (00401, 00501) is the version of the envelope; GS08 is the version of the documents inside.

ST and SE: Transaction Set Header and Trailer

ElementNameExampleNotes
ST01Transaction Set Identifier Code850The document type
ST02Transaction Set Control Number00014 to 9 characters, unique within the group; must equal SE02
ST03Implementation Convention Reference005010X222A1005010 and later; required in HIPAA
SE01Number of Included Segments8Counts every segment from ST to SE, including both
SE02Transaction Set Control Number0001Same value as ST02

GE and IEA: Group and Interchange Trailers

ElementNameRule
GE01Number of Transaction Sets IncludedCount of ST/SE pairs in the group
GE02Group Control NumberSame value as GS06
IEA01Number of Included Functional GroupsCount of GS/GE pairs in the interchange
IEA02Interchange Control NumberSame 9-digit value as ISA13

These counts are what a 997 or TA1 checks first. If SE01 says 8 and the set has 9 segments, the 997 reports an error even when every business field is correct.

Annotated Example: One 850 in a Full Envelope

ISA*00*          *00*          *ZZ*BIGBOXRETAIL   *ZZ*NORTHSTARFOODS *261202*0930*^*00501*000004127*0*P*>~
GS*PO*BIGBOXRETAIL*NORTHSTARFOODS*20261202*0930*4127*X*005010~
ST*850*0001~
BEG*00*SA*PO-771204**20261202~
REF*DP*092~
DTM*002*20261210~
N1*ST*BIGBOX DC 6094*92*6094~
PO1*1*48*CA*21.50**UP*012345678905~
CTT*1~
SE*8*0001~
GE*1*4127~
IEA*1*000004127~

Reading it from the top:

  1. ISA: no authorization or security info (00 plus 10 spaces, twice). The sender is BIGBOXRETAIL and the receiver NORTHSTARFOODS, both under qualifier ZZ and padded to 15. Sent 2 December 2026 at 09:30. Repetition separator ^, envelope version 00501, control number 000004127, no TA1 requested, production data, component separator >, segment terminator ~.
  2. GS: a purchase order group (PO) with group control number 4127, built to X12 005010.
  3. ST to SE: one 850, control number 0001. SE01 is 8 because there are 8 segments from ST to SE inclusive.
  4. GE: one transaction set in group 4127.
  5. IEA: one functional group in interchange 000004127.

Paste it into the free EDI Inspector to see each element labelled, or swap a count and watch the validation fail.

Common Envelope Errors

ErrorWhat the receiver seesFix
ISA element not padded to its fixed lengthTA1 rejection, or the parser reads the wrong delimitersPad ISA02, ISA04, ISA06 and ISA08 with trailing spaces; zero-pad ISA13 to 9 digits
Wrong ISA05/ISA07 qualifier or IDFile routed nowhere, or rejected as unknown partnerUse the exact qualifier and ID from the partner's setup sheet
ISA13 does not match IEA02TA1 note code for a control number mismatchGenerate both from the same value
Duplicate ISA13Rejected as a duplicate interchangeKeep a persistent, incrementing counter per partner
GS06 does not match GE02, or ST02 does not match SE02997 rejects the group or setWrite header and trailer from one variable
Wrong SE01, GE01 or IEA01 count997 AK5 or AK9 rejectionCount segments after the document is built, not before
T in ISA15 during go-live, or P during testingTest data posted to production, or real orders ignoredSwitch ISA15 as part of the production cutover checklist
^ in ISA11 on a 004010 interchangeTA1 rejectionSend U for 00401 and earlier envelopes
GS01 does not match ST01Group rejectedPut each document type in its own GS group
Delimiter character inside dataSegment split in the wrong placeStrip or replace delimiter characters before building the file

The TA1 guide lists the interchange note codes, and the 997 guide explains how AK3, AK4, AK5 and AK9 report errors inside the group.

Envelope Checklist for a New Trading Partner

  1. Confirm ISA05/ISA06 and ISA07/ISA08 for both directions, test and production. Some partners use different IDs for each.
  2. Confirm the X12 version (ISA12 and GS08) and any industry suffix such as VICS.
  3. Agree on delimiters, or confirm the partner accepts whatever your ISA declares.
  4. Agree whether they want a TA1 (ISA14) and whether they will send 997s or 999s.
  5. Start control numbers at a value that will not collide with test traffic, and store them per partner.
  6. Switch ISA15 from T to P on the agreed cutover date, not before.

Where OrderSync Fits

OrderSync reads X12 interchanges from every partner, checks the envelope, counts and control numbers, and splits each interchange into individual orders. Those orders are validated against your customers, items and prices with the same pipeline that handles PDF, email and spreadsheet orders, and outbound documents are built with correct envelopes per partner.

Frequently Asked Questions

What is the ISA segment in EDI?

The ISA segment is the Interchange Control Header that starts every X12 EDI file. It is a fixed-width, 106-character segment with 16 elements identifying the sender and receiver, the date and time, the envelope version, the interchange control number, the test or production flag and the delimiters used in the rest of the file.

How long is the ISA segment?

106 characters including the segment terminator. The data elements have fixed lengths, so ISA02, ISA04, ISA06 and ISA08 are padded with spaces and ISA13 is zero-padded to 9 digits.

What is the GS segment in EDI?

The GS segment is the Functional Group Header. It groups transaction sets of the same type, identified by the GS01 code (PO for 850s, IN for 810s, SH for 856s), and states the X12 version in GS08. Each GS is closed by a GE segment with the same control number.

What is an EDI envelope?

The envelope is the set of header and trailer segments around the business documents: ISA/IEA for the interchange, GS/GE for each functional group and ST/SE for each transaction set. It tells the receiver who sent the file, what it contains and how many documents to expect.

What are the delimiters in X12 EDI?

The element separator (character 4 of the ISA, often *), the repetition separator (ISA11, often ^), the component separator (ISA16, often > or :) and the segment terminator (the character after ISA16, often ~). Each interchange defines its own.

What is the difference between ISA12 and GS08?

ISA12 is the version of the interchange envelope, for example 00501. GS08 is the version of the transaction sets in the group, for example 005010 or 004010VICS. They usually agree on the release but are separate fields.

Does the ISA13 control number have to match GS06 or ST02?

No. ISA13 must match IEA02, GS06 must match GE02 and ST02 must match SE02. Many systems use related numbers for convenience, but the standard only requires each header to match its own trailer.

What does ISA15 T or P mean?

ISA15 is the usage indicator. P means production data to be processed. T means test data. Some partners also accept I for information only.

Does EDIFACT have an ISA segment?

No. EDIFACT uses UNB for the interchange header and UNH for each message, with an optional UNA segment that declares the separators. Our X12 vs EDIFACT comparison maps the two envelopes level by level.

Related Guides

Sources

James Darby
Last updated: 12/2/2026

Trading with one or two retailers? Otto prepares your EDI documents for $200 per trading partner a month. See self-serve EDI

Related Resources