E-CommerceLow setup

WooCommerce + NeutronEDI

Add EDI translation and validation to your WooCommerce workflows with a simple REST API.

WooCommerce stores hit EDI requirements when a small brand starts selling through a retailer that demands X12 documents. A WordPress plugin or a sidecar Node service mediates between the EDI middleware and WooCommerce REST API: 850s become orders, fulfillment events become 856 ASNs, and Woo invoices become 810s.

How WooCommerce + NeutronEDI works

Inbound: trading-partner EDI flows into WooCommerce. Outbound: WooCommerce data flows back out as compliant EDI.

Inbound — partner → WooCommerce

1

Trading partner sends EDI

The trading partner sends an X12 or EDIFACT document via SFTP, AS2, or a direct API call into your environment.

2

NeutronEDI translates

Your service POSTs the raw EDI to /api/v1/read/x12 (or /read/edifact). NeutronEDI returns clean JSON in milliseconds.

3

JSON flows into WooCommerce

The JSON lands in WooCommerce — mapped to native objects, imported via middleware, or consumed directly by your code (WooCommerce REST API / WP plugin actions).

Outbound — WooCommerce → partner

1

WooCommerce produces data

A shipment confirmation, invoice, or PO acknowledgment occurs inside WooCommerce. Your service picks it up via webhook, polling, or scheduled query.

2

NeutronEDI generates EDI

POST a JSON payload describing the document to /api/v1/write/x12 (or /write/edifact). NeutronEDI returns standards-compliant EDI.

3

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 WooCommerce

These are the transaction sets you'll see most often in WooCommerce integrations. The Read API parses every set NeutronEDI supports — this is just where teams typically start.

CodeNameDescription
850Purchase OrderRetailer sends purchase order to supplier
856Advance Ship NoticeSupplier notifies retailer of shipment details
810InvoiceSupplier sends invoice for delivered goods
997Functional AcknowledgmentTechnical receipt confirmation for any EDI document

How WooCommerce teams use NeutronEDI

Receive and fulfill retailer EDI purchase orders through WooCommerce

Mount a custom REST route on your WordPress site, take the raw X12, and call /api/v1/read/x12. The returned JSON drives wc_create_order() so the rest of your existing fulfillment workflow takes over.

Automate 856 ASN generation from WooCommerce shipping data

Hook into woocommerce_order_status_completed (or your shipment plugin's tracking event), build the ASN payload, and POST it to /api/v1/write/x12 with type 856. The plugin uploads the resulting X12 over SFTP.

Bridge small e-commerce operations with enterprise EDI requirements

WooCommerce + NeutronEDI gives a sub-$10M brand the same EDI capability a Fortune 500 supplier has — without buying a managed VAN subscription per trading partner.

Example integration

A WordPress plugin handler calls the NeutronEDI Read API for an inbound 850 and creates a WooCommerce order through the Admin REST API.

neutronedi-inbound.php
<?php
/**
 * Plugin Name: NeutronEDI Inbound 850
 */

add_action(
    'rest_api_init',
    function () {
        register_rest_route(
            'neutronedi/v1',
            '/inbound',
            array(
                'methods'             => 'POST',
                'callback'            => 'neutronedi_handle_inbound',
                'permission_callback' => 'neutronedi_check_secret',
            )
        );
    }
);

function neutronedi_check_secret( WP_REST_Request $request ): bool {
    return hash_equals(
        getenv( 'NEUTRON_INBOUND_SECRET' ) ?: '',
        $request->get_header( 'x-inbound-secret' ) ?: ''
    );
}

function neutronedi_handle_inbound( WP_REST_Request $request ) {
    $raw_edi = $request->get_body();

    $resp = wp_remote_post(
        'https://api.neutronedi.com/api/v1/read/x12',
        array(
            'headers' => array(
                'X-API-Key'    => getenv( 'NEUTRON_API_KEY' ),
                'Content-Type' => 'application/edi-x12',
            ),
            'body'    => $raw_edi,
            'timeout' => 15,
        )
    );

    if ( is_wp_error( $resp ) ) {
        return new WP_Error( 'neutron_read_failed', $resp->get_error_message(), array( 'status' => 502 ) );
    }

    $parsed       = json_decode( wp_remote_retrieve_body( $resp ), true );
    $created_ids  = array();

    foreach ( $parsed['transactions'] as $txn ) {
        if ( '850' !== $txn['type'] ) {
            continue;
        }

        $order = wc_create_order(
            array(
                'status'         => 'processing',
                'customer_note'  => 'EDI 850 ' . $txn['poNumber'],
            )
        );

        foreach ( $txn['items'] as $item ) {
            $product = wc_get_product( wc_get_product_id_by_sku( $item['sku'] ) );
            if ( $product ) {
                $order->add_product( $product, $item['qty'] );
            }
        }

        $order->update_meta_data( '_edi_po_number', $txn['poNumber'] );
        $order->calculate_totals();
        $order->save();
        $created_ids[] = $order->get_id();
    }

    return array( 'created' => $created_ids );
}

What the API returns

Read API response
{
  "interchange": { "sender": "REGIONALRETAIL", "receiver": "INDIEBRAND", "control": "000001401" },
  "transactions": [
    {
      "type": "850",
      "name": "Purchase Order",
      "poNumber": "RR-44512",
      "date": "2026-04-25",
      "items": [
        { "sku": "MUG-CERAMIC-12OZ", "qty": 48, "unitPrice": "5.50" },
        { "sku": "MUG-CERAMIC-16OZ", "qty": 24, "unitPrice": "6.50" }
      ],
      "total": "420.00"
    }
  ]
}

All code examples assume an API key issued from the Customer Portal. The free Developer tier includes 500 calls per month.

Getting started with WooCommerce EDI

  1. 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. 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. 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 WooCommerce expects on the receiving side.

    Read the docs
  4. 4

    Map the JSON response to your WooCommerce data model

    Use the language and runtime that already integrates with WooCommerce (WooCommerce REST API / WP plugin actions). Map fields from the NeutronEDI JSON to WooCommerce entities and persist them through the platform's standard create / update API.

Start Your WooCommerce 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.