Skip to content
Skip article header Engineering

Truck Detention: From Gate Events to Billing Adjustments

Trace truck detention from geofence and gate records to a billable charge. See how a late timestamp correction changes an invoice without billing twice.

7 min read 44 views

A truck enters a facility geofence at 08:52 for a 09:00 appointment. The gate log records check-in at 09:12. Hours later, the facility corrects check-in to 08:58. By then, billing has already sent the first detention charge.

A transportation management system (TMS) should reproduce what billing knew when it issued that charge, calculate what the correction changes and send only the approved adjustment. Dispatch can still use the live timer to manage the driver's next stop. Each decision needs a record with its own timestamp and purpose.

Which clock starts truck detention?

In trucking, detention refers to waiting associated with loading or unloading at a facility. Dwell measures time spent at the stop. The billable portion depends on the terms for the load, including which event starts the clock and how much free time applies. Driver detention pay can follow a separate agreement from the carrier's invoice. The FMCSA detention research brief provides the operational context, and the ATRI study on truck driver detention addresses its consequences for carriers and drivers.

A GPS ping can establish where a device was when it reported. A gate record can document when the facility checked the truck in. A signed delivery document may record when the truck was released. Where those records differ, compare definitions before comparing minutes. A truck can leave the dock and wait for paperwork, then cross the geofence later.

The distinction also appears in product workflows. Motive's analytics field reference describes a geofence detention timestamp. Uber Freight's detention request walkthrough shows GPS-populated times, editable timestamps and a proof-of-delivery upload in its own request flow. Use those examples to identify evidence types. The agreement for a given stop determines which evidence and deadlines apply.

A late correction changes a $100 charge to $120

This example uses invented terms and timestamps for one stop. The agreement starts the clock at the later of the appointment and the accepted gate check-in. Free time is 120 minutes. After free time, billing rounds down to completed 15-minute units at $80 per hour. The stop meets the assumed notice and eligibility requirements. Departure is 12:38 in both revisions.

Input or result Original approved calculation After the facility correction
Appointment 09:00 09:00
Accepted gate check-in 09:12 08:58
Contract clock starts 09:12 09:00
Time remaining after free time 86 min 98 min
Billable time after rounding 75 min 90 min
Total charge under the same terms $100 $120

At $20 per completed unit, the first calculation bills five units and the second bills six. The difference is $20. The first invoice line remains part of the record. If the correction is approved after posting, send an adjustment linked to that line, using the accounting system's supported correction flow. If the first line was still a draft, replace the draft calculation before posting.

The correction moved the recorded check-in back by 14 minutes. The contractual clock moved by 12 minutes because the appointment limited how early it could start. Rounding changed the billable total by one unit.

The GPS event at 08:52 remains in the evidence packet in both revisions.

What to keep with each stop

Join observations to a stop visit, not just a load or truck. The same vehicle can visit a facility more than once, and a shipment can have detention at pickup and delivery. Keep the original source identifier, occurrence time, receipt time and source time zone. Record the local appointment and facility time zone so an overnight visit or daylight saving change can be reconstructed. The carrier integration layer can normalize incoming events while preserving their original meaning.

Store observed and accepted timestamps separately. Attach the gate log, bill of lading, proof of delivery or driver confirmation to the stop visit. A supervisor who resolves a conflict should record the selected event, its evidence and why it takes precedence under the terms for that load. Keep a correction as a new observation that points back to the previous one.

Pin each calculation to the accepted appointment and evidence revisions and the agreed terms. Those terms may include the clock trigger, free minutes, increments, cap, notice requirements and filing rules. Keep the inputs alongside the calculated amount. An updated rate card should apply only when the agreement says it applies, including when a posted case is reopened after a new rate card took effect.

When to route a case to review

Situation System behavior
GPS crosses the fence before the guard logs check-in Retain both. Apply the clock trigger in the load terms and flag any event conflict that could change eligibility.
A departure is missing after telemetry drops Keep observed duration provisional and request an accepted checkout record.
The same truck re-enters the site Resolve the observation against the correct stop visit before calculating a second charge.
An appointment changes during the visit Keep the prior appointment, amended appointment and approval record. Evaluate any material change under the applicable terms.
The rate or notice rule is missing Assign a billing exception and show the missing field. Let operations keep tracking dwell.
A corrected calculation arrives after posting Preserve the posted revision and route the difference for approval as an adjustment.

