Create Vehicle
Learn how to create a vehicle in the Fleet Management Services API.
Step 1: Fetch your Bearer Token
Use the WEX-provided clientid and clientsecret to request for your bearer token.
CURL
curl --location --request POST 'https://wmd.xc.wexonline.com/oauth-service/uaa/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept-Encoding: gzip,deflate,br' \
--data 'grant_type=client_credentials&client_secret=1234&client_id=some-client-id'
Step 2: Find your account
- Find your account.
- Fetch the list of accounts and pick the one that you want to use to create a vehicle.
CURL
curl --request GET \
'https://wmd.xc.wexonline.com/fleet-service/v3/accounts?page=0&size=25&sort=account_name.keyword' \
--header 'Accept-Encoding: gzip,deflate,br' \
--header 'Authorization: Bearer' \
--header 'Content-Length: 0'
Step 3: Create the vehicle
- Fill out the information as necessary using the accountId (fetched in Step 2).
Note: vehicle_prompt_id is only editable if your account is configured for customer-assigned prompt IDs. Also defined on the account record is the size of the prompt_id , which can be 4 or 6 digits.
CURL
curl --location --request POST 'https://wmd.xc.wexonline.com/fleet-service/v3/vehicles' \
--header 'Accept-Encoding: gzip,deflate,br' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer' \
--data '{
"account_id": "1-AD334",
"asset_type": "VEHICLE",
"company_vehicle_id": "Your vehicle id",
"description": "Van",
"vehicle_prompt_id": "1234",
"license_plate": {
"license_plate_number": "2838A",
"license_plate_state": "AZ",
"license_plate_country": "US"
},
"detail": {
"make": "Toyota",
"model": "Prius",
"vin": "12347463536738373",
"year": "2020",
"start_odometer": 0
},
"fuel": {
"tank_capacity": 20,
"unit_of_measure": "GALLONS",
"mpg": 60
}
}'
Was this section helpful?
On this page
- Create Vehicle