Technanosoft Insights

Detention and Demurrage Automation: Events, Rules, and Disputes

A controls-first guide to connecting container events, free-time rules, charge calculations, invoices, exceptions, disputes, and accounting outcomes.

November 5, 202611 min readAlex parker
Technanosoft Insightsdetention and demurragelogistics automationcontainer tracking
Editorial cut-paper illustration of a container crossing from a terminal stack through a gate into the equipment-return journey.
Executive Summary

A controls-first guide to connecting container events, free-time rules, charge calculations, invoices, exceptions, disputes, and accounting outcomes.

Detention and demurrage automation should connect a container's operational events, applicable free-time rule, calculated charge, invoice, evidence, owner, and dispute outcome. The objective is not simply to count days. It is to make every clock and decision explainable when carrier, terminal, TMS, and finance records disagree.

Quick answer

Start with one port, carrier group, charge type, and operating role. Define a Container Charge Control Record that stores the source event, rule version, timezone, free-time basis, pauses or exceptions, calculation, invoice line, evidence, approval, and final disposition.

Automate event collection, date normalization, rule matching, alerts, draft calculation, invoice checks, and evidence assembly. Route missing or conflicting events, uncertain tariff terms, material disputes, payments, waivers, and write-offs to named owners. Buy when a maintained specialist platform fits the network. Integrate when the main gap is broken handoffs. Build only when distinctive rules or workflows justify ongoing ownership.

Editorial cut-paper illustration of a container crossing from a terminal stack through a gate into the equipment-return journey.
Illustrative editorial scene: detention and demurrage are related clocks, but they depend on different events, locations, and rules.

Key takeaways

DecisionPractical answer
First design taskDefine trusted start, stop, pause, and correction events
Core recordBind the event history, rule version, calculation, invoice, and outcome
Best early automationEvent matching, exception routing, alerts, and draft validation
Keep human-ownedRule ambiguity, material disputes, payment, waiver, settlement, and write-off
Build thresholdDistinctive multi-party rules or workflow, not a desire for another dashboard

On this page

Who this guide is for

This guide is for shippers, importers, exporters, freight forwarders, NVOCCs, drayage operators, and logistics-finance teams that reconcile container free time, invoices, and disputes across multiple systems. It is most useful when staff are copying dates between carrier portals, spreadsheets, TMS records, terminal feeds, email, and accounting tools.

It does not provide legal advice or one universal charge formula. Detention, demurrage, storage, and related terms vary by jurisdiction, contract, tariff, carrier, terminal, equipment, and operating role. Configure the workflow from approved terms and qualified review.

What the software must control

Demurrage generally concerns time that cargo or equipment remains at a marine terminal beyond allowed free time. Detention generally concerns equipment kept outside the terminal beyond the allowed period. Those descriptions are useful orientation, not a substitute for the exact governing terms.

A reliable workflow must answer four linked questions:

  1. What happened? Which discharge, availability, pickup, gate-out, gate-in, empty-return, closure, customs, or correction event occurred, and which system reported it?
  2. Which rule applied? Which contract, tariff, free-time allowance, calendar, exception, and rate version governed that container at that time?
  3. What was charged? How did the approved rule and event timeline produce each calculated day and invoice line?
  4. What was decided? Who approved payment, opened a dispute, accepted a waiver, posted a credit, or closed the exception?

The DCSA Track & Trace standard provides a useful shared vocabulary for shipment, transport, equipment, IoT, and reefer events. Its public description includes events such as discharge, gate-in, gate-out, pickup, and drop-off. A standard vocabulary can reduce mapping work, but it cannot guarantee that every partner sends a complete, timely, or correct event. Preserve provider, received time, event time, location, source identifier, correction status, and confidence separately.

The Container Charge Control Record

The Container Charge Control Record is the original decision-support asset for this workflow. It is one durable record for one container, one relevant movement, and one charge context.

Identity and operating role

Store container, bill of lading or booking, shipment, carrier, terminal, equipment type, parties, and the organization's role. Preserve aliases without letting them create duplicate clocks.

Event timeline with provenance

Keep the raw event, normalized event type, source, event timestamp, source timezone, normalized timezone, location, received timestamp, and any correction or withdrawal. Never silently overwrite a gate event that already informed an alert or invoice review.

Rule version

Store the approved source document or stable reference, carrier or terminal, charge type, geography, effective period, free-time basis, calendar rules, rate steps, stop conditions, pauses, special terms, and approval owner. A rule extracted by AI remains a candidate until reviewed.

