Intermodal Drayage & EDI Systems

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:

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:

Figure 1: High-Level Reconciliation Pipeline Architecture
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

  1. Time Delta Rule: abs(driverTimestamp - terminalTimestamp) > 15 minutes = 45 points
  2. Geospatial Proximity Rule: Haversine distance between driver GPS and terminal gate coordinates > 0.3 miles = 30 points
  3. Equipment Status Rule: Damage or condition mismatch = 60 points
  4. 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

  1. Driver mobile application (Exspeedite or third-party) captures interchange at gate with GPS, timestamp, photos, and notes.
  2. Interchange record is published to Kafka topic interchange-capture.
  3. EDI 322 messages are received via AS2, SFTP, or terminal REST API and normalized into the same canonical model.
  4. Reconciliation engine joins records on container number, move direction, and temporal window (±4 hours).
  5. Scoring service evaluates discrepancies and writes immutable audit record.
  6. 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.
  7. Dispute is submitted via terminal portal API or EDI 240/241 where supported.
  8. 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:

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:

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.

Schedule Architecture Consultation