Inspiration

Truck drivers wait at loading docks for hours, unpaid. ATRI (2024) found drivers are detained at 39.3% of stops (56.2% for reefer). 94.5% of fleets bill detention, but fewer than half of those invoices get paid, and the industry loses about $15B/yr. DOT OIG (2018) puts lost driver income at $1.1–1.3B/yr, and each extra 15 minutes of dwell is associated with a +6.2% expected crash rate.

The money exists. What's missing is trust: nobody agrees on how long the wait was, and nobody pays up front. Our idea: a PayPal authorization hold is a spending mandate for an AI agent.

What it does

When a load is dispatched, DockClock places a PayPal authorization hold sized from dwell history. It measures the wait from evidence: ELD geofence pings, the gate system, driver check-in and a BOL photo. Then it settles automatically:

  • Capture what's owed (partial, final or overcapture), or void if nothing is owed
  • Payout to the driver at the gate
  • Invoice for anything above the hold
  • Dispute defence pack with evidence if the charge is challenged
  • Reauthorize holds that outlive the honor period

AI agents for the shipper, facility and carrier negotiate priority slots, reschedules and parts purchases with each other, but only inside the mandate. One rule runs through all of it: the AI reads, code decides, PayPal executes. No model output ever becomes a money amount.

Surfaces: Judge mode (8 scenarios with real sandbox debug_ids), Dispatch, a live Dock board, a 4-language Driver app (EN/ES/HI/PA) with a Proof-of-Wait receipt, a finance Cockpit, an Analytics studio, a receipt Verify page and Health.

How we built it

  • Next.js + TypeScript (strict) monorepo with a pure packages/core settlement engine: integer cents only, Zod at every boundary.
  • PayPal (all real sandbox calls): Orders v2 AUTHORIZE + Vault, Captures (partial/final/overcapture), Void, Reauthorize, Payouts v1, Invoicing v2, Disputes + provide-evidence, Webhooks with signature verification, Orders CAPTURE with the carrier as payer, Transaction Search for nightly reconciliation. Every write carries a stage-scoped PayPal-Request-Id. Webhooks are deduped and can only move the load state machine forward.
  • APIMatic PayPal Server SDK for read paths.
  • Agents (Gemini): each agent picks from a typed offer menu. The engine sets the price, and a mandate guard checks caps, counterparties, expiry and the hold ceiling. Every decision lands in a hash-chained agent ledger. Vision returns typed detections, and low-confidence results go to human review.
  • AG Grid Enterprise + AG Charts: cockpit ledger, review queue (the approve cell triggers a real capture), reconciliation. AG Studio: analytics with a custom facility-quadrant widget and an NL analyst.
  • Bryntum Scheduler: dock board, live over SSE, drag to re-price.
  • Channel3: product search for carrier parts purchases.
  • Render: hosted deployment via Blueprint. Postgres, Docker.

Challenges we ran into

  • Keeping LLMs out of the money path while still letting agents transact with each other. We solved it with typed action menus, a code-enforced mandate guard, and treating other agents' text as display-only. That also defeats prompt injection from documents and from other agents.
  • Idempotency across retries, webhooks and pollers: stage-scoped request ids plus a forward-only state machine.
  • Hold lifecycle edge cases: honor-period reauthorization, overcapture limits, spillover invoicing.
  • Running agents on free-tier models: pacing, model rotation on rate limits, a daily spend cap, and a deterministic fallback for every agent.

Accomplishments that we're proud of

  • 10 PayPal capabilities working end to end on sandbox, each with a recorded debug_id.
  • Agent-to-agent commerce where the money limit is a real PayPal hold, not a prompt.
  • A red-team log showing blocked agent actions, plus a hash-chained, verifiable Proof-of-Wait receipt for drivers.

What we learned

Authorizations are an underrated primitive for agentic commerce. A hold gives an agent a hard, bank-enforced budget. Pair it with deterministic code for amounts, and AI can act on money safely.

What's next for DockClock

PayPal Multiparty for carrier-as-payee, FMCSA carrier verification, real ELD integrations, facility appointment APIs, factoring-partner payouts, and an EU version (no overcapture).

Built With

Share this project:

Updates

Submission history