Skip to content
EDI 322 — EDI TransactionPublished Nov 7, 2026

EDI 322 Terminal Operations: Ramp Activity Guide

EDI 322 explained: terminal and intermodal ramp events, the Q5, N7, R4 and N9 segments, status codes, a live sample, and how it relates to the 315 and 214.

The EDI 322 is how terminals and rail ramps tell everyone else what they did with the box. A marine terminal discharges a container, a trucker pulls it out of the gate, a port operator ramps it onto a railcar, a railroad unloads it at an inland ramp. Each of those moves is recorded by whoever operates the facility, and the 322 is the X12 message that reports it to the ocean carrier, the railroad or the customer that needs to know.

This guide covers what the 322 reports, who sends it to whom, how it relates to the 315 container status feed, every segment you will map, a live sample with a discharge and an out-gate at Los Angeles, and the errors that leave terminal events out of the shipment record.

What Is an EDI 322?

An EDI 322 is the Terminal Operations and Intermodal Ramp Activity transaction set defined by ASC X12, used to report terminal operations and intermodal ramp activity for equipment. It is built around one event per transaction: a Q5 status at the top, then one or more pieces of equipment, each with its own location, vessel, parties and references. The 322 travels in functional group SO (the GS01 value), the same group as the 304.

Authoritative references for 322 work:

Who sends it? Whoever operates the facility or the move: a marine terminal operator, a port operator ramping containers to rail, or a railroad reporting ramp events. Chassis providers also publish 322 implementation guides.

Who receives it? The party that needs the event: the ocean carrier whose container it is, the railroad taking it inland, or a shipper, consignee or forwarder that subscribed to a railroad's feed.

When is it sent? As events happen or on a schedule. The CN guides describe both: port operators send 322s as containers are ramped, and CN's customer feed can be scheduled at intervals through the day.

Why does it matter? The terminal and the ramp are where containers sit, and where storage and free time are counted. A carrier that does not get the terminal's discharge and gate events cannot send accurate 315s to its customers, and a railroad that does not get the port operator's ramp events cannot track what is on its trains.

The 322 in the Ocean Flow

SetX12 nameUsually sent byWhat it does
300Reservation (Booking Request) (Ocean)Booking partyAsks for space
301Confirmation (Ocean)Ocean carrierConfirms the booking
304Shipping InstructionsBooking partyBill of lading details
310Freight Receipt and Invoice (Ocean)Ocean carrierBill of lading data and charges
315Status Details (Ocean)Ocean carrierContainer events to the shipper, consignee or forwarder
322Terminal Operations and Intermodal Ramp ActivityTerminal, port operator or railroadEvents at terminals and ramps

The 300 to 310 documents set up the booking and the bill of lading. The 315 and the 322 report what happens to the containers afterwards, from different sources. A common pattern: the terminal records the discharge and the out-gate and sends 322s to the ocean carrier, and the carrier passes the same events on to its customers as 315s. On rail moves, the railroad may send 322s directly to the customer. Who sends what is set by the trading partner agreements, so confirm the flow with each partner.

Q5 Status Codes in a 322

The event is coded in Q501, X12 data element 157 (Shipment Status Code), the same element the 315 uses in B403 and the 214 in AT701. Each terminal or railroad uses its own subset. These codes appear in published 322 guides and the X12 list:

CodeX12 meaningWhere you will see it
UVUnloaded From VesselMarine terminal: container discharged
AELoaded on VesselMarine terminal: container loaded for export
IIn-GateTerminal or ramp: container entered
OAOut-GateTerminal or ramp: container left, usually on a truck
ALLoaded on RailPort operator or ramp: container on a railcar
RLRail Departure from Origin Intermodal RampRailroad: train departed
ARRail Arrival at Destination Intermodal RampRailroad: arrived at the inland ramp
URUnloaded from a Rail CarRailroad: off the train at the ramp
NTNotificationRailroad: customer notified
TMIntra-Terminal MovementTerminal: moved within the facility
VA / VDVessel Arrival / Vessel DepartureVessel events at the terminal

