Online Shopping Orders Move Along a Conveyor Belt from a Warehouse Toward a Shopping Cart on a Laptop.
Atwix Team Avatar

EDI and APIs both move business data between systems, and B2B sellers often treat them as rivals. In practice, the choice is rarely yours alone. Large customers usually tell you to use EDI because their purchasing systems run on it, while your web store and your smaller customers work best over APIs. Most growing distributors and manufacturers end up running both. The real question is how to connect them so every order lands in one system, once.

The short answer

Use EDI when a trading partner requires it, typically a large retailer or distributor with an established EDI program. Use APIs for real-time connections you control: your store reading prices and stock from your ERP, or your own customers ordering through a portal. Then pick one system of record, usually the ERP, and send every order there exactly once, whether it arrived by EDI or through the website.

What EDI is

EDI (electronic data interchange) is the exchange of business documents, such as purchase orders and invoices, in a fixed, standardized format agreed between trading partners. In North America the common standard is ANSI ASC X12, which gives each document type a three-digit number. Infor’s EDI documentation, for example, lists these core supply documents:

DocumentX12 number
Purchase order850
Purchase order acknowledgment855
Advance ship notice856
Invoice810
Price and sales catalog832

Two more documents B2B sellers tend to meet early: the 860 purchase order change, which modifies an order already sent, and the 846 inventory inquiry and advice, a stock feed that trading partners often ask for once orders are flowing.

Outside North America, many companies use the UN/EDIFACT standard instead. Either way, each trading partner publishes its own implementation guide that says which documents it expects, which fields are required and how fast you must respond.

What an API is

An API (application programming interface) lets one system ask another for data or send it data directly, usually in real time. When a buyer logs into your store and sees their own price and the stock in their nearest warehouse, the store is typically calling your ERP’s API, or a middleware layer in front of it, at that moment.

Most APIs have no format shared across an industry: each system publishes its own, so every connection is built for the two systems involved. The exceptions are procurement standards such as cXML, and EDI providers that now deliver EDI documents through APIs.

EDI vs API: the differences that matter

EDIAPI
Who sets the formatThe standard and the trading partner’s implementation guideEach system’s own documentation, with a few shared standards such as cXML
TimingDocuments sent in batches or on eventsReal time, on request
Typical usePurchase orders, ship notices and invoices with large customersPrices, stock, order status and account data between your own systems
Setup effortMapping and testing per trading partnerBuilding and maintaining each connection
Who usually requires itYour customersYou
Best forHigh-volume, repeat ordering on agreed termsLive data in your store and portals
Edi and Api Order Flows Meeting in the Erp

How EDI and APIs work together

The rule that matters is one system of record, with each order posted once. Where that system sits depends on your stack.

When you run an ERP, the ERP is the center.

  1. EDI comes in through an EDI provider or translator. It receives partner documents, checks them against each partner’s rules and turns them into orders your ERP can import.
  2. Your store connects to the ERP by API. Prices, stock, order history and invoices come from the ERP in real time, so web buyers see the same numbers as EDI partners. Our Sirius connector, for example, sends web orders to Infor CloudSuite Distribution through its REST API, not through EDI.
  3. Both order streams land in the ERP. One stock pool, one invoice process and one set of customer records, whether the order came by EDI or through the website.

When the store is the system of record, EDI can go into the store. Not every B2B seller runs an ERP. In the EDI design for a current Shopify Plus project, purchase orders from a large retail customer will arrive through SPS Commerce as draft orders in Shopify. Shopify Flow will check SKUs, PO numbers and ship-to addresses before staff release them, and SPS will send the acknowledgment, ship notice and invoice back from the Shopify order. Accounting runs in QuickBooks, so the design switches off SPS’s direct accounting sync to make sure each EDI order posts there only once.

The mistake to avoid is splitting EDI and web orders across two systems of record, or posting the same order twice. Our ERP integration services cover the store-to-ERP side of this setup.

When to choose which

SituationUse
A big-box retailer or national distributor sends you purchase ordersEDI, in the format their guide specifies
Your contractors and dealers reorder onlineA customer portal backed by APIs to your system of record
Buyers need their own prices and live stock on the websiteAPI
A partner wants your full price list on a scheduleEDI 832 if they require it, otherwise an API or file feed
A partner wants regular stock updatesEDI 846 if they require it, otherwise an API feed
You ship to a partner that needs advance ship noticesEDI 856
Your sales reps place orders on behalf of customersYour store or portal, connected to the system of record by API

Common mistakes

The failures below are the ones we see most often when EDI and web orders meet.

  • Posting the same order twice. Two connectors send the same order to accounting or the ERP, for example an EDI provider’s own accounting sync running alongside the store’s. Decide which connection posts each order, and switch the other off.
  • PO-number collisions. On one Adobe Commerce client, the ERP’s EDI order-change logic matched orders by customer and PO number, so a web order that reused a PO number could overwrite an existing order. Check how change documents match orders before web and EDI orders share a system.
  • Web orders stuck at intake. Web orders that fail the ERP’s EDI or API intake checks, such as a missing ship-to number, sit on hold where nobody sees them. Validate required fields at checkout and alert someone when an order is held.
  • Ignoring each partner’s implementation guide. Required fields and response times differ by partner, and missing them gets documents rejected.
  • Assuming an API replaces a partner’s EDI requirement. If the customer’s purchasing system runs on EDI, they decide the format.

EDI vs API: frequently asked questions

Got some questions? We’re here to answer. If you don’t see your question here, drop us a line using our Contact form.

What is the difference between EDI and API?

EDI exchanges standardized business documents, such as purchase orders and invoices, between trading partners in a format the industry agrees on. An API lets two systems request or send data directly, usually in real time, mostly in a format each system defines. EDI is common between companies; APIs are common between your own systems.

Is API replacing EDI?

Not for trading partners whose purchasing systems run on EDI. Those customers set the format, so suppliers keep supporting EDI with them while using APIs for their own store, portal and ERP connections. Some EDI providers now deliver EDI documents through APIs, which blurs the line without removing the EDI format.

Do I need EDI for B2B ecommerce?

Only if your customers require it. Many B2B sellers need EDI for a few large accounts and serve everyone else through a web store or portal connected to their system of record by API.

What are the most common EDI documents?

In the X12 standard used in North America, the core order-to-invoice documents are the 850 purchase order, the 855 purchase order acknowledgment, the 856 advance ship notice and the 810 invoice. The 832 carries price and sales catalogs, the 860 changes an existing purchase order, and the 846 shares inventory.

Can EDI orders and web orders share the same inventory?

Yes, if both go into the same system of record, usually the ERP. Route EDI through an EDI provider into that system and connect the store to it by API, so both channels read from one stock pool and each order posts once.