Adobe Commerce (Magento) + NeutronEDI
Add EDI translation and validation to your Adobe Commerce (Magento) workflows with a simple REST API.
Adobe Commerce / Magento stores typically wire EDI through a custom module or a sidecar Node service. The Magento side is responsible for catalog, customer, and order data; NeutronEDI is responsible for translation. An observer fires on order_save, builds the ASN payload from the order's shipments, and POSTs it to /api/v1/write/x12.
How Adobe Commerce (Magento) + NeutronEDI works
Inbound: trading-partner EDI flows into Adobe Commerce (Magento). Outbound: Adobe Commerce (Magento) data flows back out as compliant EDI.
Inbound — partner → Adobe Commerce (Magento)
Trading partner sends EDI
The trading partner sends an X12 or EDIFACT document via SFTP, AS2, or a direct API call into your environment.
NeutronEDI translates
Your service POSTs the raw EDI to /api/v1/read/x12 (or /read/edifact). NeutronEDI returns clean JSON in milliseconds.
JSON flows into Adobe Commerce (Magento)
The JSON lands in Adobe Commerce (Magento) — mapped to native objects, imported via middleware, or consumed directly by your code (Magento 2 / Adobe Commerce (PHP modules, observers, REST API)).
Outbound — Adobe Commerce (Magento) → partner
Adobe Commerce (Magento) produces data
A shipment confirmation, invoice, or PO acknowledgment occurs inside Adobe Commerce (Magento). Your service picks it up via webhook, polling, or scheduled query.
NeutronEDI generates EDI
POST a JSON payload describing the document to /api/v1/write/x12 (or /write/edifact). NeutronEDI returns standards-compliant EDI.
Send to partner
Drop the resulting EDI document onto the partner's SFTP, AS2, or VAN — the same channel that delivered the inbound document.
Common EDI transactions for Adobe Commerce (Magento)
These are the transaction sets you'll see most often in Adobe Commerce (Magento) integrations. The Read API parses every set NeutronEDI supports — this is just where teams typically start.
| Code | Name | Description |
|---|---|---|
| 850 | Purchase Order | Retailer sends purchase order to supplier |
| 856 | Advance Ship Notice | Supplier notifies retailer of shipment details |
| 810 | Invoice | Supplier sends invoice for delivered goods |
| 997 | Functional Acknowledgment | Technical receipt confirmation for any EDI document |
How Adobe Commerce (Magento) teams use NeutronEDI
Process incoming EDI purchase orders as Magento orders
An admin REST endpoint receives 850s, calls /api/v1/read/x12, and uses Magento's OrderInterface to create the order with the correct customer, shipping address, and SKUs.
Generate EDI shipping notices from Magento fulfillment workflows
An observer hooks the sales_order_shipment_save_after event, walks the shipment's items and tracking numbers, and POSTs the assembled payload to /api/v1/write/x12 with type 856.
Pre-flight outbound EDI against the X12 spec before transmission
Hit /api/v1/validate/x12 before sending. The endpoint checks documents against the standard X12 spec, so structural mistakes — missing required segments, malformed envelopes, broken transaction sets — get caught locally instead of bouncing back from the partner as a 997 reject.
Example integration
A Magento 2 observer fires when an order ships, builds the 856 ASN payload from the shipment's items, and POSTs it to the NeutronEDI Write API.
<?php
declare(strict_types=1);
namespace Acme\Edi\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\HTTP\Client\Curl;
use Psr\Log\LoggerInterface;
class EdiAsnSender implements ObserverInterface
{
public function __construct(
private readonly Curl $curl,
private readonly LoggerInterface $logger,
) {
}
public function execute(Observer $observer): void
{
$shipment = $observer->getEvent()->getShipment();
$order = $shipment->getOrder();
$payload = [
'interchange' => [
'sender' => 'ACMECORP',
'receiver' => $order->getData('edi_partner') ?: 'BIGRETAILER',
],
'transactions' => [
[
'type' => '856',
'shipmentId' => $shipment->getIncrementId(),
'shipDate' => $shipment->getCreatedAt(),
'purchaseOrderNumber' => $order->getExtOrderId(),
'tracking' => array_map(
fn($t) => $t->getTrackNumber(),
$shipment->getAllTracks(),
),
'items' => array_map(
fn($item) => [
'sku' => $item->getSku(),
'qty' => (int) $item->getQty(),
],
$shipment->getAllItems(),
),
],
],
];
$this->curl->setHeaders([
'X-API-Key' => getenv('NEUTRON_API_KEY'),
'Content-Type' => 'application/json',
]);
$this->curl->post(
'https://api.neutronedi.com/api/v1/write/x12',
json_encode($payload, JSON_THROW_ON_ERROR),
);
if ($this->curl->getStatus() !== 200) {
$this->logger->error('NeutronEDI 856 generation failed', [
'status' => $this->curl->getStatus(),
'body' => $this->curl->getBody(),
]);
return;
}
$this->dropOnSftp($shipment->getIncrementId(), $this->curl->getBody());
}
private function dropOnSftp(string $shipmentId, string $rawX12): void
{
// SSH2 / phpseclib upload to the partner's SFTP server.
}
}What the API returns
ISA*00* *00* *ZZ*ACMECORP *ZZ*BIGRETAILER *260425*1130*U*00401*000001501*0*P*>~
GS*SH*ACMECORP*BIGRETAILER*20260425*1130*1*X*004010~
ST*856*0001~
BSN*00*SHP-90021*20260425*1130*0001~
HL*1**S~
TD1*CTN25*1****G*15*LB~
TD5***ZZ*UPS~
REF*BM*1ZACMETRACK01~
HL*2*1*O~
PRF*PO-99213~
HL*3*2*P~
MAN*GM*00000123450000000456~
HL*4*3*I~
LIN**VC*PART-X1~
SN1**100*EA~
CTT*4~
SE*14*0001~
GE*1*1~
IEA*1*000001501~All code examples assume an API key issued from the Customer Portal. The free Developer tier includes 500 calls per month.
Getting started with Adobe Commerce (Magento) EDI
- 1
Sign up for a free NeutronEDI Developer account
Create an account in the NeutronEDI Customer Portal. The Developer tier includes 500 API calls per month at no cost.
Open the portal - 2
Create an API key in the Customer Portal
Generate an API key from the dashboard. The plaintext key is shown once at creation; copy it into your secret store.
Read the docs - 3
Send your first EDI document to the Read endpoint
POST a sample X12 or EDIFACT document to https://api.neutronedi.com/api/v1/read/x12 with the X-API-Key header. Confirm the JSON response shape matches what Adobe Commerce (Magento) expects on the receiving side.
Read the docs - 4
Map the JSON response to your Adobe Commerce (Magento) data model
Use the language and runtime that already integrates with Adobe Commerce (Magento) (Magento 2 / Adobe Commerce (PHP modules, observers, REST API)). Map fields from the NeutronEDI JSON to Adobe Commerce (Magento) entities and persist them through the platform's standard create / update API.
Keep exploring
Start Your Adobe Commerce (Magento) EDI Integration
500 API calls per month on the Developer plan. No credit card. No sales call. Read, write, and validate X12 and EDIFACT in minutes.