The CN customer guide lists a longer set, including bad order and repair events and interchange events between railroads, and uses an NF event to carry the last free day of storage when the customer asks for it. Codes like that come from the partner's guide only, so log any code you do not recognise and look it up there.

Interactive Example: Discharge and Out-Gate at Los Angeles

A fictional marine terminal operator at Los Angeles (SOUTHBAYCT) reports two events to the ocean carrier (SCAC BLUQ) for container QXZU4128732. One interchange carries two 322 transactions. The first reports UV, unloaded from vessel, on 20 November at 11:42 local time. The second reports OA, out-gate, on 21 November at 13:52, and adds an N1 for the drayage carrier that pulled the container. In both, N7 identifies the container with its check digit, type and owner SCAC, M7 gives the seal, V1 the vessel and voyage, R4 the terminal and N9 the bill of lading and booking numbers. All names, numbers and codes are fictional. The carrier's own 315 import milestones sample reports the same two events to the importer.

Use the Plain English tab for a readable summary, or click any segment to break it down element by element.

Live exampleContainer TerminalEDI 322

Container Terminal 322 Events: Discharged (UV) and Out-Gate (OA)

Two 322 transactions from a marine terminal to the ocean carrier for the same container at Los Angeles: Q5 reports unloaded from vessel (UV) and then out-gate (OA) with local times, N7 and M7 identify the container and seal, V1 the vessel, R4 the terminal, N1 the drayage carrier that pulled it, and N9 the bill of lading and booking numbers

Document
322 Terminal Operations and Intermodal Ramp Activity
From / to
SOUTHBAYCT → BLUQ
Segments
23
Interchange date
Nov 21, 2026

Raw EDI (X12)

1
ISA*00* *00* *ZZ*SOUTHBAYCT *02*BLUQ *261121*1400*U*00401*000003221*0*P*>~
2
GS*SO*SOUTHBAYCT*BLUQ*20261121*1400*3221*X*004010~
3
ST*322*0001~
4
Q5*UV*20261120*1142*LT~
5
N7*QXZU*412873*9210*G*******CN*BLUQ*****K*2****45G1~
6
M7*CN4417203~
7
V1*9700017*MERIDIAN HARBOR*LR*118E*BLUQ***L~
8
R4*D*UN*USLAX*LOS ANGELES*US*SOUTH BAY CONTAINER TERMINAL~
9
N9*BM*BLUQSHA2611045~
10
N9*BN*BK7730412~
11
SE*9*0001~
12
ST*322*0002~
13
Q5*OA*20261121*1352*LT~
14
N7*QXZU*412873*9210*G*******CN*BLUQ*****K*2****45G1~
15
M7*CN4417203~
16
V1*9700017*MERIDIAN HARBOR*LR*118E*BLUQ***L~
17
R4*D*UN*USLAX*LOS ANGELES*US*SOUTH BAY CONTAINER TERMINAL~
18
N1*MC*HARBORLINE DRAYAGE INC*2*HLDY~
19
N9*BM*BLUQSHA2611045~
20
N9*BN*BK7730412~
21
SE*10*0002~
22
GE*2*3221~
23
IEA*1*000003221~

Human-Readable

Interchange

Sender ID(ZZ)SOUTHBAYCT
Receiver ID(02)BLUQ
Date261121
Time1400
Standards IDU
Version00401
Control Number000003221
Acknowledgment RequestedNo
UsageProduction
Included Groups (IEA01)1

Functional Group

Functional IDSOSO
SenderSOUTHBAYCT
ReceiverBLUQ
Date20261121
Time1400
Control Number3221
Agency CodeX
Version004010
Transactions2
Reported Transaction Count (GE01)2

Transaction 322

Terminal Operations and Intermodal Ramp Activity
Transaction Type322
Control Number0001
Segments, ST to SE9
Count in SE019 (matches)

Segment Detail

