Add a vehicle
curl --request POST \
--url https://partners.chargeexpressltd.com/api/public/v1/vehicles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vehicle_type_id": 123,
"vehicle_model_id": 123,
"registration_number": "<string>",
"vin": "<string>",
"asset_tag": "<string>",
"description": "<string>",
"driver_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
vehicle_type_id: 123,
vehicle_model_id: 123,
registration_number: '<string>',
vin: '<string>',
asset_tag: '<string>',
description: '<string>',
driver_id: '<string>'
})
};
fetch('https://partners.chargeexpressltd.com/api/public/v1/vehicles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://partners.chargeexpressltd.com/api/public/v1/vehicles"
payload = {
"vehicle_type_id": 123,
"vehicle_model_id": 123,
"registration_number": "<string>",
"vin": "<string>",
"asset_tag": "<string>",
"description": "<string>",
"driver_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "vehicle",
"id": "<string>",
"registration_number": "<string>",
"vin": "<string>",
"asset_tag": "<string>",
"status": "active",
"vehicle_type_id": 123,
"vehicle_model_id": 123,
"brand": "<string>",
"model": "<string>",
"description": "<string>",
"image_url": "<string>",
"driver_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Vehicles
Add a vehicle
Requires the vehicles:write scope.
Accepts an Idempotency-Key header.
POST
/
vehicles
Add a vehicle
curl --request POST \
--url https://partners.chargeexpressltd.com/api/public/v1/vehicles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vehicle_type_id": 123,
"vehicle_model_id": 123,
"registration_number": "<string>",
"vin": "<string>",
"asset_tag": "<string>",
"description": "<string>",
"driver_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
vehicle_type_id: 123,
vehicle_model_id: 123,
registration_number: '<string>',
vin: '<string>',
asset_tag: '<string>',
description: '<string>',
driver_id: '<string>'
})
};
fetch('https://partners.chargeexpressltd.com/api/public/v1/vehicles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://partners.chargeexpressltd.com/api/public/v1/vehicles"
payload = {
"vehicle_type_id": 123,
"vehicle_model_id": 123,
"registration_number": "<string>",
"vin": "<string>",
"asset_tag": "<string>",
"description": "<string>",
"driver_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "vehicle",
"id": "<string>",
"registration_number": "<string>",
"vin": "<string>",
"asset_tag": "<string>",
"status": "active",
"vehicle_type_id": 123,
"vehicle_model_id": 123,
"brand": "<string>",
"model": "<string>",
"description": "<string>",
"image_url": "<string>",
"driver_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Authorizations
Your fleet API key, e.g. Authorization: Bearer cxk_live_…. Create keys in the fleet portal under Developers.
Headers
Maximum string length:
255Body
application/json
Required string length:
1 - 32Required string length:
1 - 64Required string length:
1 - 64Maximum string length:
5000Pattern:
^[a-z][a-z0-9]{23,31}$Available options:
active, maintenance, inactive, retired Response
Success
Available options:
vehicle Available options:
active, maintenance, inactive, retired 