A dispatch alert can run from an estimated arrival while a case is still in progress. That gives dispatch time to act before a notice deadline or a missed pickup.

Billing should see whether the notice was sent, when it was sent and what delivery or acknowledgment the communication system actually reports. Preserve the distinction between a reminder to notify the broker and a notice sent to the broker.

The driver location tracking guide covers the mechanics of capturing and moving location data. For detention, also retain the geofence definition or version behind an inferred arrival. A larger polygon introduced next week should have no effect on an invoice from this week.

Make the first invoice and any adjustment safe to retry

Keep a stable identity for the original charge and a separate identity for each approved adjustment. A key can include the stop visit, charge type, calculation revision and operation type. A retry of the same approved operation should reuse the same key. A later revision gets its own adjustment only after accounting confirms the earlier posting state.

If the accounting call times out, mark the outcome unknown and look it up by the operation reference. When lookup is unavailable, route the case to reconciliation. The system should be able to return the earlier acknowledgment when one exists. In the example, replaying the adjustment job twice should leave one $100 original line and one $20 adjustment.

Track unpriced stops, time to resolve evidence conflicts and the gap between approved charges and confirmed postings. For any collection metric, identify the invoice cohort and the period allowed for payment. That makes pending cases visible without treating them as denials.

What to scope in the first integration

Start with one customer agreement and one facility that generates conflicting timestamps. Give dispatch the same sample stop that billing receives. Ask dispatch to identify the notice deadline and billing to reproduce the original charge, explain the correction and post the adjustment once. Include a missing departure and a retry to test the exception queue.

If the decision spans a TMS, telematics provider and accounting system, use the sample to agree which system owns the appointment, which evidence can change it and which platform confirms posting. Pharos Production's logistics software development team can use a redacted stop record and its charge history to scope the integration.

I work with startup founders who need a dedicated software development team but don’t want to gamble on hiring, random outsourcing, or opaque delivery.
Most founders face the same problem sooner or later.
Early technical and team decisions lock the product into tech debt, slow delivery, missed milestones and constant re-hiring. By the time this becomes visible, fixing it is already expensive.

As a CTO and software architect, I help founders design, build and run dedicated development teams that work as a true extension of the startup. Not as a black-box vendor.

My focus is on complex products where mistakes are costly:

  • Web3 and blockchain platforms
  • FinTech and regulated products
  • High-load startup systems
  • MVP → scale transitions

We don’t do body-shopping.
We don’t sell generic outsourcing.

Instead, we help founders:

  • build the right team structure from day one
  • keep technical ownership and transparency
  • scale delivery without losing control
  • avoid vendor lock-in and hidden risks

Teams are aligned with the product roadmap, business goals and long-term architecture. Not just short-term velocity.

Dmytro Nasyrov, Founder and CTO at Pharos Production
Dmytro Nasyrov Founder & CTO Let's work together!

Your business results matter

Achieve them with minimized risk through our bespoke innovation capabilities

Your contact details
Please enter your name
Please enter a valid email address
Please enter your message

We use your details only to reply to your request. Data Privacy and Legal Notice

We typically reply within 24 hours

What happens next?

  1. Contact us

    Contact us today to discuss your project. We're ready to review your request promptly and guide you on the best next steps for collaboration

    Same day
  2. NDA

    We're committed to keeping your information confidential, so we'll sign a Non-Disclosure Agreement

    1 day
  3. Plan the Goals

    After we chat about your goals and needs, we'll craft a comprehensive proposal detailing the project scope, team, timeline and budget

    3-5 days
  4. Finalize the Details

    Let's connect on Google Meet to go through the proposal and confirm all the details together!

    1-2 days
  5. Sign the Contract

    As soon as the contract is signed, our dedicated team will jump into action on your project!

    Same day