Update Vehicle
Update an existing vehicle's information.
Endpoint
INFO
PUT /api/v1/dashboard/vehicles/{vehicle}
Headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Accept | application/json | Yes |
Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
vehicle | integer | Vehicle ID |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
station_id | integer | No | Station ID |
brand | string | No | Vehicle brand |
model | string | No | Vehicle model |
year | integer | No | Manufacturing year |
color | string | No | Vehicle color |
category | string | No | Vehicle category |
hourly_rate | decimal | No | Hourly rental rate |
daily_rate | decimal | No | Daily rental rate |
features | array | No | List of features |
status | string | No | Vehicle status |
Example Request
bash
curl -X PUT https://api.daakey.com/api/v1/dashboard/vehicles/1 \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"hourly_rate": 18.00,
"daily_rate": 95.00,
"features": ["AC", "Bluetooth", "GPS", "Backup Camera", "Heated Seats"]
}'Response
Success (200)
json
{
"success": true,
"message": "Vehicle updated",
"data": {
"id": 1,
"plate_number": "ABC-123",
"pricing": {
"hourly_rate": 18.00,
"daily_rate": 95.00
},
"features": ["AC", "Bluetooth", "GPS", "Backup Camera", "Heated Seats"],
"updated_at": "2024-01-15T00:00:00Z"
},
"request_id": "uuid",
"timestamp": "2024-01-01T00:00:00.000Z"
}Notes
- Plate number cannot be changed
- Changing station reassigns the vehicle