- ANSI X12 and UN/EDIFACT are the long-established EDI standards, used heavily by large retailers, automotive and logistics.
- REST APIs with JSON do the same job using the web technologies most developers already know.
- For most Indian SMEs and mid-market businesses, API-based exchange is faster and cheaper to adopt.
If you have researched EDI, you have probably met acronyms like X12, EDIFACT, AS2 and VAN, along with price tags to match. You have also probably heard that "modern EDI is just APIs". Both are partly true. This article explains what traditional EDI standards are, how API-based exchange differs, and how to decide which fits your business.
Traditional EDI: X12 and EDIFACT
Traditional EDI defines strict, compact text formats for business documents. The two dominant standards are:
- ANSI ASC X12, used mainly in North America. Documents are numbered "transaction sets", such as 850 (purchase order), 855 (PO acknowledgement), 856 (advance ship notice) and 810 (invoice).
- UN/EDIFACT, used widely in Europe and internationally. Documents are named "messages", such as ORDERS (purchase order), DESADV (despatch advice) and INVOIC (invoice).
A fragment of an X12 purchase order looks like this:
ST*850*0001~
BEG*00*SA*PO-4471**20261012~
PO1*1*24*CA*412.50**VP*MAGGI-70G-96~
It is compact and precise, but hard for a person to read. Each partner relationship usually needs its own mapping and implementation guide.
Traditional EDI documents are typically sent over secure protocols such as AS2 or SFTP, or through a value-added network (VAN), a third-party mailbox service that often charges by document or data volume.
API-based exchange: REST and JSON
API-based exchange keeps the core idea of EDI — structured documents sent between systems — but uses the same technology as modern web and mobile apps:
- HTTPS for secure transport.
- JSON for the document format, readable by people and machines alike.
- REST endpoints for actions like sending a document or reading an inbox.
- Standard authentication to identify the calling system and organization.
The same purchase order as JSON:
{
"document_type": "purchase_order",
"receiver": "<supplier-org-uuid>",
"payload": {
"transaction_type": "purchase_order",
"po_number": "PO-4471",
"date": "2026-10-12",
"lines": [{ "item": "MAGGI-70G-96", "qty": 24, "unit": "CASE", "rate": 412.50 }]
}
}
Side-by-side comparison
| Factor | Traditional EDI (X12 / EDIFACT) | REST API + JSON |
|---|---|---|
| Format | Compact, segment-based text | Human-readable JSON |
| Transport | AS2, SFTP, VAN | HTTPS |
| Developer skills | Specialist EDI knowledge | Common web development skills |
| Setup per partner | Often weeks, with mapping and testing | Typically days |
| Cost model | Software, VAN fees, consultants | Platform subscription or usage |
| Feedback | Separate acknowledgement messages (e.g. 997 / CONTRL) | Immediate HTTP response, plus status endpoints |
| Best fit | Large retailers and global supply chains that mandate it | SMEs, mid-market, domestic B2B networks |
When traditional EDI still makes sense
If a large customer, such as a global retailer or an automotive OEM, mandates X12 or EDIFACT, you'll need to support it for that relationship. These standards are deeply embedded in some industries and aren't going away. Many businesses therefore run both: traditional EDI for the few partners who require it, and API-based exchange for everyone else.
Why API-based exchange suits Indian businesses
- Lower barrier to entry. Any developer who has built a web integration can connect.
- Works with local ERPs. Connectors for systems like Tally and BUSY can be built on API-based exchange. See connecting Tally and BUSY with trading partners.
- Flexible payloads. JSON can carry GST-specific fields such as GSTIN, HSN codes and the e-invoice IRN without waiting for a standard to be revised.
- Immediate feedback. Errors come back in the API response, not in a separate acknowledgement file hours later.
How the DocBridge API works
DocBridge is API-first. Every call is authenticated and carries an X-Organization-Id header identifying the calling organization. Five endpoints cover the whole workflow:
| Endpoint | What it does |
|---|---|
POST /api/documents/send/ | Send a structured document to a receiving organization |
GET /api/documents/inbox/ | List documents received, filterable by status, paginated |
GET /api/documents/outbox/ | List documents sent, with their status and remarks |
PATCH /api/documents/status/ | Accept or reject documents in bulk, with remarks |
POST /api/organizations/validate/ | Check that a partner organization exists and is active |
Every response — success or error — shares the same shape: success, message and, where relevant, data. That keeps client code simple and predictable. You can try the request and response examples on the DocBridge home page.
Security considerations for either approach
- Use encrypted transport: AS2 or HTTPS, never plain FTP or HTTP.
- Authenticate every system and scope it to its own organization's documents.
- Validate partners before sending, so documents never go to the wrong or an inactive organization.
- Keep an audit trail of every document, status change and remark.
Conclusion
X12 and EDIFACT built the world's supply chains, and they remain essential where large partners mandate them. For most growing businesses, especially in India's domestic B2B trade, a REST API with JSON documents gets you the benefits of EDI — structured, system-to-system exchange — faster, at lower cost and with skills your team already has.
Frequently asked questions
What are X12 and EDIFACT?
They are the two main traditional EDI standards. ANSI X12 is common in North America and uses numbered transaction sets such as 850 for purchase orders and 810 for invoices. UN/EDIFACT is common internationally and uses messages such as ORDERS and INVOIC.
Is a JSON API a replacement for EDI?
It is a modern way to do the same job — exchanging structured business documents between systems — using web standards developers already know. Large retailers may still require X12 or EDIFACT.
How does the DocBridge API work?
Systems authenticate, identify their organization with an X-Organization-Id header, and call REST endpoints to send documents, read the inbox and outbox, update status and validate partners. All responses share one JSON shape.