X12 313 — Shipment Status Inquiry (Ocean)
The 313 queries the status of an in-transit ocean shipment — container position, ETA milestone, port events — from an ocean carrier or terminal operator.
Purpose
The 313 documents a structured query on the status of a container or BL: where is it, when does it arrive, what events have been recorded. It is typically emitted by a freight forwarder or consignee querying the ocean carrier.
It triggers a 315 (Status Details Ocean) in reply. Acknowledged by 997. Largely replaced by modern REST APIs (Maersk, MSC, Hapag-Lloyd), but persists in legacy contracts.
Envelope structure
The 313 travels within the three X12 envelope levels (ISA/IEA,
GS/GE with functional group IS, and ST/SE).
Didactic example in release 004010:
ISA*00* *00* *ZZ*FORWARDER *ZZ*OCEANCARRIER *260515*1130*U*00401*000000313*0*P*>~
GS*IS*FORWARDER*OCEANCARRIER*20260515*1130*1*X*004010~
ST*313*0001~
B4*04*Q*20260515~
N9*BM*BL-2026-7788~
N9*EQ*MSCU1234567~
Q5*XB*20260515~
SE*7*0001~
GE*1*1~
IEA*1*000000313~ Common segments
- Header —
ST,B4(Beginning Segment for Inquiry or Reply). - BL reference —
N9*BM. - Equipment reference —
N9*EQ(Container number). - Status type —
Q5*XB(Status reason — Bypass / Update). - Summary —
SE.
Common pitfalls
- EDI vs API parity: a 313 must return the SAME milestones as the carrier API; a divergent timeline makes the carrier non-auditable.
- Container vs BL key: querying by container number without BL is not always resolvable on the carrier side; always carry both keys.
- Stale data: a 315 reply older than 6 h is considered stale by enterprise shippers; document the timestamp of the last event.
Related transactions
Documentation
The code 313 and the name Shipment Status Inquiry (Ocean) are public and listed on x12.org/products/transaction-sets. The complete structure of loops, qualifiers and code lists is distributed by DISA via the proprietary Implementation Guides (TR3). ediverse.io covers only public concepts, the envelope and didactic examples.