Trigger ASN generation from your WMS or shipping system when a shipment is confirmed — capture shipDate, carrierCode (e.g., 'UPS', 'FDXE'), trackingNumber, BOL number, and packed carton contents (quantity per SKU per carton/pallet).
Map the shipment data to the JEDI JSON structure for X12 856: BSN segment (shipmentIdentificationNumber, date, time, hierarchicalStructureCode), HL loops for shipment > order > item hierarchy, TD1 for carrier/pack details, TD5 for routing, and REF segments for PO and order references.
POST the JEDI JSON to Stedi's translate endpoint with the 856 Guide ID to produce X12 EDI text; review the translated output for correct HL nesting (HL01 shipment, HL02 order, HL03 item parent-child references).
Send the translated 856 via the Stedi outbound API to the retailer's trading partner profile — many retailers require the ASN to be transmitted before or at the time of physical delivery.
Await and process the retailer's 997 Functional Acknowledgment — an accepted 997 does not mean the ASN was reconciled against the PO; monitor for any subsequent 824 Application Advice indicating content errors.
Store the BSN02 shipmentIdentificationNumber and the PO references in your order management system so the 810 invoice can cross-reference the same shipment.
Known gotchas
HL loop numbering must be sequential (HL01=1, HL02=2, etc.) and the parent HL reference (HL03) must point to the correct parent level — incorrect HL references cause 997 rejection with error code 3 or 4.
Many major retailers (Walmart, Target, Home Depot) have strict ASN compliance programs and issue chargebacks for late, missing, or inaccurate ASNs — confirm the retailer's timing requirement (often 'before delivery' or within a specified window).
The TD5 routing segment requires a carrier code from the SCAC (Standard Carrier Alpha Code) list; using an informal carrier name instead of the 2-4 letter SCAC code will fail EDI validation.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp