Your files are read in your browser. Orders and pricing never leave your computer.
EDIParse

EDI 856 HL Segment: S→O→T→P→I Hierarchy Validator & Excel Flattener

Understand how HL01 (ID), HL02 (Parent ID), and HL03 (Level Code: S, O, T, P, I) construct a packaging tree—and flatten any 856 ASN into a single Excel table.

Drop your file below, check the order, then download for Excel (.XLSX) & CSV.

Looking for the raw X12 segments (HL)? Orders open as a readable document. Select View raw EDI code (for IT) at the top right of the document to see the ANSI X12 segments side by side.
  1. 1Load your order file
  2. 2Check it and match your SKUs

Drop your EDI order file here

.edi, .x12 or .txt. The file is read on your computer and is not uploaded.

Now showing
target-856-asn-sotpi.edi
No file handy? Open a sample:

No chargeback risks found. This order passes every check.

Checked against the Target supplier guide for EDI 856.

  • Verified 3 GS1-128 (SSCC-18) Modulo 10 barcodes across 7 HL hierarchy nodes.

Raw EDI Code Inspector

39 lines
1ISAISA*00* *00* *12*5551234567 *08*6111470100 *261109*1415*U*00401*000020856*0*P*>~
2GSGS*SH*5551234567*6111470100*20261109*1415*20856*X*004010VICS~
3STST*856*0001~
4BSNBSN*00*SHP-20261109-01*20261109*1415*0001~
5HLHL*1**S~
6TD1TD1*CTN25*2****G*48.5*LB~
7TD5TD5*B*2*ODFL*M*OLD DOMINION FREIGHT LINE~
8REFREF*BM*BOL-99887766~
9REFREF*CN*PRO-1122334455~
10DTMDTM*011*20261109~
11DTMDTM*017*20261113~
12N1N1*SF*ACME HOME GOODS WAREHOUSE*92*WH-01~
13N3N3*1200 INDUSTRIAL PKWY~
14N4N4*DALLAS*TX*75201*US~
15N1N1*ST*TARGET REGIONAL DC 0555*92*0555~
16N3N3*3000 TARGET WAY~
17N4N4*MIDLOTHIAN*TX*76065*US~
18HLHL*2*1*O~
19PRFPRF*TGT-PO-889900***20261105~
20REFREF*DP*049~
21REFREF*IA*9876543~
22HLHL*3*2*T~
23MANMAN*GM*00106141410000099990~
24HLHL*4*3*P~
25MANMAN*GM*00006141410000010004~
26HLHL*5*4*I~
27LINLIN*1*IN*049-12-3456*UP*012345678905*VN*SKU-TOWEL-BLU-L~
28SN1SN1*1*50*EA~
29PIDPID*F****ORGANIC COTTON BATH TOWEL ROYAL BLUE~
30HLHL*6*3*P~
31MANMAN*GM*00006141410000010011~
32HLHL*7*6*I~
33LINLIN*2*IN*049-12-3499*UP*012345678912*VN*SKU-ROBE-WHT-XL~
34SN1SN1*2*30*EA~
35PIDPID*F****LUXURY WAFFLE ROBE WHITE XL~
36CTTCTT*7*80~
37SESE*35*0001~
38GEGE*1*20856~
39IEAIEA*1*000020856~
BSNBeginning Segment for Ship Notice (856)
Line #4

Identifies the physical shipment in an EDI 856 ASN and declares the hierarchy structure (e.g., 0001 for SOTPI/SOPI).

BSN01Transaction Set Purpose Code
00
BSN02Shipment Identification (SID)
SHP-20261109-01
BSN03ASN Creation Date (YYYYMMDD)
20261109
BSN04ASN Creation Time (HHMM)
1415
BSN05Hierarchical Structure Code
0001

Packing List & Advance Ship Notice (ASN)

