Contents
On this page

Delete Vehicle - Plugixa Chauffeur

DELETE /plugixa-chauffeur/v1/vehicles/{id}

Delete a vehicle for good. There is no trash and no undo.

Needs a signed-in user with both plugixa_chauffeur_manage and plugixa_chauffeur_delete: deleting is a separate grant from managing.

Note. Bookings of the vehicle are kept and still carry its vehicle_id, but their vehicle_name becomes null. To stop offering a vehicle and keep its history readable, set it to draft instead.

Request

DELETE https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicles/3

Path parameters

Name Type Description
id integer The vehicle’s id

Responses

200 Deleted. data is null.

{
  "success": true,
  "message": "Vehicle deleted.",
  "data": null
}

Errors

Status Code When
404 rest_error No vehicle with that id.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicles/3" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicles/3');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$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: 'DELETE',
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data } = await response.json();

Quick Links

Share