Previous Topic: DRDANext Topic: Generic XML Payload Parser Data Protocol


EDI X12 Data Protocol

The EDI X12 data protocol transforms ANSI X12 EDI documents into an XML representation in the body of the request. The DPH also creates a VSE request operation consisting of the EDI document type (for example, 835) combined with the specific document version (for example, 004010) and a series of VSE request arguments. These request arguments are the flattened representation of the XML body. They are formed by combining the XML elements, which are separated by _ for tags or @ for each tag attribute for the argument name and the element value for its value.

For example, if the following ANSI X12 EDI 850 document:

ISA*00* *00* *ZZ*0011223456 *ZZ*999999999 *990320*0157*U*00300*000000015*0*P*~$
GS*PO*0011223456*999999999*950120*0147*5*X*003040$
ST*850*000000001$
BEG*00*SA*95018017***950118$
N1*SE*UNIVERSAL WIDGETS$
N3*375 PLYMOUTH PARK*SUITE 205$
N4*IRVING*TX*75061$
N1*ST*JIT MANUFACTURING$
N3*BUILDING 3B*2001 ENTERPRISE PARK$
N4*JUAREZ*CH**MEX$
N1*AK*JIT MANUFACTURING$
N3*400 INDUSTRIAL PARKWAY$
N4*INDUSTRIAL AIRPORT*KS*66030$
N1*BT*JIT MANUFACTURING$
N2*ACCOUNTS PAYABLE DEPARTMENT$
N3*400 INDUSTRIAL PARKWAY$
N4*INDUSTRIAL AIRPORT*KS*66030$
PO1*001*4*EA*330*TE*IN*525*VN*X357-W2$
PID*F****HIGH PERFORMANCE WIDGET$
SCH*4*EA****002*950322$
CTT*1*1$
SE*20*000000001$
GE*1*5$

the resulting VSE request object contains:

Operation: 850-00340

Arguments: A subset of these name/value pairs follows:

interchange_sender_address <null>
interchange_sender_address@Id	0011223456
interchange_sender_address@Qual	ZZ
interchange_receiver_address <null>
interchange_receiver_address@Id	999999999
interchange_receiver_address@Qual	ZZ
interchange_group_transaction_segment_element_1 00
...

Body: Structured as follows. The XML document has been formatted in this document for readability. The request body does not contain formatting elements such as line ends and indentation.

<?xml version="1.0" encoding="UTF-8"?>
<ediroot>
    <interchange Standard="ANSI X.12" Date="990320" Time="0157" StandardsId="U" Version="00300"
        Control="000000015">
        <sender>
            <address Id="0011223456 " Qual="ZZ"/>
        </sender>
        <receiver>
            <address Id="999999999 " Qual="ZZ"/>
        </receiver>
        <group GroupType="PO" ApplSender="0011223456" ApplReceiver="999999999" Date="950120"
            Time="0147" Control="5" StandardCode="X" StandardVersion="003040">
            <transaction DocType="850" Name="Purchase Order" Control="000000001">
                <segment Id="BEG">
                    <element Id="BEG01">00</element>
                    <element Id="BEG02">SA</element>
                    <element Id="BEG03">95018017</element>
                    <element Id="BEG06">950118</element>
                </segment>
                <loop Id="N1">
                    <segment Id="N1">
                        <element Id="N101">SE</element>
                        <element Id="N102">UNIVERSAL WIDGETS</element>
                    </segment>
                    <segment Id="N3">
                        <element Id="N301">375 PLYMOUTH PARK</element>
                        <element Id="N302">SUITE 205</element>
                    </segment>
                    <segment Id="N4">
                        <element Id="N401">IRVING</element>
                        <element Id="N402">TX</element>
                        <element Id="N403">75061</element>
                    </segment>
                </loop>
                <loop Id="N1">
                    <segment Id="N1">
                        <element Id="N101">ST</element>
                        <element Id="N102">JIT MANUFACTURING</element>
                    </segment>
                    <segment Id="N3">
                        <element Id="N301">BUILDING 3B</element>
                        <element Id="N302">2001 ENTERPRISE PARK</element>
                    </segment>
                    <segment Id="N4">
                        <element Id="N401">JUAREZ</element>
                        <element Id="N402">CH</element>
                        <element Id="N404">MEX</element>
                    </segment>
                </loop>
                <loop Id="N1">
                    <segment Id="N1">
                        <element Id="N101">AK</element>
                        <element Id="N102">JIT MANUFACTURING</element>
                    </segment>
                    <segment Id="N3">
                        <element Id="N301">400 INDUSTRIAL PARKWAY</element>
                    </segment>
                    <segment Id="N4">
                        <element Id="N401">INDUSTRIAL AIRPORT</element>
                        <element Id="N402">KS</element>
                        <element Id="N403">66030</element>
                    </segment>
                </loop>
                <loop Id="N1">
                    <segment Id="N1">
                        <element Id="N101">BT</element>
                        <element Id="N102">JIT MANUFACTURING</element>
                    </segment>
                    <segment Id="N2">
                        <element Id="N201">ACCOUNTS PAYABLE DEPARTMENT</element>
                    </segment>
                    <segment Id="N3">
                        <element Id="N301">400 INDUSTRIAL PARKWAY</element>
                    </segment>
                    <segment Id="N4">
                        <element Id="N401">INDUSTRIAL AIRPORT</element>
                        <element Id="N402">KS</element>
                        <element Id="N403">66030</element>
                    </segment>
                </loop>
                <loop Id="PO1">
                    <segment Id="PO1">
                        <element Id="PO101">001</element>
                        <element Id="PO102">4</element>
                        <element Id="PO103">EA</element>
                        <element Id="PO104">330</element>
                        <element Id="PO105">TE</element>
                        <element Id="PO106">IN</element>
                        <element Id="PO107">525</element>
                        <element Id="PO108">VN</element>
                        <element Id="PO109">X357-W2</element>
                    </segment>
                    <loop Id="PID">
                        <segment Id="PID">
                            <element Id="PID01">F</element>
                            <element Id="PID05">HIGH PERFORMANCE WIDGET</element>
                        </segment>
                    </loop>
                    <loop Id="SCH">
                        <segment Id="SCH">
                            <element Id="SCH01">4</element>
                            <element Id="SCH02">EA</element>
                            <element Id="SCH06">002</element>
                            <element Id="SCH07">950322</element>
                        </segment>
                    </loop>
                </loop>
                <loop Id="CTT">
                    <segment Id="CTT">
                        <element Id="CTT01">1</element>
                        <element Id="CTT02">1</element>
                    </segment>
                </loop>
            </transaction>
        </group>
    </interchange>
</ediroot>