Zum Inhalt springen
SAP, DATEV and Dynamics experts
All Articles Integration

EDI Integration: Coupling EDIFACT to the Shop 2026

14 min read
EDIEDIFACTMiddlewareB2BIntegration

In B2B trade an order rarely arrives as a click in the shop, but as a structured EDIFACT message from the trading partner's system. An ORDERS message should then become an order within seconds, a DESADV despatch advice should announce the goods receipt, and an INVOIC should flow cleanly into accounting. For this to work, you need a layer that reads the cryptic EDIFACT format, maps it onto your shop and ERP schema and exchanges it over secured transports such as AS2 or SFTP. The UN/EDIFACT directory spans over 200 message types (UNECE), and the global EDI market was valued at USD 36.58 billion for 2024 (Fortune Business Insights). This article shows how an EDI integration works step by step, what role the converter and the middleware play, how mapping, validation and acknowledgements interact, and what matters for transport and error handling in practice.

Coupling EDIFACT between Trading Partner and ShopTrading PartnerSupplier / CustomerUN/EDIFACT D.96AUNB ... UNZ envelopeEDI ConverterMapping in the middlewareEDIFACT to JSONSegment validationReceipt MDN / CONTRLShop and ERPShopware CE plus ERPREST and GraphQLOrder / documentAS2 / OFTP2MDN receiptAPI callstatus backMessage Types in the Order ProcessORDERSOrder partner to shopcreates order in systemDESADVDespatch advice for shippingannounces goods receiptINVOICInvoice as documentclaims paymentCONTRLSyntax acknowledgementconfirms receiptSecuring the TransportAS2 with S/MIME signatureOFTP2 with encryptionSFTP with key pairMDN as proof of deliveryVerify signature and receipt before processingMapping per PartnerRead EDIFACT segment UNB / BGM / NADMap fields onto the shop schemaMaintain a partner profile per subsetUN/EDIFACT spans over 200 message types (UNECE)EDI market USD 36.58bn in 2024, CAGR 12.1 percent to 2032 (Fortune Business Insights)

What EDI and EDIFACT Mean in the Shop Context

EDI stands for Electronic Data Interchange, the automated exchange of business documents between the IT systems of two partners without manual intervention. EDIFACT is the standard that dominates this in Europe: a rule set maintained by the United Nations that defines how an order, a delivery note or an invoice looks as a sequence of segments and data elements. While ANSI X12 is widespread in North America, Europe predominantly uses UN/EDIFACT (Wikipedia, EDIFACT). An EDIFACT message is not made for humans: it consists of segments such as UNB for the envelope, BGM for the document header and NAD for addresses, each with delimiters rather than plain-text field names.

This compactness is both a strength and a hurdle. It keeps the exchange lean and machine-readable but requires a translation into the shop's data model. More than 160,000 companies worldwide now use some form of EDI, processing over 23 billion transactions annually (market.us, EDI Software Market). For a Shopware CE shop this means: as soon as large trading partners, suppliers or retail chains appear as customers, there is rarely a way around EDI. The integration happens not in the shop itself but in an upstream integration layer that translates EDIFACT into API calls and back.

Economically the trend is clear: the global EDI market is projected to grow from USD 36.58 billion in 2024 at an annual rate of 12.1 percent to USD 91.22 billion by 2032 (Fortune Business Insights). The drivers are cloud-based EDI solutions and increasing B2B integration. Those who open their shop to trade with large partners benefit from this standardization but must build the bridge between EDIFACT and modern API development deliberately and cleanly rather than treating it as a sideshow.

ORDERS, DESADV and INVOIC: The Key Message Types

A small number of message types appear especially often in the order process between trading partner and shop. The EANCOM subsets, a variant of EDIFACT maintained by the standards organization GS1, single out ORDERS, DESADV and INVOIC as the three most frequently used messages (GS1, EANCOM). They form the core of the order-to-cash flow: order, despatch advice and invoice. They are complemented by technical acknowledgements that confirm a message has arrived in syntactically correct form.

ORDERS: The Order

The trading partner sends an order as ORDERS. From it the middleware creates an order in the shop or ERP within seconds. The unique idempotency key is the partner's order number.

DESADV: The Despatch Advice

The despatch advice announces a shipment before the goods arrive. It carries details on line items, quantities and packages and enables a prepared goods-receipt booking.

INVOIC: The Invoice

The INVOIC claims payment for delivered goods. It flows as a structured document into accounting and can be reconciled automatically against order and delivery.

ORDRSP: The Order Response

