Create Driver
Learn how to create a driver in the Fleet Management Services API.
Step 1: Fetch your Bearer Token
Use the WEX-provided client_id and client_secret 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 driver.
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 driver
- Fill out the information as necessary using the accountId (fetched in Step 2).
Note: driver_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 promptId , which can be 4 or 6 digits.
CURL
curl --location --request POST 'https://wmd.xc.wexonline.com/fleet-service/v3/drivers' \--header 'Accept-Encoding: gzip,deflate,br' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer' \--data '{ "account_id": "1-AF33", "contact": { "job_title": "Captain", "first_name": "Jim", "last_name": "Kirk", "middle_name": "Tiberious", "email": "jim@trek.com", "employee_number": "NC-107", "badge_number": "1", "phone_number": "1234567890", "cell_phone_number": "1234567890", "zip_code": "1234" }, "driver_license": { "license_number": "ABCD", "license_state": "ME", "license_country": "US" }, "driver_prompt_id": "1234"}' "license_number": "ABCD", "license_state": "ME", "license_country": "US" }, "driver_prompt_id": "1234"}'Was this section helpful?
On this page
- Create Driver