Electronic Data Interchange (EDI) and E-Commerce: Layers, X12 Segments and Legal Validity Explained

Learn EDI from the business document to the X12 envelope, then follow it through a VAN, a 997 acknowledgment, signature verification and Indian cyber law.

KnowledgeGate Team

Exam prep & CS education

Updated 26 Oct 20265 min read

EDI separates business meaning, standard syntax, envelopes and transport. A purchase order can therefore move from a buyer's ERP to a supplier's system without re-keying, while applicable law governs its legal recognition. For document-lifecycle controls, replay protection and exception handling, use Electronic Data Interchange and E-Commerce: Secure Workflows, Cyber Law and Worked Examples. PO 4471 exposes the narrower X12 question: how one order becomes an 850, moves through a VAN, receives a 997 and gains signature-backed evidence.

What EDI actually is and why it is not just email

Electronic Data Interchange (EDI) is the computer-to-computer exchange of standard business documents between organisations. Purchase orders, invoices and shipping notices move in a structured, machine-readable format, so neither side needs to re-key the data.

What to compare

Email or PDF

Shared portal

EDI

Format

Free text or document

Web form

Standard segments

Main reader

Human

Human using a site

Business application

Re-keying

Usually required

Required at entry

Not required

E-commerce is the wider activity of doing business electronically. EDI is its highly structured B2B channel and predates the web. Modern APIs can exchange JSON for a similar purpose, but ANSI X12 and UN/EDIFACT remain important business-document standards.

EDI layers: business meaning, translation, envelopes and transport

An EDI system has four working layers, top to bottom:

  1. Application or semantic layer: the ERP holds the business meaning, such as an order for 500 units of SKU-4471.

  2. Standards translation layer: translator software maps internal fields to a public standard, such as X12 850 or EDIFACT ORDERS.

  3. Packing or EDI-standard layer: transaction sets are placed inside functional-group and interchange envelopes for routing and batching.

  4. Communication or transport layer: the enveloped file travels through a Value Added Network (VAN) or an Internet method such as AS2 or FTP.

The receiver applies the same layers in reverse: receive, de-envelope, translate and load the meaning into its ERP. X12 uses numeric transaction sets, including 850 for purchase orders, 810 for invoices, 856 for ship notices and 997 for functional acknowledgments. EDIFACT names the corresponding messages ORDERS, INVOIC, DESADV and CONTRL.

Worked example: turning a purchase order into an X12 850

Start with the human-readable order:

Field

Value

Buyer

ABC Retail, ID 8012345678

Supplier

XYZ Supplies, ID 9087654321

Purchase order

4471, dated 15 Jan 2025

Line 1

500 units of SKU-4471 at 45.00 each

Line 2

200 units of SKU-8890 at 12.50 each

The line values are 500 × 45.00 = 22,500 and 200 × 12.50 = 2,500, so the order total is 22,500 + 2,500 = 25,000. The translator can produce this X12 850, using * as the element separator and ~ as the segment terminator:

Code
ISA*00*          *00*          *ZZ*ABCRETAIL      *ZZ*XYZSUPPLIES    *250115*1200*U*00401*000000905*0*P*>~
GS*PO*ABCRETAIL*XYZSUPPLIES*20250115*1200*905*X*004010~
ST*850*0001~
BEG*00*SA*4471**20250115~
N1*BY*ABC Retail*92*8012345678~
N1*SE*XYZ Supplies*92*9087654321~
PO1*1*500*EA*45.00**SK*SKU-4471~
PO1*2*200*EA*12.50**SK*SKU-8890~
CTT*2~
SE*8*0001~
GE*1*905~
IEA*1*000000905~

ISA/IEA is the outer interchange envelope with control number 000000905. GS/GE is the functional group for purchase orders, with control number 905. ST/SE encloses one 850 transaction set, identified as 0001.

