Skip to content

Complete vehicle onboarding

Request

Exchanges a provider auth_code for a list of vehicles, completing an onboarding flow that was initiated via GET /v2/vehicle_onboarding/?response_type=json. Used primarily by native mobile clients integrating with the Smartcar Connect SDK (the SDK returns the auth_code directly to the app).

No OAuth bearer token is required, mirroring the init endpoint. The authorization_request_uid returned by the init call is what binds this request to the legitimate onboarding flow — it is treated as a single-use token.

Bodyapplication/json
authorization_request_uidstring, (uuid)required

UUID of the AccountAuthorizationRequest returned by the init endpoint.

Example:"4d4ce3d9-8a16-46a8-99e1-3f3f9b8a3a5b"
auth_codestringrequired

OAuth auth_code returned by the integration provider.

Example:"SC-AUTH-CODE-EXAMPLE"
smartcar_user_idstring or null, <= 100 characterswrite-only

SmartCar user UUID (the userId returned alongside auth_code on the Connect redirect / native SDK callback). Optional; only set for the SmartCar provider.

Example:"a4c82e9f-0b1c-4d2e-8f3a-5b6c7d8e9f01"
curl -i -X POST \
  https://developers.ev.energy/_mock/ev.energy-api-v2/vehicle_onboarding/complete \
  -H 'Content-Type: application/json' \
  -d '{
    "authorization_request_uid": "4d4ce3d9-8a16-46a8-99e1-3f3f9b8a3a5b",
    "auth_code": "SC-AUTH-CODE-EXAMPLE",
    "smartcar_user_id": "a4c82e9f-0b1c-4d2e-8f3a-5b6c7d8e9f01"
  }'

Responses

Authorization code exchanged successfully. Returns the list of created vehicles. Always an array, even when only a single vehicle was created.

Headers
EvEnergy-Versionnumber

Indicates the version of the API that generated this response. If EvEnergy-Version was not specified in the request, this will be your OAuth application's default version.

Value:2
X-RateLimit-Limitnumber

The maximum number of requests that can be made to this endpoint per hour. Defaults to 1000 but may vary per client.

Default:1000
X-RateLimit-Remainingnumber

The number of requests remaining until this client's rate limit is reached.

Default:999
RetryAfternumber

The number of seconds until this client's requests will not be rate limited.

Default:3600
Bodyapplication/json
vehiclesArray of objectsrequired
Response
{ "vehicles": [ {} ] }