Contents
On this page
Update Vehicle - Plugixa Chauffeur
PUT /plugixa-chauffeur/v1/vehicles/{id}
Change the fields you send and keep the others: publish a vehicle, change its rates or its photos.
Needs a signed-in user with the plugixa_chauffeur_manage capability (administrators have it after activation).
Note. New rates apply to new quotes and bookings only. Existing bookings keep the prices they were made with.
Request
PUT https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicles/3
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The vehicle’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
No | Must not be blank. |
slug |
string |
No | Made from the name when empty. Made unique by appending -2, -3, … |
description |
string |
No | HTML. The tags allowed in a post are kept. |
vehicle_type_id |
integer |
No | Its vehicle type. 0 or empty stores null. |
image_id |
integer |
No | Media library attachment id of the main photo. 0 or empty stores null. |
gallery |
integer[] |
No | Attachment ids of the extra photos. |
max_passengers |
integer |
No | Default 4. |
max_luggage |
integer |
No | Default 2. |
base_location_id |
integer |
No | The location it is based at. 0 or empty stores null. |
base_price |
number |
No | Fixed part of every fare. |
price_per_distance |
number |
No | Price per distance unit. |
price_per_hour |
number |
No | Price per hour. |
min_price |
number |
No | Fare floor, 0 for none. |
status |
string |
No | published or draft; anything else is saved as draft. |
display_order |
integer |
No | Default 0. |
A merge: fields you leave out keep their value. gallery replaces the whole list. modified_at and modified_by are set for you.
{
"price_per_distance": 1.95,
"min_price": 50
}
Responses
200 OK. data is the updated vehicle.
{
"success": true,
"message": "",
"data": {
"id": "3",
"language_code": null,
"translation_group": null,
"name": "Mercedes E-Class",
"slug": "mercedes-e-class",
"description": "<p>Executive sedan with leather seats and Wi-Fi.</p>",
"vehicle_type_id": "1",
"image_id": "57",
"gallery": [
58,
59
],
"max_passengers": 3,
"max_luggage": 3,
"base_location_id": null,
"base_price": 20.0,
"price_per_distance": 1.95,
"price_per_hour": 55.0,
"min_price": 50.0,
"status": "published",
"display_order": "0",
"created_at": "2026-11-12 09:30:00",
"created_by": "1",
"modified_at": "2026-11-12 10:15:00",
"modified_by": "1",
"image_url": "https://your-site.example/wp-content/uploads/2026/11/e-class-300x200.jpg"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
string |
The vehicle id, as a string |
data.vehicle_type_id |
string|null |
Its vehicle type |
data.image_id |
string|null |
Media library attachment id of the main photo |
data.image_url |
string |
Medium-size URL of the main photo. Only present when image_id is set |
data.gallery |
integer[] |
Attachment ids of the extra photos |
data.max_passengers |
integer |
Seats. The wizard only offers the vehicle to parties that fit |
data.max_luggage |
integer |
Bags |
data.base_price |
number |
Fixed part of every fare |
data.price_per_distance |
number |
Price per distance unit, doubled for a return transfer |
data.price_per_hour |
number |
Price per hour, for hourly bookings |
data.min_price |
number |
Floor for a fare. 0 means no floor |
data.status |
string |
published (offered in the wizard) or draft |
data.display_order |
string |
Position in lists |
Errors
| Status | Code | When |
|---|---|---|
404 |
rest_error |
No vehicle with that id. |
400 |
rest_error |
The body holds none of the fields below (“No fields to update.”). |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicles/3" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"price_per_distance":1.95,"min_price":50}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicles/3');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'price_per_distance' => 1.95,
'min_price' => 50,
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const response = await fetch('https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicles/3', {
method: 'PUT',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ price_per_distance: 1.95, min_price: 50 }),
});
const { data } = await response.json();
Quick Links
Share