With an order response the seller reports back which line items it can deliver, at what terms and dates. This surfaces discrepancies early.

CONTRL: The Syntax Acknowledgement

The CONTRL message confirms purely technically that a message was received in syntactically correct form. It is not a business commitment but a receipt at the format level.

INVRPT and PRICAT

Inventory report and price catalogue keep availabilities and conditions in sync. This bulk data typically runs on an interval rather than as a single event.

Each partner can fill the same message type slightly differently, because EDIFACT allows many optional segments and organizations define their own subsets. In practice this means: an ORDERS from partner A is not one-to-one the ORDERS from partner B. This is precisely why every integration needs its own partner profile with its own mapping. A well-designed interface concept models these profiles cleanly separated, so that a change for one partner does not touch the others.

The EDI Converter: From Segment to Shop Object

The heart of any EDI integration is the converter. It receives the raw EDIFACT message, decomposes it into its segments and data elements and maps them onto the data model of the target system. An incoming ORDERS thus becomes an order object with customer, line items, quantities and prices, which the shop or ERP accepts via its REST or GraphQL API. In the other direction the converter produces a valid EDIFACT message again from a shop object, such as an INVOIC from a finished invoice.

ORDERS excerpt (simplified)
UNB+UNOC:3+SUPPLIER:14+RETAILER:14+260608:1015+1'
UNH+1+ORDERS:D:96A:UN:EAN008'
BGM+220+ORDER-4711+9'
DTM+137:20260608:102'
NAD+BY+4012345000009::9'
LIN+1++4014819012345:EN'
QTY+21:120'
UNS+S'
UNT+9+1'
UNZ+1+1'

The example shows the basic structure: UNB opens the envelope with sender and receiver, UNH names the message type and version, BGM carries the document number, NAD the partner address and LIN together with QTY an order line with quantity. The converter reads these segments and writes their values into the fields the shop expects. A pure format conversion is not enough: codes must be translated, units checked and article numbers mapped onto internal identifiers. This business logic belongs in the middleware, not in the shop, so that the shop's core functions stay lean.

Mapping Is Translation, Not Just Reformatting

A global article number from the LIN segment is not necessarily the shop's internal article number. The converter must resolve such keys via mapping tables, normalize units of measure and translate partner-specific codes into the internal language. Maintaining this mapping per partner is the real work of any EDI integration.

Transports: AS2, OFTP2 and SFTP Compared

An EDIFACT message must reach the other system securely. Three transports dominate B2B data exchange, and the choice depends on industry and partner. AS2 is defined in the IETF specification RFC 4130 and is based on HTTP and S/MIME (IETF, RFC 4130). It wraps EDI messages in standardized MIME structures, signs and encrypts them and returns a signed acknowledgement in the form of the Message Disposition Notification, MDN for short. AS2 has established itself as the de facto standard through its adoption in retail (Wikipedia, AS2).

CriterionAS2OFTP2SFTP
BasisHTTP plus S/MIMETCP/IP, OdetteSSH file transfer
Acknowledgementsigned MDNend-to-end receiptnone at protocol level
EncryptionS/MIME per messagesession and filetransport channel
Adoptionretail, widely usedautomotive commoncross-industry
Setupcertificate exchangecertificate exchangekey pair suffices
Best fornear-event exchangelarge files securelybatch and backfill

OFTP2 is the current version of the Odette File Transfer Protocol and is common in the automotive sector. It offers data compression, file encryption and the exchange of digital certificates between partners (Odette, OFTP2). SFTP is the simplest path: an encrypted file transfer over SSH where a key pair suffices and no certificate exchange is needed. The price of this simplicity is that SFTP knows no acknowledgement at the protocol level; a business CONTRL or status response must then be organized separately. Which variant fits is decided by the middleware design per partner; an integration often runs several paths in parallel.

The Acknowledgement Belongs to the Transport

Proof of delivery is central in EDI exchange because orders and invoices are legally relevant. AS2 and OFTP2 provide a signed acknowledgement at the protocol level. If you rely on SFTP, plan for a business response via CONTRL or a status endpoint so the sender can verify receipt. This safeguard prevents later disputes about lost documents.

Validation and Acknowledgements: Catch Errors Early

Before an incoming message flows into the shop, the middleware must check whether it is valid at all. This validation happens in several stages. First the syntax: does the message conform to the structure of the stated message type and version? Then the keys: can partner, article and addresses be resolved via the mapping? Finally the business logic: are quantities plausible, prices present, mandatory fields filled? A message that fails here must not vanish silently but must trigger a clear response.

