Data Services Repository > Data service reference > EDI-X12
  

EDI-X12

The EDI-X12 data services contain components that convert messages between X12 and XML and generate validation error reports and acknowledgements. X12 is a standard for electronic data interchange (EDI) between trading partners over data networks. X12 is developed and maintained by the Accredited Standards Committee (ASC).

X12 message structure

An X12 message contains the following layers:
Each transaction set contains a header, one or more data segments, and a trailer. A transaction set might contain data such as a purchase order, an invoice, or a statement of an account.
The following sample message shows an X12 Vessel Content Details transaction set:
ST*109*0001~B4*15*0*2*19960515*1424*Statu*Equi*Equipment*D*XXXX*
Location Identifier*A*3~N9*01*Reference Identification*
Free-form Description*19960515*1424*01*01^Reference Identification^01^
Reference Identification^01^Reference Identification~Q2*X*XX*19960515*
19960515*19960515*10045*21392*A*Flight/Voy*01*Reference Identification*
B*Vessel Name*10691*B*E~V9*AAD*Event*19960515*1424*City Name*XX*XX*001*
XXXXXX*25946*Tr*Free-Form Message*01*25878*XXXXXX*717*437*272*2457*
12935~R4*1*A*Location Identifier*Port Name*XX*Terminal Name*Pier*XX~DTM*
001*19960515*1424*01*CC*Date Time Period~V9*AAD*Event*19960515*1424*
City Name*XX*XX*001*XXXXXX*4685*Tr*Free-Form Message*01*13647*XXXXXX*813*
605*52*20035*12104~N9*01*Reference Identification*Free-form Description*
19960515*1424*01*01^Reference Identification^01^Reference Identification^
01^Reference Identification~SG*2*001*XX*19960515*1424*01~SE*11*0001~
Segments are delimited by tildes (~) and data elements are delimited by asterisks (*).

EDI-X12 message in XML format

The EDI-X12 parser data services can convert X12 messages into XML format. The following example shows an X12 message in XML format:
<interchange>
<delimiters>
<field_separator>*</field_separator>
<segment_separator>~</segment_separator>
<composite_separator>^</composite_separator>
<escape_character>?</escape_character>
</Delimiters>
<ISA>
<R01>00</R01>
<R02 />
<R03>00</R03>
<R04 />
<R05>01</R05>
<R06>003897733</R06>
<R07>ZZ</R07>
<R08>SLRGATEWAY</R08>
<R09>050202</R09>
<R10>1338</R10>
<R11>U</R11>
<R12>00401</R12>
<R13>000000708</R13>