Contents
On this page

Delete Booking Form - Plugixa Car Parking

DELETE /plugixa-car-parking/v1/booking-forms/{id}

Move a booking form to the trash. A booking page that names it stops taking bookings.

The signed-in user needs the plugixa_carparking_delete capability (trash, restore and delete records).

The default form cannot be trashed: make another form the default first, with Update Booking Form.

Note. That rule guards the trash only. DELETE /booking-forms/{id}/purge deletes a form for good, the default form included, which leaves the site with no default form until you set one.

Bring a form back with POST /booking-forms/{id}/restore, or delete it for good with DELETE /booking-forms/{id}/purge: see Trash.

Request

DELETE https://your-site.example/wp-json/plugixa-car-parking/v1/booking-forms/3

Path parameters

Name Type Description
id integer The form’s id

Responses

200 OK. The form is in the trash.

{
  "success": true,
  "data": { "trashed": true }
}
Field Type Meaning
data.trashed boolean Always true on success

Errors

Status Code When
404 plugixa_carparking_not_found No form with that id, or it is already in the trash.
409 plugixa_carparking_booking_form_in_use It is the default form, or an add-on refused it through the plugixa_carparking_booking_form_delete_blockers filter.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixa-car-parking/v1/booking-forms/3" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/booking-forms/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 response = await fetch('https://your-site.example/wp-json/plugixa-car-parking/v1/booking-forms/3', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share