This guide covers best practices for integrating Terminal into fuel card workflows. It’s organized into key implementation areas that map to the fuel card lifecycle:
We recommend a phased rollout to de-risk your integration and validate data quality before enabling transaction declines:
Phase
Scope
What You’re Validating
V0: Logging Only
Log GPS distance at authorization, no declines
Data quality, coverage gaps, false positive rates
V1: Location Verification
Enable transaction declines based on location
Threshold tuning, operational workflows
V2: Fuel Verification
Add fuel level and tank-capacity checks
Fueling to data presence delay, noise from sloshing
V3: Full Feature Set
Routing, IFTA, analytics
End-to-end value delivery
Start with V0: Run in logging-only mode for 2-4 weeks to establish
baseline metrics before enabling declines. This lets you tune distance
thresholds and identify edge cases (e.g., card-not-present transactions,
multi-vehicle fleets) without impacting cardholders.
The first step is obtaining consent from the fleet to access their telematics data. Terminal’s Link component handles the consent flow and authorization with the telematics provider.
Use Terminal Link to guide fleets through connecting their telematics provider. For fuel cards, use Automatic sync mode from the start—you need continuous data access for fraud prevention.
View integration options
Hosted Flow
React SDK
JavaScript SDK
The hosted flow is a URL you can send directly to fleets via email, SMS, or any messaging channel:
Use tags to associate connections with your internal identifiers like
account numbers (account-1234), fleet IDs (fleet-5678), or program tiers
(program-premium).
Managing connection events is critical for fuel card workflows. A disconnected connection means degraded fraud protection—use webhooks to automate responses to connection state changes.
When a connection becomes disconnected (credentials expire, provider access revoked, etc.), Terminal sends a connection.disconnected webhook. This can result in a fraud protection gap—notify the fleet promptly and degrade gracefully.
View code
Copy
Ask AI
if (event.type === 'connection.disconnected') { const { connection } = event.detail; // Find account number from tags const accountTag = connection.tags?.find((t) => t.startsWith('account-')); const accountNumber = accountTag?.replace('account-', ''); // Flag the account for reduced protection await updateAccountStatus({ accountNumber, telematicsStatus: 'disconnected', fraudProtectionLevel: 'reduced', // Fall back to static auth rules }); // Send urgent notification to fleet with reconnection link await notifyFleet({ email: getFleetEmail(accountNumber), subject: 'Action Required: Reconnect Your Telematics', body: 'Your telematics connection has been disconnected. Location Verification fraud protection is temporarily reduced. Please reconnect to restore full protection.', reconnectUrl: connection.linkUrl, priority: 'high', }); // Alert your operations team await alertOpsTeam({ accountNumber, reason: 'telematics_disconnected', impact: 'Fraud protection degraded to static rules', });}
For fuel card implementations, you’ll use Terminal’s API for two key workflows: syncing fleet entities (vehicles, drivers, trailers) and real-time location verification for fraud prevention.
When a fleet connects their telematics, sync their roster to auto-populate your card management system. This eliminates manual data entry and keeps your system in sync with the fleet’s actual assets. Start with GET /vehicles, GET /drivers, and GET /trailers.
View entity sync code
Copy
Ask AI
async function syncFleetRoster(connectionToken: string) { // Get vehicles from Terminal const vehiclesResponse = await fetch( 'https://api.withterminal.com/tsp/v1/vehicles', { headers: { Authorization: `Bearer ${SECRET_KEY}`, 'Connection-Token': connectionToken, }, }, ); const vehicles = await vehiclesResponse.json(); // Auto-populate your card management system for (const vehicle of vehicles.results) { await createOrUpdateVehicleRecord({ vin: vehicle.vin, name: vehicle.name, licensePlate: vehicle.licensePlate, fuelType: vehicle.fuelType, tankCapacityLiters: vehicle.fuelTankCapacity, telematicsId: vehicle.id, }); } // Repeat for /drivers and /trailers endpoints return { vehiclesImported: vehicles.results.length, };}
Keeping entities in sync with webhooks:Subscribe to entity webhooks to stay in sync as the fleet’s roster changes:
For card authorization, we recommend the fuel card provider poll Terminal on a schedule and maintain a traceable copy of vehicle state (location snapshots, tank capacity, timestamps, provider metadata) in your own datastore. Then at swipe time, evaluate Location Verification and fuel verification (capacity checks) from your local data, while using Terminal API reads only as fallback/refresh paths (see Managed Polling and real-time data).Recommended authorization flow:Key endpoints:
For sub-second response times, enable Managed Polling in your Terminal dashboard. Terminal proactively caches location data at your configured interval (e.g., every 15 seconds).
Latency Target
Recommended Approach
Trade-off
Less than 800ms
Managed Polling (15s)
Location may be 15s old
1-3s acceptable
On-Demand
Freshest data, higher latency
For sub-second Location Verification: Most production implementations use
managed polling with a 15-30 second interval. A vehicle’s location rarely
changes significantly in 15 seconds, making this acceptable for fraud
prevention while achieving sub-500ms authorization response times.
Production recommendation: Start with on-demand calls during pilot to
validate data quality, then switch to managed polling when you need sub-second
latency for production authorization flows.
The Terminal dashboard provides a visual interface for investigating transactions and verifying vehicle activity without writing code. Fraud and operations teams can:
View vehicle history: See trips, GPS breadcrumbs, and routes on an interactive map with timeline filtering
Verify transaction locations: Check where a vehicle was at a specific time to validate or investigate fuel purchases
Browse live locations: See current fleet positions for real-time verification
Filter by date and vehicle: Narrow down to specific vehicles and time ranges around suspicious transactions
Export data: Download trip and vehicle data as CSV for analysis or dispute resolution
This is particularly useful for fraud investigation teams who need to quickly verify whether a vehicle was actually at a fuel station when a transaction occurred.