Contents
On this page

Delete Booking - Plugixa Chauffeur

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

Delete a booking 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. Deleting does not refund anything. Refund a card payment first with Refund Booking.

Request

DELETE https://your-site.example/wp-json/plugixa-chauffeur/v1/bookings/42

Path parameters

Name Type Description
id integer The booking’s id

Responses

200 Deleted. data is null.

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

Errors

Status Code When
404 rest_error No booking with that id.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixa-chauffeur/v1/bookings/42" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/bookings/42');
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/bookings/42', {
  method: 'DELETE',
  headers: {
    'Authorization': `Basic ${auth}`,
  },
});
const { data } = await response.json();

Quick Links

Share