Server infrastructure for high-availability API
Engineering
Back to blog
Mar 22, 2026 · 14 min read

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.

PN
Priya Nair
Engineering Lead, DrayToll

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).

Data center servers
Rate cache TTL aligns to authority publish cadence — stale data is worse than no data for freight SLAs.

Pipeline overview

  1. Corridor sync jobs generate truck routes between terminals, hubs, and unpriced plazas
  2. TollSmart responses hydrate cash and transponder rates into toll_locations
  3. Redis-backed cache with TTL aligned to feed freshness
  4. API handlers split route and pricing phases for responsive UX
  5. 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.

Toll road aerial view
Public demo at /toll-calculator uses the same calculate service as production — IP rate-limited, no API key required.

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.

CTO, freight rating platform

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.

Loved by fleets & drivers

What our clients say about us

5.00
16 reviews
5.0
May 06, 2026
Best toll-cost tool we've used. We finally bid lanes knowing the real toll burden — by axle class — instead of guessing and eating it later.
Marcus Powell
Marcus Powell
Fleet manager
5.0
May 05, 2026
Honestly the cleanest toll calculator out there. Love it.
Terry McCarty
Terry McCarty
Owner-operator
5.0
Apr 28, 2026
Just started using it and so far so good. The 5-axle toll numbers matched what hit our E-ZPass statement almost to the dollar.
Ben Wallace
Ben Wallace
Dispatch lead
5.0
Apr 23, 2026
Quick, accurate, dependable. Exactly what our dispatch desk needed.
Talia Bennett
Talia Bennett
Freight broker

Stop guessing. Start pricing tolls accurately.

Get API access to the same toll data that powers these articles — class-aware, plaza-level, updated every 15 minutes.