Pricing

Docs

Guides

Testing

Before making a live request to a real vehicle, Smartcar's test mode allows you to test your application on a simulated vehicle.


Testing API requests

To send a test API request to a simulated vehicle, please complete the following steps.

  1. When redirecting to Connect, pass in the query parameter mode=test. If you are using an SDK, use the test_mode boolean when instantiating the Smartcar authorization client.
  2. Click on any vehicle brand.
  3. Use any email address (anything@anything.com) with any password to log into a simulated vehicle for the chosen vehicle brand.
  4. Send an API request to the vehicle. Our API will return the following randomized data.

    1. /location returns a random location boxed in Colorado
    2. /odometer returns a random value between 10,000 and 300,000 km
    3. /security always returns a success status
    4. /battery

      1. percentRemaining returns a random percentage
      2. range returns a random value between 0 and 483 km
    5. /charge

      1. isPluggedIn returns a random boolean
      2. state returns a random state (CHARGING, FULLY_CHARGED, or NOT_CHARGING)
    6. /fuel

      1. range returns a random value between 0 and 483 km
      2. amountRemaining returns a random value between 0 and 500 L
      3. percentRemaining returns a random percentage
    7. /engine/oil returns a random percentage
    8. /tires/pressure

      1. tires.* returns a random value between 175 and 237 kPa

Testing errors

You can use test mode to verify that your application receives the errors that it should expect to receive from Smartcar in different situations. There are two types of errors that can occur after integrating Smartcar into an application.

  1. Connect errors
  2. Runtime errors

1. Connect errors

Connect errors are errors that occur during Smartcar’s authorization flow. The following section explains the different kinds of Connect errors and how to test them.

access_denied

This error occurs when a user denies your application access to the requested scope of permissions. To test this error, please complete the following steps.

  1. Launch Connect in test mode (See step 1 of Testing API requests)
  2. Click on any vehicle brand
  3. Log in with any email and any password
  4. Click on “Deny access”

vehicle_incompatible

This error occurs when a user tries to authorize only incompatible vehicles in Smartcar Connect.

Note: This error will never occur if your application uses Connect Compatibility. Connect Compatibility verifies the compatibility of a vehicle before the user enters Smartcar Connect.

Standard Connect flow

If your application uses the standard Connect flow and none of the vehicles associated with a user’s account are compatible, Smartcar returns a vehicle_incompatible error. To test this error, please complete the following steps.

  1. Launch Connect in test mode (See step 1 of Testing API requests)
  2. Click on any vehicle brand
  3. Log in with the email smartcar@vehicle-incompatible.com and any password

All vehicles associated with this account will be incompatible with the required permissions that your application is requesting access to.

User doesn’t have an account

If a user clicks on “Don't have an account?" and then enters the VIN of an incompatible vehicle, Smartcar returns a vehicle_incompatible error. To test this error, please complete the following steps.

  1. Launch Connect in test mode (See step 1 of Testing API requests)
  2. Click on any vehicle brand
  3. Click on Don't have an account?
  4. Pass in an incompatible test VIN. See the Constructing test VINs section for more information. Test VINs with identifiers ending in 01 are incompatible with all permissions.

Smartcar Connect Match

If your application uses Smartcar Connect Match and passes in the VIN of an incompatible vehicle, Smartcar returns a vehicle_incompatible error. To test this error, please complete the following steps.
  1. Launch Connect in test mode (See step 1 of Testing API requests)
  2. Click on any vehicle brand
  3. Click on Don't have an account?
  4. Pass in an incompatible test VIN. See the Constructing test VINs section for more information. Test VINs with identifiers ending in 01 are incompatible with all permissions.

2. Runtime errors

Runtime errors are errors that occur when an API request to a vehicle is unsuccessful. For a full list of all runtime errors, see our API reference.

The following runtime errors can be tested using Smartcar’s test mode.

  1. vehicle_owner_action_required
  2. vehicle_state_error
  3. server_error
  4. vehicle_not_capable_error
  5. smartcar_not_capable_error

To test a runtime error, please complete the following steps.

  1. Launch Connect in test mode (See step 1 of Testing API requests)
  2. Click on any vehicle brand
  3. Log in with an email and password of the following format

    1. If the error doesn’t have an error code (e.g. vehicle_not_capable_error), the email should be of the format smartcar@error-name.com (e.g. smartcar@vehicle-not-capable-error.com).
    2. If the error has an error code (e.g. vehicle_owner_action_required), the email should be of the format smartcar@error-code.error-name.com (e.g. smartcar@voa-000.vehicle-owner-action-required.com)
    3. The error code should be lower-cased and the error name should be kebab-cased.
  4. Send an API request to any vehicle authorized in the above step.

Constructing test VINs

