Skip to main content

Toll Reconciliation

HostMetrics tracks toll charges across your fleet and matches them to specific trips for accurate cost accounting. This feature supports multiple toll providers and both manual CSV import and automatic sync.

Supported Toll Providers

ProviderRegionImport Method
NTTATexas (Dallas/Fort Worth)CSV import, automatic sync
EZPassNortheast USCSV import
SunPassFloridaCSV import
See the data reference pages for CSV formats: NTTA, EZPass, SunPass.

Connecting Toll Accounts

On the Data Sources page, users can add toll account credentials. These are stored in the toll_accounts table and used for automatic sync.

Import Methods

Download a transaction report from your toll provider’s website, then upload it in HostMetrics. The system parses provider-specific CSV formats, extracts transaction date, amount, plaza/location, and tag ID.
For supported providers (NTTA), an AWS Lambda function periodically scrapes toll transactions using saved credentials. The sync runs on a schedule and can also be triggered manually. See Toll Sync Architecture for technical details.

Trip Matching

Toll transactions are matched to trips by comparing:
  1. Date — The toll transaction date falls within the trip’s start and end dates
  2. Vehicle — The toll tag is associated with a specific vehicle
Toll dates are stored as plain date strings (not UTC timestamps) because toll agencies report in their operating timezone. Matching uses date-only comparison. See the timezone architecture section in the project docs for details.

Reconciliation Table

The TollReconciliationTable component shows all toll transactions with their match status:
StatusMeaning
MatchedToll is linked to a specific trip and vehicle
UnmatchedNo trip found for the toll date and vehicle
ManualUser manually assigned the toll to a trip

Cost Analysis

The Reports page includes toll-specific analytics:
  • Summary cards (TollSummaryCards) — Total toll costs, average per trip, matched percentage
  • Trend chart (TollTrendChart) — Monthly toll spending over time
  • By-vehicle breakdown (TollsByVehicleChart) — Which vehicles incur the most tolls
  • Reconciliation report — Full matched/unmatched transaction list with CSV export

Key Files

FilePurpose
src/lib/db/toll-transactions.tsImport, parse, and query toll data
src/lib/db/toll-accounts.tsManage toll provider credentials
src/app/api/tolls/sync/route.tsAPI route for manual sync trigger
src/components/reports/TollsTab.tsxToll analysis tab in Reports
src/components/reports/TollReconciliationTable.tsxMatch status table