PHP EDI X12 Parsing

10.6k views Asked by At

I have a project to implement an EDI solution into an existing ecommerce-like website. There are only three EDI documents involved and only one company to transfer files with. They have strictly defined the X12 documents, and will be responsible for all of the GET/PUT's to an FTP site. The three documents are the Inventory Advice (inbound), Shipment Notification (inbound), and Invoice (outbound).

We do not want/need to implement a full-blown EDI management solution. My question is, am I crazy to think that this is a relatively simple parsing task using PHP? Does anyone know of any existing PHP libraries that might be useful (maybe X12 to XML)? My searches have come-up empty. I'd like to get started on my own right away if it is a realistic goal and no other resources are available.

3

There are 3 answers

2
Francis Upton IV On

The designer for the Oakland Data Transformer is free and this allows you to really understand the structure of the X12 document in the context of your sample document. You will need to contact Oakland Software support to get the required EDI definitions.

Depending on what you need, if you are just parsing the documents you should be able to do it pretty easily with PHP and understanding the context using the above product will take the mystery out of it for you.

Full disclosure: I run Oakland Software.

0
Aleksandar Vucetic On

I was looking for something like that for .NET ... and nothing (at least not free, but really expensive). I don't think that you will find anything for php. I've ended up with simple code to do parsing (edi 850) and extract info that I needed. I think that it would be the best approach for you as well.

1
dolito On

It's old, but I found it using google and maybe my answer will help someone...

  1. I found in a comment on pear.php.net http://code.google.com/p/izi-sandbox/source/browse/#svn%2Ftrunk%2Fphp%2Fphp_edi

  2. I found searching for EDIFACT on github https://github.com/markfoster/php_edifact