People working in Health care, Insurance, Transportation, Finance, Government, Supply chain, and many other industries may have already heard about EDI ASC X12 specification. This specification defines the data format standards that many of these industries follow when performing business to business (B2B) transactions. An organization can have many systems interacting over these formats, which makes it a common integration use case. Anypoint platform being an integration solution, a natural question that comes to mind is – How to do B2B integrations using MuleSoft’s Anypoint platform?

 

What is EDI X12?

Electronic Data Interchange (EDI) is an approach for business to business (B2B) communications over electronic mediums. This eliminates the need for paper communications and minimizes human interactions for completing business transmissions.

In 1979, the American National Standards Institute (ANSI) chartered the Accredited Standards Committee (ASC) X12 to develop and maintain uniform standards for inter-industry electronic exchange of business transactions – electronic data interchange (EDI).

 

 

What are EDI X12 Integrations?

As businesses communicate over EDI X12 formats, it is one of the crucial use cases for integration solutions. Organizations often require to receive X12 standard formats from their business partners and then send those to internal systems for processing.

Consider an example where XYZ Corporation would like to receive purchase invoices from ABC Supplier Inc. They can only send X12 Standard documents over SFTP to XYZ Corp.

 

For this use case, let’s assume that XYZ corporation uses Enterprise SAP and has an Invoice Processing API exposed to abstract SAP system. To enable X12 processing for ABC Supplier, the missing piece here is a solution that knows how to read and transform X12 standard formats into something that Invoice Processing API can understand.

 

MuleSoft X12 Module

MuleSoft provides many Modules (a.k.a. connectors) that help to connect with other systems or perform standard non-business related transformations. Fortunately, this collection of modules includes some EDI Modules such as X12, EDIFACT, AS2, etc.

We can use the X12 module to read the X12 Invoice documents received on SFTP and perform some business transformation on it. 

Our integration process would something like this – 

What is X12 Module?

X12 Module provides a mechanism to read, write, and validate EDI documents. It supports various versions of the X12 standard specification. It allows us to use our trading partner specific configurations and identifiers for reading and writing partner-specific documents.

In our case, we will use the read operation of the X12 module. This operation consumes EDI X12 data format and converts it into a standard java data model which then can easily be consumed by transformation components such as DataWeave. 

In Anypoint Studio, you can add this module to your project by searching it in Mule Palette. If needed, search in the exchange to download it. Once you add it to your project, you should see it in the palette – 

 

X12 Receiving flow

Once we have the X12 module added to our project, we can implement our flow to receive and parse the document. In a simplistic way, the flow would look like this – 

 

Logical operations happening in this flow – 

  1. Keep polling on SFTP server for any new files using SFTP Module

  2. Using X12 Module, read EDI file and convert to Java representation

  3. Convert EDI format into JSON model that our API can consume

  4. As there could be more than one invoices in an incoming file, send each of the converted JSON objects to remote 

Global Configurations:

    

 

X12 Module Global Configuration:


    

 

Integration flow:

     {
       description: item."060_PID_Loop"."060_PID".PID05[0],
       quantity: item."010_IT1".IT102,
       unit: item."010_IT1".IT103,
       price: item."010_IT1".IT104,
       IdCode: item."010_IT1".IT106,
       Id: item."010_IT1".IT107
   }
}]]>

 

With this flow in place, we will be able to read EDI files from SFTP folder, transform into Invoice JSON, and deliver it to our Invoice Processing API.

 

Where to go next?

This was just one standalone example of consuming EDI X12 transactions using the Anypoint platform. EDI is a vast landscape with more complicated use cases such as sending functional acknowledgments, accepting different types of documents, erroneous transaction processing, enabling a central EDI solution, etc. At AVIO, we look at these uses cases and can work on fitting them into your digital transformation journey. We evaluate how large scale B2B integrations can benefit from Anypoint Partner Manager to centralize your partner configurations. If this triggers any thought process or questions about your existing or upcoming B2B integrations, we can help you answer those, Just reach out to us.  

Join the Conversation

About the Author