Building a Freight API That Updates Toll Rates Every 15 Minutes
How we designed a sub-120ms toll pricing API that ingests authority feed updates, handles managed-lane time windows, and serves 50K+ plazas without a cold cache.
Toll data is not static GIS — it is time-series pricing attached to roadway graph edges. DrayToll separates route geometry (Valhalla truck routing) from plaza matching and rate resolution (TollSmart plus authority-maintained fallbacks in our location database).
Pipeline overview
- Corridor sync jobs generate truck routes between terminals, hubs, and unpriced plazas
- TollSmart responses hydrate cash and transponder rates into toll_locations
- Redis-backed cache with TTL aligned to feed freshness
- API handlers split route and pricing phases for responsive UX
- OpenAPI-documented routes for admin, portal, public demo, and v1 API key access
Why two-phase calculate
Customers see the route on the map in under a second while pricing completes. Portal and API consumers get route polyline first, toll breakdown second — critical when a corridor hits 20+ plazas and TollSmart latency spikes.

Dynamic corridor generation
We removed static sync corridor files. Terminals from the database seed hub pairs, interstate sweeps, and micro-routes to unpriced plazas — so new port gates and rail ramps enter the sync graph without a deploy.
Operational metrics we target
- P95 API response under 120ms for cached corridors
- TollSmart sync minute cron with HTTP fallback for ops
- 99.9% uptime SLA for production API keys
- Full OpenAPI coverage — 98 documented route handlers
“We migrated from a ZIP-distance toll plugin to DrayToll v1 in six weeks. Plaza-level breakdown let our customers audit us — and we passed.”
Get started
Request API access on the pricing page, or validate accuracy on the public toll calculator first. Same engine, same plaza matching — production keys add billing, higher rate limits, and webhook-ready usage logs.