Create Account
Create a new child account by leveraging information from an existing parent account.
Step 1: Fetch your Bearer Token
Use the WEX-provided client_id and client_secret to request for your bearer token.
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
-
Fetch the list of accounts.
-
Choose the parent account you want to use to create the child account.
curl --request GET \'https://wmd.xc.wexonline.com/fleet-service/v3/accounts?page=0&size=25&sort=accountName.keyword' \--header 'Accept-Encoding: gzip,deflate,br' \--header 'Authorization: Bearer' \--header 'Content-Length: 0'Step 3: Create the account
-
Copy the values from the parent account’s
card_shipping_infothat were returned in the response from Step 2. -
Enter your customization values.
-
Use the address Ids from your parent account to fill in the
address_info. -
Use the contact Ids from your parent account to fill in the
contact_info. -
Use the carrier
account_numberand name from the parent account to complete yourcarrier_info. -
Use the
default_auth_profile_idfrom the parent account. -
Add whatever name you want for
account_name. -
Use the Id that was returned in the response from Step 2.
curl --location --request POST 'https://wmd.xc.wexonline.com/fleet-service/v3/accounts' \--header 'Accept-Encoding: gzip,deflate,br' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer' \--data-raw '{ "card_shipping_info" : { "shipping_company_name" : "Company Name", "shipping_contact_id" : "1-3344D", "shipping_address_id" : "1-387A", "shipping_product_id" : "1-28KHF", "allow_card_level_shipping_address" : true }, "customization" : { "locale" : "EN_US", "alias" : "Short Company Name", "description" : "My account" }, "address_info" : { "primary_address_id" : "1-CD3223", "billing_address_id" : "1-83873A" }, "contact_info" : { "billing_contact_id" : "1-AFE33", "fleet_contact_id" : "1-IUUY22" }, "carrier_info" : { "account_number" : "123456", "name" : "FedEx" }, "default_auth_profile_id" : "12345", "account_name" : "Company Name", "parent_account_id" : "1-ABD23"}'On this page
- Create Account