For logistics and finance teams, detention and demurrage fees (often grouped as D&D) are more than annoying add-ons. They are revenue leaks that show up late, hit margins, and start blame games between transportation ops and accounts payable.
According to the U.S. Federal Maritime Commission's D&D reporting and enforcement work, between 2020 and 2025, nine major ocean carriers collected $15.4 billion in detention and demurrage charges, often tied to congestion and process breakdowns, not true "shipper behavior" issues.
This guide clears up the core definitions, then gets practical: what to track, what to audit, how the 2024 FMC Final Rule changes the clock on invoicing and disputes, and how automation turns D&D from "surprise invoices" into operational data you can act on.
Detention vs Demurrage: The Fundamental Differences for Shippers

Detention vs demurrage is easy to mix up because both are time-based fees. The clean way to separate them is to ask two questions:
- Where is the equipment right now (inside the terminal or outside it)?
- Is the cargo still in the container?
At a high level:
- Demurrage: Applies to loaded containers inside the terminal/port that stay beyond free time. It functions like a storage fee meant to keep cargo moving and reduce congestion.
- Detention (Ocean/Rail): Often called per diem. Applies when the container is outside the terminal and is not returned within the free period.
- Detention (Trucking): A separate concept. Charged by a motor carrier when a driver is delayed at a shipper/receiver beyond a grace period (commonly two hours).
Quick comparison table
| Charge type | Where it happens | What the carrier is protecting | Common trigger | What you must prove to dispute |
|---|---|---|---|---|
| Demurrage (ocean) | Inside terminal/port | Terminal space and container flow | Container not picked up by Last Free Day | Container availability, terminal closures/no-work, holds, appointment availability |
| Detention / per diem (ocean or rail) | Outside terminal | Container/equipment utilization | Empty not returned by due date | Delivery/empty return timestamps, return location rules, equipment condition/acceptance |
| Trucking detention | At shipper/receiver dock | Driver productivity and equipment time | Detained past grace period | Arrival/check-in time, dock assignment, departure time, appointment adherence |
If your GL coding treats all of these as one bucket, you lose the ability to fix the root cause. Demurrage is usually a port and pickup problem. Per diem is a return and empties problem. Trucking detention is a dock and dwell-time problem.
Trucking Detention: The High Cost of Driver Wait Time
Trucking detention is one of the fastest ways to burn relationships with carriers. It also makes your freight harder to cover, because drivers remember the facilities that waste their day.
ATRI's 2024 research on detention quantified how big this is. In 2023, drivers reported detention (over two hours) at 39.3% of stops, with major financial and productivity impacts across the industry.
What trucking detention usually looks like in the real world:
- The clock: Detention often starts after a two-hour grace period, but it depends on your contract or the carrier's rules.
- Rates: Typical ranges land around $50 to $100 per hour in many lanes, and can rise for specialized freight or tight markets.
- Hidden damage: Detention is not just the fee. It steals capacity. When your loads become slow-turn freight, carriers price that risk into the rate, or they stop accepting tenders.
Nuances worth tracking, because they affect invoice accuracy:
- Driver assist vs. wait time: If your facility expects drivers to help unload, that is not the same as detention. It should be coded and billed differently.
- Lumper fees: These are separate service charges, but they often appear on the same paperwork trail as detention.
- Appointment compliance: If the carrier misses the appointment, your detention exposure changes. You need both the scheduled time and actual geofence times to tell the story.
If you are still relying on handwritten timestamps, you are building disputes on weak evidence. A practical upgrade is capturing arrival and departure via geofences tied to your TMS workflow. When appointment scheduling, check-in, and dwell-time reporting live in one place, the conversation shifts from opinion to proof. A good starting point is tightening appointment discipline and event capture inside your transportation stack, then reporting the worst dwell locations using TMS data.
Prevention strategy you can run this month
- Baseline dwell by facility: Identify your top 10 locations by average dwell and by total detained hours so you can focus on the biggest wins.
- Separate delay types: Tag the reason codes (no dock door, no labor, late paperwork, product not staged, missed appointment) so you fix the actual constraint.
- Fix repeat offenders: If one DC creates most of your detention cost, treat it as an operations constraint and adjust scheduling, staging, or labor planning.
Ocean Demurrage: Navigating Port Congestion Fees
Demurrage happens inside the port gates. It is charged on loaded containers that remain in the terminal beyond free time. Sometimes it is on you (slow pickup). Sometimes it is the system (holds, congestion, appointment scarcity, chassis shortages).
Either way, the only way to manage demurrage is to run your week around one metric:
- Last Free Day (LFD): This is the deadline. Once you miss it, demurrage often escalates on a daily scale.
The 2024 regulatory shift you cannot ignore
The FMC's 2024 Final Rule tightened billing practices and timelines. The operational reality is simple: you have less time to react, so you need cleaner processes.
Two rules matter most for shippers:
- Invoice timing pressure: VOCCs and MTOs must issue invoices within 30 calendar days from the date the charge was last incurred (with specific timing provisions for NVOCC pass-through invoicing). If the invoice is late under the rule, your obligation to pay can be impacted.
- Dispute window discipline: Billed parties must be given at least 30 calendar days to request mitigation, refund, or waiver. That sounds generous until you realize how long it takes to gather gate moves, availability screens, emails, and PODs when everything is scattered.
This is where automation stops being optional. If you want to meet the clock without hiring more people, you need a system that can pull evidence fast.
Audit tip: demurrage is not always valid, even when it is invoiced
A basic demurrage audit should always cross-check these items:
- Gate-in and gate-out reality: Validate carrier dates against terminal data and your drayage provider's events.
- Container availability: If the container was not physically available for pickup, demurrage may not be reasonable or compliant with FMC guidance.
- No-work days and closures: If the terminal could not perform due to closure, labor issues, or appointment unavailability, document it and attach it to the dispute.
If your team can pull this evidence in minutes, you dispute more charges, and you win more often. If it takes three days to assemble, the dispute window closes, and you pay.
Container Detention (Per Diem): Managing Equipment Returns
If demurrage is about terminal space, detention (per diem) is about equipment velocity. Carriers want their containers back so they can generate revenue again.
Per diem piles up when your operation treats containers as floating storage, or when empty return is blocked by rules, appointments, or lack of space.
Common root causes:
- The workflow gap: The box gets delivered, product is stripped, and the empty return becomes tomorrow's problem. Tomorrow turns into next week.
- Warehouse congestion: When the yard is full, empties get trapped, and returns slide behind higher-priority work.
- Return-location confusion: Depots change, return rules change, and a driver shows up with an empty that cannot be accepted.
Two controls make a real difference:
- Exception alerts: Use milestones like EDI 214 events (or drayage status updates) to trigger alerts. If a container is not marked "Empty Returned" within 24 to 48 hours after delivery, somebody should get a task, not just a passive report.
- Internal chargebacks: Map per diem to the facility that caused it. When one DC or plant absorbs its own D&D spend, behavior changes fast.
This is also where many teams realize they do not have a clean, shared system of record between logistics and finance. If operations tracks container status in one tool and finance sees invoices in another, nobody owns the full lifecycle.
The Finance Gap: Audit Rules and Cost Allocation
Detention vs demurrage becomes expensive when logistics and finance live in different timelines.
Logistics sees delays in real time but may not document them cleanly. Finance sees the invoice weeks later, when proof is buried in email threads. Manual audits become slow, inconsistent, and easy to lose.
The fix is building rules into your workflow so exceptions get caught early and coded correctly. Well-implemented accounting automation reduces repetitive data entry, but the real win is audit accuracy and faster disputes. Pair that with invoice automation and you stop treating accessorials like an afterthought.
Audit rules that hold up under scrutiny:
- Flag missing proof for trucking detention: Require a signed POD or verified arrival/departure timestamps. If the invoice does not contain time-in/time-out evidence, it should not glide through.
- Auto-reject duplicate billing: Detect duplicates where a carrier and a 3PL both bill for the same event. This is common when accessorials get re-invoiced downstream.
- Validate demurrage against availability: If your logs show the terminal did not release the container, the charge should be disputed, not paid.
- Enforce correct-party billing: If invoices are sent to the wrong entity, route and document the correction fast so the dispute clock does not expire.
Cost allocation is the second half of the story. If D&D lives in a generic transportation GL code, nobody feels it. Automate allocation by:
- Customer: Tie fees back to the customer shipment or contract so pricing and service policies reflect real handling cost.
- Project or job: For project-based work, assign D&D to the job so margin stays honest and post-mortems have real numbers.
- Distribution center: Attribute charges to the specific DC or plant so operational leaders see the spend they created.
- Lane: Track repeat lanes that routinely miss appointments or run into port constraints so routing decisions improve.
- SKU family (when relevant): When product characteristics drive dwell (temperature checks, slow unload, special handling), allocate accordingly to expose true COGS drivers.
That is how expense management reflects true COGS, and how you stop subsidizing the slowest nodes in your network.
Automating the D&D Lifecycle with Quantum Byte
Most companies do not have a detention and demurrage system. They have fragments: a TMS, an inbox, a spreadsheet, and someone who knows how to argue with carriers.
Quantum Byte helps you turn those fragments into a closed-loop workflow. The goal is simple: capture events at the source, compute free time correctly, validate invoices automatically, and generate disputes with evidence on demand.
With Quantum Byte, You are not buying another rigid platform, you are building a workflow that fits your operation. And you can get it live in days, not months, by using Quantum Byte's AI-powered app builder backed by an in-house engineering team that can take edge cases across the finish line.
The automated D&D workflow (what "closed loop" looks like)
- Event capture: Geofences and EDI 214 milestones record when a truck arrives, when it departs, when a container is available, and when it is returned.
- Free time clock: The system calculates LFD and per diem deadlines by carrier, port, and contract terms.
- Predicted risk: If a container is 24 hours from expiring, dispatch and the warehouse get a clear alert with the container number and the next best action.
- Invoice validation: When a D&D invoice arrives (often via EDI 210 or email/PDF), AI matches billed dates and amounts against your captured timestamps and contract logic.
- Dispute packet: If a discrepancy appears, the system assembles evidence (POD, geofence logs, gate moves, terminal availability screens, key emails) into a ready-to-send packet.
- Posting and chargeback: Valid charges flow to the GL with correct coding, and internal chargebacks route to the responsible facility or customer.
If your team spends hours assembling proof every week, start by standardizing what proof even means, then make it one click to compile.
For teams that want a simple way to structure evidence and route approvals, you can get started building today
And if you are ready to connect the dots between transportation events and finance outcomes, check out our transportation spend automation guide.
Eliminating Revenue Leaks
Detention vs demurrage is an operating system test. When definitions map to workflows, costs fall.
This guide covered:
- Core definitions that drive accountability: How to separate demurrage (in-terminal storage of loaded containers) from detention/per diem (equipment outside the terminal) and trucking detention (dock delay).
- The metric that runs your port week: Why Last Free Day should drive pickup planning, escalation paths, and daily execution.
- What the 2024 FMC Final Rule changes: Why tighter invoice timing and dispute windows raise the cost of slow internal processes.
- Audit rules and cost allocation that make spend visible: How to stop D&D from becoming miscellaneous spend and start attributing it to the real root cause.
- How automation turns events into action: How real timestamps plus contract logic enable invoice validation and fast, evidence-backed disputes.
When you capture the right timestamps and tie them to your contracts, D&D stops being a surprise bill. It becomes an operational signal you can manage.
Frequently Asked Questions
What is the primary difference between demurrage and detention?
Demurrage is a storage fee for loaded containers inside the port/terminal after free time. Detention is a fee for keeping equipment (containers or chassis) outside the terminal past the return deadline. Trucking detention is separate and relates to driver wait time at docks.
How much is typical trucking detention per hour?
Many contracts land in the $50 to $100 per hour range after a standard grace period (often two hours). Rates vary by lane, market, and freight type.
Can I dispute demurrage charges if the port was congested?
Yes. If the container was not actually available for pickup due to terminal conditions, holds, closures, or appointment constraints, you may have grounds to dispute. Your success depends on documentation and acting within the dispute window.
Who is responsible for paying detention fees?
Responsibility depends on contract language and Incoterms, plus who controlled the delay. In practice, shippers, consignees, and beneficial cargo owners often pay, unless the carrier's actions or terminal conditions make the charge unreasonable or non-compliant.
How does automation help avoid detention and demurrage?
Automation captures timestamps via geofencing and EDI, calculates free time and LFD automatically, alerts teams before fees start, validates invoices against your own event data, and generates dispute packets with supporting evidence so you do not miss the legal and contractual windows.