Q5Status Details
Q501Shipment Status CodeUV
Q502Date20261120
Q503Time1142
Q504Time CodeLT
N7Equipment Details
N701Equipment InitialQXZU
N702Equipment Number412873
N703Weight9210
N704Weight QualifierG
N711Equipment Description CodeCN
N712Standard Carrier Alpha CodeBLUQ
N717Weight Unit CodeK
N718Equipment Number Check Digit2
N722Equipment Type45G1
M7Seal Numbers
M701Seal NumberCN4417203
V1Vessel Identification
V101Vessel Code9700017
V102Vessel NameMERIDIAN HARBOR
V103Country CodeLR
V104Flight/Voyage Number118E
V105Standard Carrier Alpha CodeBLUQ
V108Vessel Code QualifierL
R4Port or Terminal
R401Port or Terminal Function CodeD
R402Location QualifierUN
R403Location IdentifierUSLAX
R404Port NameLOS ANGELES
R405Country CodeUS
R406Terminal NameSOUTH BAY CONTAINER TERMINAL
N9Reference Identification
N901Reference Identification QualifierBM
N902Reference IdentificationBLUQSHA2611045
N9Reference Identification
N901Reference Identification QualifierBN
N902Reference IdentificationBK7730412

Transaction 322

Terminal Operations and Intermodal Ramp Activity
Transaction Type322
Control Number0002
Segments, ST to SE10
Count in SE0110 (matches)

Segment Detail

Q5Status Details
Q501Shipment Status CodeOA
Q502Date20261121
Q503Time1352
Q504Time CodeLT
N7Equipment Details
N701Equipment InitialQXZU
N702Equipment Number412873
N703Weight9210
N704Weight QualifierG
N711Equipment Description CodeCN
N712Standard Carrier Alpha CodeBLUQ
N717Weight Unit CodeK
N718Equipment Number Check Digit2
N722Equipment Type45G1
M7Seal Numbers
M701Seal NumberCN4417203
V1Vessel Identification
V101Vessel Code9700017
V102Vessel NameMERIDIAN HARBOR
V103Country CodeLR
V104Flight/Voyage Number118E
V105Standard Carrier Alpha CodeBLUQ
V108Vessel Code QualifierL
R4Port or Terminal
R401Port or Terminal Function CodeD
R402Location QualifierUN
R403Location IdentifierUSLAX
R404Port NameLOS ANGELES
R405Country CodeUS
R406Terminal NameSOUTH BAY CONTAINER TERMINAL
N1Party Identification
N101Entity CodeMC
N102NameHARBORLINE DRAYAGE INC
N103ID Qualifier2
N104ID CodeHLDY
N9Reference Identification
N901Reference Identification QualifierBM
N902Reference IdentificationBLUQSHA2611045
N9Reference Identification
N901Reference Identification QualifierBN
N902Reference IdentificationBK7730412
1 functional group2 transactionsControl #000003221Valid

322 Structure at a Glance

The table follows X12 release 004010. Most of the 322 sits inside the N7 loop, so one transaction can report the same event for many pieces of equipment.

AreaSegmentNameUsage in the standardNotes
HeadingSTTransaction Set HeaderMandatoryST01 = 322
HeadingZC1Beginning Segment for Data Correction or ChangeOptionalUsed when correcting an earlier event
HeadingQ5Status DetailsMandatoryThe event, date, time and place
Detail loopN7Equipment DetailsMandatory, up to 1000One loop per container, trailer or chassis
N7 loopV4Cargo Location ReferenceOptionalWhere the cargo is
N7 loopDTMDate/Time ReferenceOptional, up to 2Dates for the equipment
N7 loopM7Seal NumbersOptional, up to 5Seals
N7 loopW09Equipment and TemperatureOptionalReefer settings
N7 loopW2Equipment IdentificationOptionalEquipment and its load or empty status
N7 loopNACross-Reference EquipmentOptional, up to 30Railcar, chassis or other linked equipment
N7 loopV1Vessel IdentificationOptionalVessel and voyage
N7 loopR4 / DTMPort or Terminal, Date/TimeMandatory, up to 20Terminal or ramp locations
N7 loopN1 / N3 / N4Name and addressOptional, up to 10Parties such as the trucker or consignee
N7 loopN9Reference IdentificationOptional, up to 10B/L, booking, waybill, pick-up numbers
N7 loopL0 / L5 / H1Cargo linesOptionalQuantity, description, hazardous material
SummarySETransaction Set TrailerMandatorySegment count and control number

Key Segments Explained

Q5: Status Details

