Electronic Data Interchange: From Purchase Order to Invoice
Electronic data interchange lets two companies exchange structured business documents between their computer systems. Instead of asking staff to retype a purchase order or invoice, EDI sends the data in an agreed format. The receiving system can then validate the document and pass it into the suitable workflow.
But, EDI needs more than a connection. Trading partners must agree on document rules, identifiers, responses and error handling. This article explains the full order-to-invoice flow, how EDI integration works and what a business should test before switching partners to live exchange.
What electronic data interchange actually exchanges
EDI commonly handles documents such as purchase orders, shipment notices and invoices. The format gives each field an agreed place and meaning. For example, the receiving system needs to know whether a number describes a product quantity, a price or a document reference.
IBM’s explanation of electronic data interchange describes the standards and protocols behind this exchange. The business value comes from connecting those messages to actual work. A file that arrives successfully but never creates a usable order still leaves staff with a manual task.
EDI differs from emailing a PDF. A PDF mainly supports human reading, while EDI supports structured processing. But, a business may still use PDFs alongside EDI for reference or for partners who cannot support the agreed exchange.
Follow an order from buyer to invoice
Assess a hypothetical distributor that supplies a retail chain. The buyer sends an electronic purchase order. The distributor’s EDI system checks the document format, finds the buyer and maps the product codes to its own records.
Next, the distributor creates an order in its internal system. Staff review any exceptions, such as an unknown product or an not available quantity. When the warehouse ships the goods, the distributor sends a shipment notice with the data the retailer needs.
Last, the distributor sends an invoice linked to the purchase order and shipment. The buyer can compare the documents before payment. But, each partner may require different details, so the project needs that partner’s setup guide.
| Stage | Typical document | Business check |
|---|---|---|
| Buyer requests goods | Purchase order | Product, quantity, location and price mapping |
| Supplier responds | Order response or acknowledgment | Acceptance, rejection or proposed changes |
| Supplier ships | Shipment notice | Cartons, contents and delivery references |
| Supplier bills | Invoice | References, totals and partner rules |
Document names and requirements vary by standard and partner. So, treat this table as a business flow, not a universal specification. Ask each partner which messages they require and what each response means.
The four layers of EDI integration
1. Document standard
The standard describes how the document organizes data. Common families include X12 and UN/EDIFACT, while specific industries use their own conventions. Your partner may also require a specific version.
A standard gives the exchange a shared foundation, but it does not remove every difference. For example, two buyers may use the same standard while requiring different references. Those details belong in the partner mapping.
2. Transport method
The transport carries the document between companies. Depending on the arrangement, this might use AS2, SFTP or a managed network. But, successful transport only proves a specific delivery step. It does not prove that the buyer accepted the business content.
Record who manages certificates, keys and connection changes. Also agree on a test route. A certificate renewal should not become an unexpected interruption to order processing.
3. Translation and mapping
Translation turns the external message into data that your app can understand. Mapping connects partner fields to internal fields. For instance, a buyer’s item code may correspond to a different SKU in your inventory system.
Units also need mapping. A buyer may request cases while your system tracks individual items. So, a valid quantity must include the correct unit and conversion rule. Otherwise, automated processing can create a larger mistake than manual entry.
4. Business processing
Your app decides what to do with the translated data. It might create an order, send a request for review or reject a document with an invalid reference. This is where EDI connects to your daily rules.
Our article on backend development services explains the server-side controls behind reliable transactions. In an EDI project, those controls should cover duplicate handling, validation and traceable status changes.
Choose standards and partner rules together
Start with your trading partners’ requirements, rather than choosing a format in isolation. Ask for document examples, setup guides and testing expectations. Also request samples that include exceptions, not only clean orders.
GS1 US guidance on sharing data electronically finds EDI as one route for business data exchange. Product identifiers and partner conventions matter alongside the message format. So, include master-data ownership in the project plan.
Keep each partner’s settings separate from core business rules. If one retailer changes a required field, you should not need to alter every partner’s exchange. A mapping register can track versions, owners and test evidence.
Build a mapping sheet before writing the connection
A mapping sheet should find the source field, destination field, data type, requirement and transformation. It should also explain the response to missing or unknown values. This gives business and technical teams a shared reference.
For example, a ship-to code may need to map to a known delivery location. If no match exists, the system should hold the order for review. It should not quietly choose a default location that could send goods to the wrong branch.
- Partner and internal account identifiers.
- Product codes, units and conversion rules.
- Dates, time zones and delivery windows.
- Currency, prices, allowances and taxes where related.
- Order, shipment and invoice references.
- Required fields and acceptable value ranges.
- Rules for rejects, changes and partial fulfillment.
Test mappings using records from your actual workflow. A generic sample may omit the one allowance or pack size your staff use most. Meanwhile, document any field that the system receives but does not use, so nobody assumes that it drives a business decision.
Separate delivery from business acceptance
Different responses confirm different stages. One response may confirm transport, another may confirm format and another may accept the order. Staff need to understand that distinction when they review status.
Use business-friendly labels in the monitoring screen. For example, Sent, Received, Format Rejected and Awaiting Business Review communicate more than a single green success icon. But, align each label with evidence from the actual exchange.
Also define response deadlines. If an expected response does not arrive, the system should notify the owner. Waiting silently can leave an order outside the normal queue until a client asks about it.
Handle duplicates and retries safely
Networks and partner systems can fail after sending a message. A retry may then deliver the same document again. Your system should find the duplicate and avoid creating a second order or invoice.
Use identifiers that reflect the partner and transaction. But, do not assume one document number is unique across every company and every year. Agree on the scope and retention period for duplicate detection.
Keep the original document and processing history according to your retention policy. If a mapping defect affects several documents, the team may need to reprocess them. That recovery path should preserve evidence and avoid repeating completed business actions.
Plan an exception queue people can use
Automation should make unusual cases visible. Route invalid documents to a queue with a clear owner, error reason and next action. For example, purchasing may resolve an unknown item while finance handles an invoice mismatch.
Allow staff to see the original values and the mapped values. This helps them distinguish a partner problem from an internal mapping problem. Also record any manual correction, rather than changing the data without a trail.
Our article on document workflow automation covers routing and review. For EDI, the key is to apply those review controls to specific partner transactions.
Test more than one clean document
First, test a normal transaction from receipt through the final business result. Next, test unknown codes, missing fields, duplicate messages and out-of-order responses. Last, interrupt the connection and confirm that recovery avoids duplicate records.
Also test changes after an order exists. A partner may cancel a line or send a revised quantity. The app needs a clear rule for updates after picking or shipment begins.
Include cross-check. Compare source documents with internal records and outbound responses for a sample period. This can reveal messages that technically passed but never completed the planned workflow.
When a managed service or custom connection fits
A managed EDI provider may reduce partner-onboarding and transport work. A custom adapter can still connect that provider to your business system. So, you do not always need to build an entire EDI platform from scratch.
Review fees, supported partners, mapping changes, support and access to your data. Also ask how you would move to another provider. For a business selling through several channels, our article on B2B ecommerce platforms offers context for client ordering, which serves a different role from partner document exchange.
Choose a narrow pilot partner and document set. That lets the team prove mapping, monitoring and recovery before expanding. But, avoid a pilot that hides all exceptions, since it can create false confidence.
Build a partner onboarding record
Each trading partner needs a repeatable setup record. Include business contacts, technical contacts, document versions, transport details and approved mappings. Also record who can authorize a change to the connection.
Next, link test evidence to that record. A successful invoice test should find the exact mapping version and partner response. If the partner later changes its guide, the team can see which checks need another run.
But, do not store secrets in a general onboarding sheet. Keep keys and credentials in the supported secure location, while recording who manages them. The sheet should help people operate the connection without exposing access.
Plan a clear cutover date and the handling of documents already in flight. For example, orders received manually before cutover may still need electronic invoices later. Agree on their references so the buyer can match them.
Also define how the partner reports a disputed transaction. Support should be able to locate the original document, mapping result and business record from a reference. Searching unrelated server logs during every query creates needless delay.
Last, review partner activity after launch. Track rejected documents, missing responses and manual corrections. If the same exception repeats, fix the data or mapping rather than asking staff to handle it forever.
Frequently Asked Questions
Is EDI the same as an API?
No. EDI focuses on standardized business document exchange. APIs expose software functions or data. A system can use both, including an API between an EDI service and your ERP.
Can a small business use EDI?
Yes. A managed service may suit a limited partner set. Assess the required documents, transaction volume and internal integration work before choosing an approach.
Does a delivery acknowledgment mean an order is accepted?
Not necessarily. Confirm what that response proves. Transport, format validation and business acceptance can be separate stages.
Keep the pilot scope and its acceptance evidence available to both business and technical owners.
Start with the partner’s complete transaction
Electronic data interchange succeeds when documents produce correct, traceable business results. Gather partner rules, map data and test recovery before going live. Then expand only after staff can monitor and resolve the first workflow confidently.
Connect partner documents to your business system
Oxen Softwares can help plan an EDI adapter, validation workflow and exception queue around your existing app.