Friday, 5 June 2026

Learning EDI - Day 2 : Difference Between EDI, XML, JSON, and Flat Files

1. EDI (Electronic Data Interchange)

EDI follows industry standards.

Example (X12 850 Purchase Order)

ISA*00*          *00*          *ZZ*BUYER*
GS*PO*BUYER*SUPPLIER*
ST*850*0001
BEG*00*NE*PO12345
SE*4*0001
GE*1*1
IEA*1*000000001

Characteristics

  • Highly standardized
  • Used between trading partners
  • Requires EDI translator/mapping
  • Common in retail, healthcare, logistics, manufacturing

2. XML (Extensible Markup Language)

XML uses opening and closing tags.

Example

<PurchaseOrder>
    <OrderNumber>PO12345</OrderNumber>
    <Customer>ABC Hospital</Customer>
</PurchaseOrder>

Characteristics

  • Self-describing
  • Easy to validate using XSD
  • Widely used in SAP, Oracle, enterprise applications

3. JSON (JavaScript Object Notation)

JSON uses key-value pairs.

Example

{
  "OrderNumber": "PO12345",
  "Customer": "ABC Hospital"
}

Characteristics

  • Lightweight
  • Easy to read
  • Popular for REST APIs
  • Common in cloud integrations

4. Flat Files

Plain text files with delimiters or fixed positions.

CSV Example

PO12345,ABC Hospital,100

Pipe Delimited Example

PO12345|ABC Hospital|100

Fixed Length Example

PO12345   ABC Hospital       100

Characteristics

  • Very simple
  • Easy to create
  • Common in legacy systems
  • Often used in SAP PI/PO and batch integrations

Example

Imagine a customer sends a Purchase Order.

EDI Version

BEG*00*NE*PO12345

XML Version

<OrderNumber>PO12345</OrderNumber>

JSON Version

{
  "OrderNumber":"PO12345"
}

Flat File Version

PO12345

Same business information, different formats.


When to Use What?

Use EDI when:

  • Working with retailers, distributors, hospitals, logistics providers.
  • Exchanging official business documents.
  • Trading partners require standards like X12 or EDIFACT.

Use XML when:

  • Integrating enterprise systems.
  • Need strong validation and hierarchical data.

Use JSON when:

  • Building APIs.
  • Cloud integrations.
  • Modern web applications.

Use Flat Files when:

  • Legacy systems are involved.
  • Batch processing is sufficient.
  • Simplicity is preferred.

 

No comments:

Post a Comment

Learning EDI - Day 2 : Difference Between EDI, XML, JSON, and Flat Files

1. EDI (Electronic Data Interchange) EDI follows industry standards. Example (X12 850 Purchase Order) ISA*00*           *00*          ...