Q5*UV*20261120*1142*LT~
ElementNameExampleWhat it means
Q501Shipment Status CodeUVThe event (see the status code table)
Q502Date20261120Date of the event
Q503Time1142Time of the event
Q504Time CodeLTLT local time. Q503 and Q504 travel together
Q505Status Reason CodeWhy, when a reason is given
Q506 / Q507 / Q508City, State or Province, CountryWhere, in words, when sent
Q509 / Q510Equipment Initial, Equipment NumberEquipment, when the partner puts it here as well as in N7

The CN customer guide notes that its default is universal time and local time is an option. Always read Q504 before you compare a terminal event with a vessel schedule or a truck appointment.

N7: Equipment Details

N7*QXZU*412873*9210*G*******CN*BLUQ*****K*2****45G1~
ElementNameExampleWhat it means
N701Equipment InitialQXZUOwner prefix
N702Equipment Number412873Serial number
N703 / N704Weight, Weight Qualifier9210 / GWeight and its type
N705Tare WeightTare, when sent
N711Equipment Description CodeCNCN container
N712Standard Carrier Alpha CodeBLUQThe equipment owner's SCAC
N717Weight Unit CodeKKilograms
N718Equipment Number Check Digit2ISO 6346 check digit
N722Equipment Type45G140-foot high cube general-purpose

The N7 opens the loop that carries everything else about the equipment. If a 322 reports a vessel discharge for 300 containers, it carries 300 N7 loops under a single Q5.

V1: Vessel Identification

V1*9700017*MERIDIAN HARBOR*LR*118E*BLUQ***L~