Calculation trace

Show the start event, free-time days, excluded or paused periods, first chargeable day, last chargeable day, daily rate step, currency, tax treatment where relevant, and total. A reviewer should be able to reproduce the result without reverse-engineering code.

Invoice and compliance facts

Capture invoice number, billing party, billed party, invoice date, charge period, container references, rate basis, dispute instructions, and each matched or unmatched line. In the US ocean-shipping context, the Federal Maritime Commission's rule summary explains requirements concerning who may be billed, invoice timing, required information, and the dispute process. The FMC said the full rule, including the invoice-content provision, took effect on May 28, 2024.

That source should become a configurable review policy, not hard-coded legal advice. Preserve the rule version and route uncertain applicability to the appropriate reviewer.

Evidence, ownership, and disposition

Link terminal and carrier events, appointment records, notices, closure evidence, customs holds, correspondence, contract terms, invoice versions, submission receipts, acknowledgments, credits, and payment records. Assign an owner and next action to each exception. Close only with a reason and evidence.

A workable automation flow

1. Ingest and normalize events

Receive events from carrier APIs, terminal feeds, visibility providers, TMS records, EDI messages, approved portal exports, or controlled manual entry. Map source-specific names to the internal vocabulary without discarding the raw payload.

The hardest case is not “no event.” It is two plausible events with different timestamps. The workflow should surface the conflict, show both sources, and let an authorized owner select or correct the controlling fact with a recorded reason.

Illustrative container chassis crossing a terminal gate loop beneath identification and camera equipment at blue hour.
Illustrative editorial scene, not a Technanosoft client or actual terminal: a useful event is more than a timestamp—it needs identity, location, source, and correction history.

2. Match the approved rule

Use carrier, terminal, port pair, equipment, movement, customer agreement, effective date, and role to select a candidate rule. Treat missing contract references, expired rates, overlapping terms, and unclear calendars as exceptions. Do not let an AI summary become the only stored form of the rule.

3. Calculate with an audit trace

Run deterministic date and rate logic after the event and rule are resolved. Record every input and excluded period. Recalculate when an upstream event is corrected, but preserve the previous result and identify which alerts or decisions it affected.

4. Act before and after the clock expires

Alerts should name the container, charge type, controlling deadline, source event, responsible owner, and next operational action. Avoid generic red badges. An alert is useful only when the team can move cargo, return equipment, resolve an appointment or document issue, or record why action is blocked.

5. Validate the invoice

Match invoice identity, dates, billed party, charge type, event period, rate, quantity of days, free-time treatment, and total against the control record. Classify results as matched, data missing, rule uncertain, event conflict, duplicate, wrong party, timing review, amount mismatch, or other owned exception.

6. Prepare and track the dispute

Assemble only approved evidence. Bind the filed packet to a saved version, channel, destination, authorized submitter, and receipt. If a portal or API times out, mark the action uncertain and reconcile before resubmitting. A second click can create a duplicate case or conflicting record.

The FMC says billed parties covered by its rule have at least 30 calendar days to submit fee mitigation, refund, or waiver requests, and it describes resolution timing as well. Configure those clocks from current approved guidance for the applicable relationship. Do not apply the US rule indiscriminately to other contexts.

7. Reconcile the outcome

Keep dispute acknowledgment, information requests, waiver, denial, credit, refund, payment, settlement, and write-off as distinct states. “Carrier responded” and “invoice closed” do not prove that the accounting result is correct.

Design the exception queue before the dashboard

Conceptual illuminated film strip showing container discharge, gate movement, a torn missing event, and empty return beside a calendar stencil.
Illustrative metaphor: when one controlling event or rule is missing, the system should create an owned exception rather than a confident charge.

A dashboard can summarize work only after the states are trustworthy. Start with queues that support action:

ExceptionRequired response
Event missingRequest or enter an approved source; do not infer silently
Event conflictCompare provenance and record the controlling decision
Rule missing or overlappingRoute to contract or tariff owner
Calendar ambiguityResolve timezone, holiday, closure, or pause treatment
Invoice identity mismatchConfirm container, bill, party, and charge type
Duplicate invoice or disputeFreeze action and reconcile external state
Post-approval changeInvalidate the approval and return to review
Credit without accounting matchRoute to finance reconciliation

AI can classify documents, extract candidate terms, summarize correspondence, and propose exception reasons. Rules should own date arithmetic, required fields, allowed state transitions, permissions, and duplicate controls. Humans should own ambiguous terms and consequential financial decisions.

