Create bank account and make payment
Learn how to create a bank account and make a payment 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 --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 account you want to use for the new bank 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'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 bank account
-
Fetch the
account_idfrom Step 2. -
Add your
bank_account_name. -
Add your
bank_account_number. -
Add your
routing_number.
Note: To make this your default bank, change default_bankto “true”. Otherwise, leave it “false”.
curl --location --request POST 'https://wmd.xc.wexonline.com/fleet-service/v3/accounts/banks' \--header 'accept-encoding: gzip,deflate,br' \--header 'content-type: application/json' \--header 'authorization: Bearer' \--data-raw '{ "account_id": "1234", "bank_account_name": "string", "bank_account_number": "1234", "routing_number": "string", "default_bank": false}'Step 4: Create the payment
-
Enter the
account_numberthat matches theaccount_idcreated in Step 3. -
Enter your
payment_amount, up to your current balance but not over. -
Enter your
payment_scheduled_bank_id, which matches thebank_idreturned in Step 2. -
Enter your
payment_scheduled_date. The cutoff is 3:30 p.m. EST. -
Your payment amount will be checked against your current balance to ensure it does not go over your current balance. The API will flag and cancel any payment above your current balance.
curl --location --request POST 'https://wmd.xc.wexonline.com/fleet-service/v3/accounts/payments' \--header 'accept-encoding: gzip,deflate,br' \--header 'content-type: application/json' \--header 'authorization: Bearer' \--data-raw '{ "account_number": "1234", "payment_amount": 1.5, "payment_scheduled_bank_id": 1234, "payment_scheduled_date": "2015-07-20T15:49:04-07:00", "payment_type": "CURRENT_BALANCE"}'Response
{ "bank_id": "1234", "bank_account_name": "bank name", "bank_account_last_four_digits": "3455", "bank_account_status": "Active", "routing_number": "312323", "default_bank": false}On this page
- Create bank account and make payment