V101 is the vessel code (here a Lloyd's or IMO number, qualified by V108 = L), V102 the name, V103 the flag, V104 the voyage and V105 the carrier. Vessel and voyage let the receiver group all the containers from one discharge.

R4: Terminal or Ramp

R4*D*UN*USLAX*LOS ANGELES*US*SOUTH BAY CONTAINER TERMINAL~
ElementNameExampleWhat it means
R401Port or Terminal Function CodeDThe role of the location
R402Location QualifierUNUN UN/LOCODE; rail guides often use SPLC codes instead
R403Location IdentifierUSLAXLocation code
R404Port NameLOS ANGELESName
R405Country CodeUSCountry
R406Terminal NameSOUTH BAY CONTAINER TERMINALTerminal

Function codes and location schemes vary more on the 322 than on the 315. Marine terminals often report against the port of discharge or loading. The CN port operator guide uses 6 origin rail terminal and 7 destination rail terminal with Canadian and US SPLC codes. Map what each partner sends rather than assuming one scheme.

N1 and N9: Parties and References

N1*MC*HARBORLINE DRAYAGE INC*2*HLDY~
N9*BM*BLUQSHA2611045~
N9*BN*BK7730412~

N101 = MC names a motor carrier, here the drayage company that pulled the container on the out-gate, with its SCAC in N104 (qualifier 2 in N103). The N9 references tie the event to the shipment: BM bill of lading, BN booking, and on rail moves WY waybill number and P8 pick-up number, as the CN guides show. The bill of lading number is the key you will use to join 322 events to the 310 and the 315 feed.

EDI 322 vs 315, 214 and 313

DocumentModeSent byPurpose
322 Terminal Operations and Intermodal Ramp ActivityTerminal and railTerminal operator, port operator or railroadEquipment events at terminals and ramps
315 Status Details (Ocean)OceanOcean carrierContainer events to customers, coded in B4
214 Shipment Status MessageTruck and other modesCarrierShipment events, coded in AT7
313 Shipment Status Inquiry (Ocean)OceanShipper, consignee or forwarderAsks a carrier for status

All three status messages share the shipment status code list, so a UV or OA means the same thing whichever set it arrives in. The difference is the source and the shape. The 315 is the ocean carrier's account to its customer, one container per message in most guides. The 322 is the facility's account, often many containers per message, and focused on equipment rather than the shipment. The 214 is the truck carrier's account of the drayage leg that follows the out-gate, often tendered with a 204 and billed with a 210. Join all three on the container number and you have one timeline.

Common 322 Errors and How to Prevent Them

ErrorWhat happensPrevention
Time zone ignoredEvents appear hours early or late against vessel and truck schedulesRead Q504 and convert before storing
Only the first N7 readMost containers in a multi-equipment 322 are missedLoop over every N7 and apply the Q5 event to each
Container number formats differEvents do not match the container on fileNormalize prefix, serial and check digit, and validate the check digit
Location scheme assumedRail ramp SPLC codes read as UN/LOCODEs, or the reverseRead R402 and keep a location table per partner
Corrections applied as new eventsA wrong event stays in the history next to the right oneHandle ZC1 corrections as the partner's guide describes
Unknown codes droppedBad orders, holds and free time events go unseenStore any unmapped Q501 code and alert on it
322 and 315 events double-countedThe same out-gate appears twiceDeduplicate on container, status code and event time

322 Implementation Checklist

Before your first live 322 feed from a terminal, port operator or railroad:

  • Get the partner's 322 implementation guide and confirm the X12 version in GS08 (004010 is common) and the SO functional group
  • Get its list of Q501 status codes and add any partner-specific ones to your mapping
  • Confirm whether times are local or universal, and how Q504 is used
  • Confirm how many N7 loops a transaction can carry and whether events for one container can arrive in different transactions
  • Agree the location scheme in R4 (UN/LOCODE, SPLC or the partner's own codes)
  • Confirm which references come in N9, and map the bill of lading and booking numbers to your shipments
  • Decide how 322 events and 315 events for the same container are merged
  • Confirm the 997 or 824 you will send back
  • Test a single event, a multi-container event, a correction and a rail ramp sequence if the move goes inland by rail

If you are mapping ocean and rail EDI for the first time, our EDI document types reference shows where these sets sit beside the 850 purchase order and the 856 ASN. The SCAC code glossary entry explains the carrier codes the 322 uses for equipment owners and truckers.

Where OrderSync Fits

A terminal event tells you where the container is. To act on it, you need to know which purchase orders are inside and who is waiting for them, and that record starts with orders that often arrive as EDI 850s, PDFs, emails and spreadsheets.

OrderSync reads inbound orders in any format, matches customers, items and units to your catalog, and outputs clean ERP data or valid X12. Paste any 322 into the free EDI inspector to see it parsed segment by segment with a plain-English summary and any structural errors explained, or book a 15-minute walkthrough to see your own orders processed.

Frequently Asked Questions

What is an EDI 322?

The EDI 322 Terminal Operations and Intermodal Ramp Activity is the X12 transaction used to report equipment events at marine terminals and intermodal rail ramps, such as unloaded from vessel, in-gate, out-gate, loaded on rail and unloaded from rail. Each message carries a Q5 status with date and time and an N7 loop for each piece of equipment.

Who sends the EDI 322?

The party that operates the facility or the move: a marine terminal operator, a port operator loading containers onto rail, or a railroad reporting ramp events. It goes to the ocean carrier, the railroad or a customer that subscribed to the feed.

What is the difference between EDI 322 and EDI 315?

The 315 is the ocean carrier's status message to its customers, with the event in the B4 segment. The 322 is the terminal's or railroad's report of equipment activity, with the event in Q5 and one N7 loop per container. Terminal 322 events often feed the carrier's 315s.

Where is the status code in a 322?

In Q501, the first element of the Q5 Status Details segment. It uses X12 element 157, the same shipment status code list as the 315 and the 214, so codes like UV, I, OA, AL and UR mean the same thing in each.

Can one 322 cover more than one container?

Yes. The Q5 event sits at the top of the transaction and the N7 loop can repeat up to 1000 times in release 004010, so one 322 can report the same event, such as a vessel discharge, for many containers.

What functional group and version does the 322 use?

The 322 travels in functional group SO, the value in GS01, shared with the 304. Many partner guides use X12 release 004010, and the version is named in GS08.

Do I need the 322 if I already get 315s?

Importers and shippers usually get what they need from the carrier's 315s. The 322 matters most to ocean carriers, railroads, terminals and companies with direct rail or terminal feeds. If you receive both, merge them on container number, status and time so events are not counted twice.

James Darby
Last updated: 11/7/2026

Related Resources