Register your application in the Smartcar dashboard and note the client ID and client secret; configure the redirect URI for your OAuth callback handler
Initiate Smartcar Connect for the policyholder: redirect to the Smartcar authorization URL with scopes including read:odometer and read:vin; the user authenticates with their connected-vehicle account (e.g., OnStar, MyToyota) and grants consent
Exchange the returned authorization code for an access token and refresh token at the Smartcar token endpoint; store both securely — the access token is short-lived
Call GET /vehicles/{vehicleId}/odometer to retrieve the current odometer reading for the policyholder's vehicle; the response includes the distance value and unit
Schedule periodic odometer pulls (e.g., monthly) using stored refresh tokens to generate mileage-based premium invoices; handle token expiry by using the refresh token to obtain a new access token
At policy inception and each billing cycle, record the odometer value with a timestamp; compute miles driven per period and apply the per-mile rate to calculate the premium charge
Known gotchas
Smartcar supports 40+ vehicle brands but coverage varies — some brands are not available in all regions, and older model years may lack connected-vehicle capability; always check compatibility before promising UBI enrollment to a customer
The vehicle owner must actively re-authenticate if their connected-vehicle credentials change (e.g., password reset on the OEM portal); build re-auth prompts into your customer communication flow to avoid data gaps
Odometer readings reflect cumulative lifetime mileage from the vehicle's onboard system; if the OEM's connected-services data is delayed or cached, the reading may lag real-world mileage by hours — document this limitation in your product disclosure
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp