Wednesday, 29 October 2025

EDI Using APIs — The Modern Approach

Traditional EDI uses file-based communication (via VANs, AS2, SFTP, etc.), while API-based EDI uses web services to send/receive data instantly between systems like SAP, Oracle, or Amazon Vendor Central.


1. REST API in EDI

REST APIs are the modern choice for cloud-based EDI platforms (like Cleo, SPS Commerce, or TrueCommerce).

Example: Sending an EDI 856 (ASN) through REST API

Scenario:
Supplier ships goods to Amazon and sends the ASN using an EDI REST API.

Request:

POST https://api.edi-platform.com/asn Content-Type: application/json Authorization: Bearer <AccessToken>

Payload (JSON):

{ "transactionSet": "856", "senderId": "SUPPLIER123", "receiverId": "AMAZON", "shipment": { "shipmentId": "SHIP12345", "orderNumber": "PO56789", "shipDate": "2025-10-20", "items": [ { "sku": "B0C2ZNX6T8", "quantity": 10 }, { "sku": "B0C3LMK5P9", "quantity": 5 } ] } }

Response:

{ "status": "SUCCESS", "asnId": "ASN78910", "message": "ASN received successfully by Amazon." }

Advantages of REST EDI:

  • Real-time integration (no waiting for batch jobs).

  • JSON format — easy for modern applications.

  • Better visibility and faster error handling.


2. SOAP API in EDI

SOAP APIs are often used in large enterprise systems (like SAP, Oracle EBS, or healthcare systems) where reliability, security, and transaction validation are critical.

Example: Sending an EDI 850 (Purchase Order) through SOAP API

Request (XML):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:edi="http://edi.company.com/"> <soapenv:Header/> <soapenv:Body> <edi:SendEDIMessage> <edi:TransactionSet>850</edi:TransactionSet> <edi:SenderID>BUYER001</edi:SenderID> <edi:ReceiverID>SUPPLIER001</edi:ReceiverID> <edi:Data> <edi:PO> <edi:OrderNumber>PO12345</edi:OrderNumber> <edi:OrderDate>2025-10-20</edi:OrderDate> <edi:Item> <edi:SKU>B0C2ZNX6T8</edi:SKU> <edi:Qty>20</edi:Qty> </edi:Item> </edi:PO> </edi:Data> </edi:SendEDIMessage> </soapenv:Body> </soapenv:Envelope>

Response (XML):

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <SendEDIMessageResponse> <Status>Accepted</Status> <ControlNumber>000123456</ControlNumber> </SendEDIMessageResponse> </soap:Body> </soap:Envelope>

Advantages of SOAP EDI:

  • Strong error handling (ACK/NACK within the response).

  • Secure (WS-Security, encryption, and digital signatures).

  • Reliable delivery (guaranteed message acknowledgment).

No comments:

Post a Comment

EDI Using APIs — The Modern Approach

Traditional EDI uses file-based communication (via VANs, AS2, SFTP, etc.), while API-based EDI uses web services to send/receive data ins...