Shipment ID
SHP-20261109-01
Carrier
ODFL · OLD DOMINION F
BOL / Tracking #
BOL-99887766
Total Shipped Units
80 EA (2 Cartons)
Carton Barcode (SSCC-18)Purchase Order #Ship-To Warehouse / DCYour SKU & Item IDShipped Qty
00006141410000010004
Pallet: 00106141410000099990
TGT-PO-889900
Dept: 049
TARGET REGIONAL DC 0555
DC #0555 · ZIP 76065
Item: 049-12-3456 · UPC: 012345678905
50 EA
00006141410000010011
Pallet: 00106141410000099990
TGT-PO-889900
Dept: 049
TARGET REGIONAL DC 0555
DC #0555 · ZIP 76065
Item: 049-12-3499 · UPC: 012345678912
30 EA
View Advanced Packaging Hierarchy (Optional)
Level #1 (Shipment) [S]
Level #2 (←1) [O]
Level #3 (←2) [T]
Level #4 (←3) [P]
Level #5 (←4) [I]
Level #6 (←3) [P]
Level #7 (←6) [I]

Download for your software

Pick where the order is going, then download. Files are ready for Excel, QuickBooks, Shopify or a thermal printer.

Clean Excel spreadsheet with all order lines, store breakdown, quantities, and prices ready to open in Microsoft Excel or Google Sheets.
Field mapping table: which EDI segment fills which column (for IT & bookkeepers)

EDI 856 HL03 Level Codes (S, O, T, P, I) & Child Segments

Deterministic segment-to-column mapping rules enforced by our client-side X12 engine

Source X12 Segment / ElementSample Raw ValueTarget ERP / CSV ColumnTransformation & Validation Logic
HL*1**S~ (Shipment Level)
HL01=1, HL02="", HL03=S
Root Shipment NodeContains TD1 (weight/cartons), TD5 (SCAC), REF*BM (BOL), DTM, and N1*SF / N1*ST addresses.
HL*2*1*O~ (Order Level)
HL01=2, HL02=1, HL03=O
Purchase Order NodeLinks to Shipment (1) and carries PRF (PO #) and REF*DP (Department #).
HL*3*2*T~ & HL*4*3*P~ (Tare & Pack)
HL03=T (Pallet) / HL03=P (Carton)
Container Barcode NodesCarries MAN*GM 20-digit SSCC-18 pallet and carton barcodes.
HL*5*4*I~ (Item Level)
HL01=5, HL02=4, HL03=I
Packed SKU & Quantity NodeLinks to Pack (4) and carries LIN (SKU/UPC), SN1 (Shipped Qty), and PID.

Critical Chargeback & Import Pitfalls We Prevent

Common EDI mistakes that trigger $250+ retailer fines or accounting balance errors

Non-Sequential HL01 IDs or Orphan HL02 Parent Pointers

Risk: 997 / 824 ASN Rejection

HL01 must increment sequentially (1, 2, 3, 4...), and every HL02 must point to a valid existing ancestor HL01.

Our HL tree validator checks every parent pointer and renders the visual S→O→T→P→I topology.

Putting LIN/SN1 Inside the Pack (P) Level Instead of Item (I)

Risk: Missing Line Items at Receiving

In SOTPI/SOPI structures, MAN*GM belongs under Pack (P), while LIN and SN1 must reside under a child Item (I) HL node.

Use our 850 → 856 generator to produce strictly separated P and I nodes.

CTT01 Not Matching Total HL Segment Count

Risk: ASN Integrity Error

In an 856 ASN, CTT01 counts the total number of HL segments (e.g., 7), not just the number of items (2).

Our linter and Auto-Fix tool set CTT01 to the exact HL count.

How to Validate & Flatten an 856 HL Hierarchy

Zero middleware setup — complete in under 60 seconds

1. Inspect the S→O→T→P→I Topology Badges Below

Click any HL badge in the right pane to highlight that node in the X12 AST tree.

2. Review the Flattened Packing Table

See how Shipment, Order, Pallet, and Carton attributes merge onto each Item row.

3. Export to Excel (.XLSX) or Print 4x6" Carton Labels

Download the flattened spreadsheet or print GS1-128 labels for all P nodes.

Frequently Asked Technical Questions

ANSI X12 specification details, retail companion rules, and ERP import answers

What does SOTPI stand for in an EDI 856?

S = Shipment, O = Order, T = Tare (Pallet), P = Pack (Carton/Case), I = Item. It is the standard 5-tier packaging hierarchy used by Target, Walmart, and major grocers.

How does EDIParse flatten an 856 HL tree into Excel?

For each leaf Item (I) node, our algorithm walks up the parentId chain (I -> P -> T -> O -> S) and merges all ancestor attributes into a single denormalized row.

Related EDI Converters, Retailer Guides & X12 Segment References