This is exactly what the CONTRL message exists for. It acknowledges at the syntax level that a message was received correctly, or reports specifically which segment was faulty. Business responses such as an ORDRSP order response go beyond this and report whether the order was also accepted in substance. Security plays a central role: according to the OWASP API Security Project, missing or faulty authentication and authorization are among the most frequently exploited weaknesses in interfaces (OWASP API Security Top 10, 2023). An EDI integration verifies the signature and origin of every message before it processes its content.

  1. Transport check: verify the signature and encryption of the AS2 or OFTP2 message, send the MDN acknowledgement only after successful acceptance.
  2. Syntax check: validate the message against the structure of the message type and version, return a CONTRL with a concrete finding on errors.
  3. Key resolution: translate partner, article numbers and addresses into internal identifiers via mapping tables, flag unresolvable keys as a clarification case.
  4. Business check: check quantities, prices and mandatory fields for plausibility before an order or document is created in the target system.
  5. Acknowledgement and status: confirm receipt technically via CONTRL and in substance via ORDRSP so the partner knows the processing status.

The economic benefit of this diligence is considerable. In our experience, automation typically reduces manual effort in EDI processes significantly because error-prone manual entry is eliminated (project experience). A clean validation addresses exactly these sources of error by catching faulty messages early instead of letting them cause harm in downstream systems. An in-depth treatment of handling errors, retries and duplicate messages is shown in the sister article on the PIM integration product-data pipeline.

Mapping Per Partner: Why One Subset Is Not Enough

The greatest effort of an EDI integration rarely lies in the transport but in the mapping. EDIFACT gives organizations a lot of latitude in which segments they use and how they assign codes. Every large trading partner therefore maintains its own implementation guide that describes its variant of the standard. An integration with three partners usually means three mappings that share much but differ in details. Those who try to serve all partners through a single rigid schema build a construction that is hard to maintain.

The proven approach separates a shared internal data model from partner-specific profiles. The converter first translates every incoming message into the internal model and from there into the shop object, and vice versa. Changes for one partner touch only its profile. This architecture pays off as soon as partners are added or adjust their guides. Across over 50 integration projects (project experience) this clean separation has proven considerably easier to maintain than a monolithic mapping. How to design this internal model for master data is explored in the article on shipping and logistics interfaces.

The Rule of Thumb for EDI Mapping

A shared internal data model in the middle, partner-specific profiles at the edges. Every message is translated first into the internal model and then into the target object. This keeps every partner adjustment local, and new partners become a configuration rather than open-heart surgery on the system.

Architecture: Placing EDI Cleanly in the Middleware

A resilient EDI integration places all the logic in a middleware between trading partner and shop, not in the shop itself. This layer receives the message over AS2, OFTP2 or SFTP, checks signature and syntax, persists every message with a unique key and processes it asynchronously toward shop and ERP. The advantage of this decoupling is robustness: if a target system fails briefly, the message stays safely in the queue and is retried without the partner noticing. According to Gartner, integration initiatives fail above average on non-functional requirements such as load behavior and fault tolerance (Gartner, 2024), not on the business logic.

Persistence with an idempotency key is central here, because even in EDI exchange a message can arrive more than once, for example after a repeated delivery. The key, often the document number from the BGM segment, ensures that the same order is not created twice. This decoupling also makes it possible to separate heavy processing from fast acceptance: the acknowledgement confirms safe receipt, the actual order creation happens in the background. These principles apply equally to a SAP integration and to coupling with another ERP.

Economically the effort pays off because B2B trade keeps growing. German B2B e-commerce, with a sales volume in the triple-digit billions, is among the fastest-growing distribution channels (BEVH, 2024), and the industry association BITKOM sees the automation of business processes as one of the most important levers for efficiency gains (BITKOM, 2024). Statista reports sustained double-digit growth of digital commerce in German e-commerce over recent years (Statista, 2024). An EDI integration is the technical prerequisite for participating in this growth with large partners without drowning in manual effort. An accompanying integration consultation helps align the integration to your specific partners and processes.

The real art of an EDI integration lies not in reading EDIFACT but in coupling every partner with its own subset cleanly to a shared model, without one change toppling the others.

From the project practice of the ERP Integration Agency
This article is based on data from: Fortune Business Insights EDI Software Market (2024), UNECE UN/EDIFACT Directory, GS1 EANCOM, IETF RFC 4130 (AS2), Odette OFTP2, OWASP API Security Top 10 (2023), Gartner Integration Research (2024), BITKOM Digitalization Survey (2024), Statista E-Commerce Report (2024), BEVH Industry Study (2024) and our own project experience.