The two counts are deliberate. CTT*2 counts the two PO1 line items. SE*8 counts every segment from ST to SE, inclusive: ST + BEG + N1 + N1 + PO1 + PO1 + CTT + SE = 8. XYZ's translator reads ST*850 and loads the order into its sales system without human re-keying.

PO 4471 from ABC Retail to XYZ Supplies shown beside its X12 850, with the ISA, GS and ST envelopes and the CTT and SE counts marked.

How an EDI message travels through a VAN

The end-to-end route is a six-step flow:

  1. ABC Retail's ERP creates PO 4471.

  2. Its translator generates the 850.

  3. The file enters ABC's outbound VAN mailbox.

  4. The VAN routes it using the XYZSUPPLIES receiver ID.

  5. XYZ's translator de-envelopes and loads it into XYZ's ERP.

  6. XYZ returns a 997 Functional Acknowledgment.

A VAN is a managed post office for trading partners. It provides mailboxes, routing, store-and-forward delivery, audit trails and basic format checks. AS2 instead sends EDI point to point over the Internet with encryption and receipt mechanisms. The wider protocol context is useful practice in Computer Networks Application Layer MCQs.

A 997 confirms receipt and structural validity, not commercial acceptance. An X12 855 Purchase Order Acknowledgment is a separate business response.

The 850 moves from ABC Retail's ERP through its translator, a VAN mailbox and XYZ's translator into XYZ Supplies' ERP, with a 997 returning.

An EDI order needs confidentiality, integrity and non-repudiation. Encryption hides commercial data, integrity controls expose a changed quantity, and a digital signature links the record to its sender.

For the exam model, signing the 850 has four steps:

  1. ABC hashes the complete 850 payload to obtain digest H.

  2. ABC applies its private-key signing operation to H, producing signature S.

  3. ABC sends the 850 with S.

  4. XYZ uses ABC's public key to verify S, hashes the received 850 independently and compares the digests.

If 500 becomes 5000, the new digest differs and verification fails. Remember the direction: the sender's private key signs and the sender's public key verifies. Confidentiality uses the receiver's public key for encryption and the receiver's private key for decryption.

The official Information Technology Act, 2000 text on India Code is the authority for the definitions of electronic records and signatures, their legal recognition, electronic contracts and attribution of records. The safe legal conclusion is that an EDI order is not denied recognition merely because it is electronic. Whether a particular order forms an enforceable contract still depends on the applicable facts and contract rules.

E-commerce models: EDI is the B2B fit

B2B is business to business, as when ABC Retail orders stock from XYZ Supplies. B2C is a business selling a course or book to an individual through a website. C2C is one consumer selling to another through a marketplace. C2B is an individual offering work, content or a service to a business.

EDI is the classic B2B backbone. Consumer-facing commerce relies more visibly on storefronts, payment gateways, APIs and browser TLS, while enterprise orders still need structured exchange. Behind both, reliable order and payment records depend on transactional database guarantees.

EDI and X12 traps that cost marks

  • EDI is not email. Email carries human-read content; EDI carries application-read standard segments without re-keying.

  • SE includes both ends. In the worked 850, count ST, BEG, two N1, two PO1, CTT and SE. The result is 8.

  • A 997 is not acceptance. It reports receipt and syntax status. Commercial acknowledgment is separate.

  • Signature keys have a direction. Sign with the sender's private key and verify with the sender's public key.

  • Electronic does not mean legally inferior. Point the legal conclusion at the IT Act itself, and never quote section numbers from memory.

The short version and your next step

Recall the spine: EDI exchanges standard business documents application to application. Translation creates X12 or EDIFACT messages, envelopes pack them, a VAN or Internet transport carries them, a 997 reports receipt and syntax, and digital signatures protect integrity and origin. The IT Act supplies the legal framework, and e-commerce places this machinery mainly inside B2B.

For a structured path across cryptography, PKI, cyber law and network security, use GATE Guidance by Sanchit Sir. If you need a foundations-up CS sequence, Zero to Hero, Complete CS Course is the broader route; the GATE category is the browse-all starting point.