Intermodal Terminal Gate EDI 322 Interchange Reconciliation: Drayage Systems Architecture
A comprehensive technical practice and implementation guide for automating terminal gate transaction reconciliation, container interchange validation, and automated demurrage/dispute defense.
Intermodal drayage carriers lose millions annually to erroneous gate transactions and misreported marine container status. Strong Tower Consulting designs automated EDI 322 message reconciliation pipelines that compare driver mobile app interchange receipts against terminal operating system (TOS) EDI events, resolving gate timestamp discrepancies and automating demurrage dispute filings.
Since 2008, Strong Tower Consulting, LLC has delivered mission-critical systems architecture to the most demanding motor carriers and intermodal operators in North America. This guide details the exact technical patterns, data models, integration workflows, and exception handling logic required to eliminate revenue leakage at the terminal gate.
The Business and Technical Problem
Marine terminal gate transactions generate high-velocity EDI 322 messages that frequently diverge from the driver's on-site interchange documentation in four critical dimensions:
- Timestamp variance (gate camera vs. driver mobile app GPS timestamp)
- Equipment status and damage notation mismatches
- Chassis interchange identification errors
- Missing or duplicated transaction events
These discrepancies directly trigger incorrect demurrage, detention, and storage invoices. Manual reconciliation is cost-prohibitive at scale. The solution is an automated reconciliation engine that ingests, normalizes, scores, and acts on every terminal event in near real time.
Architectural Overview: The EDI 322 Reconciliation Solver
The Strong Tower Consulting solution is a cloud-native, event-driven microservices platform built on the following stack:
- Event ingestion layer (Kafka + REST/EDI-INT)
- Normalization and canonical model service
- Rule-based discrepancy scoring engine
- Persistent audit ledger (immutable PostgreSQL + JSONB)
- Automated dispute generation and API submission
- Real-time visibility dashboard and exception workbench
graph TD
A[Driver Mobile App
Interchange Receipt] -->|JSON Payload| B(Kafka Topic: interchange-capture)
C[Terminal EDI 322] -->|X12 over AS2 or API| D(EDI Ingestion Service)
D --> E[Normalization Service]
B --> E
E --> F[Canonical Event Store]
F --> G[Reconciliation Engine]
G --> H{Discrepancy Score > Threshold?}
H -->|Yes| I[Exception Queue + Alert]
H -->|No| J[Mark Reconciled]
I --> K[Automated Dispute Builder]
K --> L[Carrier TMS / Demurrage Portal API]
G --> M[Immutable Audit Ledger]
M --> N[Analytics & BI]
EDI 322 Message Structure and Critical Segments
The 322 Transaction Set contains several segments that must be mapped to the driver's interchange record. The table below shows the primary elements used in reconciliation logic.
| Segment | Element | Description | Reconciliation Use |
|---|---|---|---|
| ST | ST01 | Transaction Set Identifier | Validate 322 identifier |
| B1 | B101 | Booking Number | Match to load identifier |
| N7 | N701 | Equipment Initial | Container number match |
| N7 | N702 | Equipment Number | Full container identifier |
| DTM | DTM01 | Date/Time Qualifier (194 = Gate In, 195 = Gate Out) | Primary timestamp source |
| DTM | DTM02 | Date | Event date |
| DTM | DTM03 | Time | Event time (critical for free-time calculations) |
| VC | VC01 | Equipment Status Code | Damage or condition flags |
| MEA | MEA03 | Measurement Value (gross weight) | Weight discrepancy detection |
Canonical Reconciliation Data Model
Strong Tower Consulting normalizes both the driver interchange record and the EDI 322 into a unified JSON schema before scoring. Key fields include:
{
"transactionId": "string",
"containerNumber": "string",
"chassisNumber": "string",
"moveType": "IN|OUT",
"driverCaptured": {
"timestamp": "ISO-8601",
"gpsLat": "number",
"gpsLon": "number",
"odometer": "number",
"damageNoted": "boolean",
"damageDescription": "string",
"sealNumber": "string"
},
"terminalEvent": {
"edi322ControlNumber": "string",
"timestamp": "ISO-8601",
"eventType": "GATE_IN|GATE_OUT",
"statusCode": "string",
"weight": "number",
"sealNumber": "string",
"rawEdiPayload": "object"
},
"discrepancyVector": {
"timeDeltaMinutes": "number",
"locationMatchScore": "number",
"statusMatch": "boolean",
"weightDelta": "number",
"compositeScore": "number"
},
"resolutionStatus": "RECONCILED|DISCREPANCY|DISPUTE_FILED|MANUAL_REVIEW",
"auditTimestamp": "ISO-8601"
}
Reconciliation Scoring Algorithm
The core engine applies weighted rules to produce a composite discrepancy score. Thresholds are configurable per terminal and customer agreement.
Primary Scoring Dimensions
- Time Delta Rule: abs(driverTimestamp - terminalTimestamp) > 15 minutes = 45 points
- Geospatial Proximity Rule: Haversine distance between driver GPS and terminal gate coordinates > 0.3 miles = 30 points
- Equipment Status Rule: Damage or condition mismatch = 60 points
- Seal & Weight Rule: Seal number or gross weight variance beyond tolerance = 25 points
Composite score > 50 triggers automated exception workflow and dispute package generation.
End-to-End Implementation Workflow
- Driver mobile application (Exspeedite or third-party) captures interchange at gate with GPS, timestamp, photos, and notes.
- Interchange record is published to Kafka topic
interchange-capture. - EDI 322 messages are received via AS2, SFTP, or terminal REST API and normalized into the same canonical model.
- Reconciliation engine joins records on container number, move direction, and temporal window (±4 hours).
- Scoring service evaluates discrepancies and writes immutable audit record.
- If dispute threshold is met, the system auto-generates a formal dispute package including driver evidence, EDI 322 payload, GPS map, and carrier-specific letter.
- Dispute is submitted via terminal portal API or EDI 240/241 where supported.
- All activity is surfaced in the carrier's operational dashboard with drill-down to raw payloads.
Key Integration Points and APIs
Strong Tower Consulting delivers pre-built connectors for:
- Exspeedite Dispatch & Mobile (sister company under common ownership)
- Major marine terminal APIs (APM, Hutchison, SSA, Fenix, TraPac, etc.)
- Ocean carrier demurrage portals (Maersk, MSC, COSCO, ONE, Evergreen)
- TMS platforms including McLeod, TMW, Descartes, and custom systems
- EDI VANs and direct AS2 mailboxes
Internal link to additional technical depth: EDI Integration and Telematics Mapping Services.
Typical Outcomes Achieved
Carriers implementing the Strong Tower Consulting EDI 322 Reconciliation Solver routinely achieve:
- 92-97% automated reconciliation rate within 30 minutes of gate event
- Reduction in erroneous demurrage and detention spend of 68-84%
- Complete audit-ready ledger for every container interchange
- Elimination of manual spreadsheet reconciliation teams
- Actionable intelligence on terminal performance and billing accuracy
Enterprise Systems Advisory
Ready to modernize your transportation management software, eliminate manual spreadsheets, or optimize telematics and recruiting workflows? Contact Strong Tower Consulting for direct architect guidance.