Create Batch Order of Cards
Learn how to create a batch order of cards 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 card.
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: Find your card profile
- Fetch the list of card profiles.
- Choose the card profile you want to use for the new card.
curl --location --request GET 'https://wmd.xc.wexonline.com/fleet-service/v3/accounts/1-A1BAJ2/card-profiles?page=0&size=25' \
--header 'Accept-Encoding: gzip,deflate,br' \
--header 'Authorization: Bearer' \
--header 'Content-Length: 0'
Step 4: Create the first card
To successfully create the card, you'll need the following:
- The Account ID (fetched in Step 2).
- The Card Profile ID (fetched in Step 3).
- To have the physical card created and mailed, set
produce_cardto false. - The
usage_typemust be set to "Asset". - Vehicle Information (Recommended): To attach a specific vehicle to this card, provide the vehicle details as shown in the code example.
Note: If you omit vehicle information: A new vehicle will be created and attached automatically; you can edit its details later.
Note: Do not add shipping information at this time. It will be added after the batch order is created.
curl --location --request POST 'https://wmd.xc.wexonline.com/fleet-service/v3/cards' \
--header 'accept-encoding: gzip,deflate,br' \
--header 'user_id: 12345' \
--header 'content-type: application/json' \
--header 'authorization: Bearer ' \
--data '{
"account_id": "1-A1BAJ2",
"card_profile_id": "1-KH2P1X",
"produce_card": false,
"usage_type": "Asset",
"vehicle": {
"license_plate": {
"license_plate_number": "abc123",
"license_plate_state": "AB",
"license_plate_country": "CA"
},
"detail": {
"make": "ford",
"model": "f150",
"vin": "18218237393038727278",
"year": "2020",
"start_odometer": 0
},
"company_vehicle_id": "1234",
"vehicle_description": "truck",
"distance_per_unit": "10",
"uom": "Gallon",
"tank_capacity": "35"
}
}'
}'
Response
{
"cardId" : "1-IFBXYZ",
"accountId" : "1-A1BAJ2",
"accountName" : "Phathom",
"authorizationControl" : "Custom Control",
"authorizationControlId" : "1-6DUDSA",
"authorizationProfileName" : "Unrestricted",
"bankIdentificationNumber" : "690046",
"batchOrderNumber" : 6417225,
"cardLocked" : false,
"cardNumber" : "1521",
"cardProfileId" : "1-KH2P1X",
"cardProfileName" : "Vehicle 1:M",
"cardType" : "Unrestricted",
"ccn" : true,
"designCode" : "1WHL",
"displayCardType" : "Unrestricted",
"driverCardAddress" : { },
"embossedNumber" : "*************15219",
"embossing" : [
{
"source" : "Asset Description",
"value" : "STRING",
"position" : 1,
"readOnly" : false
},
{
"source" : "Account Short Name",
"value" : "PHATHOM",
"position" : 2,
"readOnly" : false
},
{
"position" : 3
}
],
"evRequested" : false,
"expirationDate" : "2030-10-14T04:00:00Z",
"lastIssueDate" : "2025-10-15T04:00:00Z",
"lastUpdated" : "2025-10-15T15:20:14.492062367Z",
"magStripNumber" : "*******************15219",
"orderId" : "1-IFBABD",
"originalCardId" : "1-IFB456",
"posDisplayPrompt" : "Odometer & Driver ID",
"posOverridePrompt" : "Odometer & Driver ID",
"productId" : "1-79489”,
"renewalFlag" : false,
"renewalPeriod" : "60",
"rfids" : [ ],
"status" : {
"status" : "Active",
"statusReason" : "Active"
},
"usageType" : "Asset",
"userDefinedFields" : [ ],
"vehicleId" : "1-IFB123",
"vehicleCustomerId" : "1234",
"vehicleDescription" : "truck",
"vin" : "18218237393038727278",
"licensePlateNumber" : "abc123"
}
}
Step 5: Create the second card
To successfully create the second card, you'll need the following:
- The Account ID (fetched in Step 2).
- The Card Profile ID (fetched in Step 3).
- To have the physical card created and mailed, set
produce_cardto true. - The
usage_typemust be set to "Asset". - Create subsequent cards using the POST /cards endpoint, including the
batch_order_numberobtained from the first card response in Step 3. Repeat this for all additional cards, using the samebatch_order_number. - Vehicle Information (Recommended): To attach a specific vehicle to this card, provide the vehicle details as shown in the code example.
Note: If you omit vehicle information: A new vehicle will be created and attached automatically; you can edit its details later.
Note: Do not add shipping information at this time. It will be added after the batch order is created.
curl --location --request POST 'https://wmd.xc.wexonline.com/fleet-service/v3/cards' \
--header 'accept-encoding: gzip,deflate,br' \
--header 'user_id: 36702' \
--header 'content-type: application/json' \
--header 'authorization: Bearer' \
--data '{
"account_id": "1-A1BAJ2",
"card_profile_id": "1-KH2P1X",
"produce_card": false,
"usage_type": "Asset",
"batch_order_number": 6417225,
"vehicle": {
"license_plate": {
"license_plate_number": "123abc",
"license_plate_state": "AB",
"license_plate_country": "CA"
},
"detail": {
"make": "chevy",
"model": "camaro",
"vin": "182182373930381234",
"year": "2020",
"start_odometer": 0
},
"company_vehicle_id": "532321",
"vehicle_description": "sport",
"distance_per_unit": "10",
"uom": "Gallon",
"tank_capacity": "20"
}
}'
}'
Step 6: Create the Batch Order
Use the POST/cards/orders endpoint to complete your batch order. Use the batch_order_number that you used to order the cards for the batch. Fill in the shipping information for the order.
curl -X POST "https://wmd.xc.wexonline.com/fleet-service/v3/cards/orders" \
-H 'accept: application/json' \
-H 'authorization: Bearer Token' \
-H 'content-type: application/json' \
-d '{
"requested_by": "Batch Test",
"batch_order_number": 6711351,
"account_id": "1-DPIOH6",
"address_type": "Special",
"shipping_information": {
"address": {
"address_line1": "A Street",
"city": "Portland",
"country_code": "US",
"postal_code": "04121",
"residential_indicator": true,
"state": "ME"
}
}
}'
On this page
- Create Batch Order of Cards