To facilitate error testing, Smartcar provides a number of simulated test VINs (vehicle identification numbers). Those VINs do not belong to real vehicles, but rather represent simulated vehicles with varying compatibility. The VINs are constructed as follows.

  1. Each test VIN consists of 17 alphanumeric characters.
  2. The first 3 characters are always 0SC. This makes the VIN identifiable as a Smartcar test VIN.
  3. The next 6 characters identify the simulated vehicle. See the List of test VINs section for a list of all valid identifiers.
  4. Please randomly generate the last 8 characters of the VIN.

Each test VIN is compatible with a specific set of permissions. Please see the following list for all test VINs and the permissions they are compatible with.

List of all test VINs and compatible permissions

AUDI01 - 2014 Audi A3 - none

AUDI02 - 2017 Audi A4 - read_odometer, read_location, control_security, read_fuel

AUDI03 - 2019 Audi A6 - read_odometer, read_location, control_security, read_fuel

BMW001 - 2011 BMW X1 - none

BMW002 - 2015 BMW X1 - control_security

BMW003 - 2016 BMW 740i - read_odometer, read_location, control_security, read_fuel

BMW004 - 2016 BMW i3 - read_odometer, control_security, read_charge, read_battery

BMW005 - 2017 BMW i3 - read_odometer, control_security, read_fuel, read_charge, read_battery

BMW006 - 2018 BMW 330i - read_odometer, read_location, control_security, read_fuel

GMB001 - 2008 Buick Enclave - none

GMB002 - 2018 Buick LaCrosse - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

GMB003 - 2018 Buick Verano - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

GMCC01 - 2009 Cadillac Escalade - none

GMCC02 - 2017 Cadillac CTS - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

GMCC03 - 2018 Cadillac ATS - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

GMCT01 - 2007 Chevrolet Equinox - none

GMCT02 - 2018 Chevrolet Volt - read_odometer, read_location, control_security, read_fuel, read_charge, read_battery, read_engine_oil, read_tires

GMCT03 - 2018 Chevrolet Bolt - read_odometer, read_location, control_security, read_charge, read_battery, read_tires

FCAC01 - 2011 Chrysler 200 - none

FCAC02 - 2017 Chrysler 300 - read_odometer, read_location, control_security, read_fuel

FORD01 - 2016 Ford Fusion - none

FORD02 - 2018 Ford Fusion - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

FORD03 - 2018 Ford Mustang - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

GMC001 - 2010 GMC 200 - none

GMC002 - 2017 GMC Yukon - read_odometer, read_location, control_security, read_fuel

GMC003 - 2017 GMC Sierra - read_odometer, read_location, control_security, read_fuel

HYU001 - 2013 Hyundai Accent - none

HYU002 - 2014 Hyundai Elantra - read_odometer, read_location

HYU003 - 2016 Hyundai Sonata - read_odometer, read_location, control_security

HYU004 - 2018 Hyundai Sonata Plugin Hybrid - read_odometer, read_location, control_security, read_fuel, read_charge, read_battery

HYU005 - 2019 Hyundai Ioniq Electric - read_odometer, read_location, control_security, read_charge, read_battery

TESL01 - 2008 Tesla Roadster - none

TESL02 - 2016 Tesla Model S - read_odometer, read_location, control_security, read_charge, read_battery

TESL03 - 2017 Tesla Model X - read_odometer, read_location, control_security, read_charge, read_battery

TESL04 - 2018 Tesla Model 3 - read_odometer, read_location, control_security, read_charge, read_battery

LEXU01 - 2014 Lexus IS - none

LEXU02 - 2017 Lexus IS - read_odometer, read_location, control_security, read_fuel

LEXU03 - 2017 Lexus ES - read_odometer, read_location, control_security, read_fuel

LIN001 - 2015 Lincoln MKS - none

LIN002 - 2018 Lincoln MKC - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

LIN003 - 2018 Lincoln MKT - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

VW0001 - 2013 Volkswagen Eos - none

VW0002 - 2015 Volkswagen Passat - read_odometer, read_location, control_security, read_fuel

VW0003 - 2016 Volkswagen eGolf - read_odometer, read_location, control_security, read_charge, read_battery

FCAJ01 - 2013 Jeep Wrangler - none

FCAJ02 - 2018 Jeep Compass - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

FCAJ03 - 2018 Jeep Cherokee - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

FCAR01 - 2014 RAM 1500 - none

FCAR02 - 2017 RAM 2500 - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

FCAR03 - 2018 RAM 3500 - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

FCAD01 - 2014 Dodge Journey - none

FCAD02 - 2017 Dodge Challenger - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires

FCAD03 - 2018 Dodge Charger - read_odometer, read_location, control_security, read_fuel, read_engine_oil, read_tires