Buy, integrate, or build?

Buy specialist software when

  • maintained carrier, terminal, tariff, and visibility coverage matters more than a distinctive internal workflow;
  • the product supports the organization's role, geography, contracts, evidence, and accounting needs;
  • event provenance, rule history, exports, and audit trails are adequate; and
  • the team can adopt the product's operating model.

Integrate existing systems when

  • the visibility platform, TMS, document store, and ERP are individually trusted;
  • staff lose time moving events, invoices, and dispute updates between them;
  • a coordination layer can own exceptions and approvals; and
  • replacing the systems of record would add more risk than value.

Build a focused workflow when

  • customer-specific agreements or multi-party rules are genuinely distinctive;
  • the organization needs controlled collaboration across shipper, forwarder, drayage, finance, and customer teams;
  • existing products cannot preserve the required rule, event, approval, or accounting boundary; or
  • D&D is one part of a broader proprietary container-operations platform.

Do not build simply to reproduce a countdown dashboard. Maintaining event connectors, rule changes, security, permissions, and recovery behavior is ongoing product work.

Pilot and failure tests

Pilot one charge type across a bounded carrier, terminal, and operating role. Use approved redacted or synthetic records during early testing.

Baseline event completeness, conflicting timestamps, manual rule lookups, containers without owners, alerts without action, invoice exceptions, dispute preparation time, uncertain submissions, and credits waiting for accounting reconciliation. Do not invent a savings target before measuring the current process.

Test the difficult paths: corrected gate-out event, late-arriving empty return, terminal closure, overlapping contract and public tariff, daylight-saving boundary, missing timezone, duplicate container identifier, revised invoice, changed rule after approval, portal timeout, dispute acknowledgment without a reference, partial waiver, and credit posted to the wrong invoice.

How Technanosoft approaches the workflow

Technanosoft's custom software development service covers workflow systems, internal dashboards, portals, document extraction, routing, approvals, and API-based integrations. The verified service page does not establish a detention-and-demurrage client result, so this article makes no such claim.

For this problem, a sensible discovery starts with the current event sources, rule library, invoice flow, disputes, approvals, accounting handoff, and failure history. The first release might be an exception and audit layer around existing systems rather than a replacement visibility platform.

The useful question is not “Can AI calculate these charges?” It is “Can the team prove which event and rule controlled the calculation, recover safely when data changes, and reconcile the outcome?”

Frequently asked questions

What is the smallest useful first release?

A Container Charge Control Record, two or three trusted event connectors, versioned rule storage, deterministic calculation, an owned exception queue, invoice matching, evidence assembly, and accounting disposition for one bounded workflow.

Should AI read detention and demurrage tariffs?

It can extract candidate terms and highlight differences. A named reviewer should approve the structured rule and effective period before it drives alerts, invoices, disputes, or financial decisions.

How should the system handle missing terminal events?

Show the gap and request an approved alternate source. If manual entry is allowed, record the person, evidence, time, and reason. Do not fabricate a timestamp or treat an estimate as observed fact.

Can the workflow submit disputes automatically?

Only after authority, destination, evidence, and payload controls are defined. Preserve the exact submitted packet and receipt. An uncertain external result should be reconciled before any replay.

What should buyers test in a product demonstration?

Bring real redacted examples: conflicting events, a custom free-time rule, a corrected invoice, a closure, a portal timeout, and a credit. Ask the vendor to show provenance, rule versions, exception ownership, approvals, exports, and recovery—not only the happy-path dashboard.

Does FMC's rule apply to every detention or demurrage charge?

No universal statement is safe. The cited FMC material concerns US ocean-shipping billing practices within its scope. Confirm the current rule, contract, jurisdiction, parties, and facts with qualified reviewers.

The decision in one minute

Choose detention and demurrage automation when the same container has different dates in different systems, free-time terms are hard to reproduce, invoices require manual reconstruction, alerts lack owners, or disputes and credits disappear between operations and finance.

Start with one bounded lane and one control record. Make event provenance, rule versioning, deterministic calculation, exception ownership, safe external actions, and accounting reconciliation non-negotiable.

Buy when maintained specialist coverage fits. Integrate when reliable systems are disconnected. Build only when the workflow or control boundary is genuinely distinctive. The goal is not a prettier countdown. It is an explainable, recoverable decision from event to financial outcome.

Connect Reading To Delivery

Turn this idea into a working system

Explore the service pages connected to this topic, or book a consultation to map the software, AI, dashboard, or automation workflow your team needs.