Contents
On this page
Update Booking - Plugixa Car Parking
PUT /plugixa-car-parking/v1/bookings/{id}
Change a booking’s customer details, status, dates, quantity or space. PATCH does the same.
The user needs the plugixa_carparking_edit capability.
Note. Changing the dates, the quantity or the space type does not re-price the booking.
subtotal,totaland the price lines keep the values worked out when the booking was created. Customers who move their own booking go through the reschedule route, which does re-price it.
Request
PUT https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/57
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The booking’s id |
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
force |
boolean |
false |
Save even when there is no free space for the new dates. Can also be sent in the body. |
Request body
Content type: application/json
Only the fields you send change: a field you leave out keeps its value.
| Field | Type | Required | Description |
|---|---|---|---|
status |
string |
No | One of the booking statuses. Any status other than pending removes the hold, so hold_expires_at becomes null. |
entry_datetime |
string |
No | YYYY-MM-DD, optionally followed by HH:MM or HH:MM:SS, in the site’s time zone. |
exit_datetime |
string |
No | Same format, after the entry. |
quantity |
integer |
No | At least 1. |
space_type_id |
integer |
No | At least 1. |
space_id |
integer |
No | A numbered space, or 0 to hold none. |
customer_name |
string |
No | Plain text. |
customer_email |
string |
No | Must be an e-mail address when not empty. |
customer_phone |
string |
No | Plain text. |
license_plate |
string |
No | Plain text, at most 30 characters. |
notes |
string |
No | Plain text, line breaks kept. |
vehicle |
object |
No | Replaces the vehicle details. |
billing |
object |
No | Replaces the billing details. |
meta |
object |
No | Replaces the custom answers. Answers you leave out are dropped. |
modified_at |
string |
No | The modified_at you read. When sent, the save is refused if the booking has changed since. |
payment_status and amount_paid cannot be sent: a body that contains either is refused. location_id, billing_type, the coupon and the prices cannot be changed here; values sent for them are ignored. An empty body changes nothing and answers 200.
Availability. When the booking holds space (its status is one that holds a space, pending, confirmed, paid or completed unless the settings say otherwise, and its hold has not lapsed) and the change moves it (new dates, quantity, space type or space) or makes it hold space again, the plugin checks the opening hours and the free spaces first, leaving this booking out of the count. Send force=true to skip that check. The entry is not checked against the minimum notice or the booking window, so past dates are accepted.
{
"exit_datetime": "2026-12-05 08:00",
"license_plate": "AB-123-CD",
"modified_at": "2026-11-12 10:05:00"
}
Responses
200 OK. data is the updated booking.
The booking in the same shape as Get Booking, with its price lines and custom answers.
{
"success": true,
"data": {
"id": 57,
"booking_ref": "PKG-3F9A1C",
"location_id": 3,
"space_type_id": 2,
"space_id": null,
"status": "confirmed",
"billing_type": "day",
"entry_datetime": "2026-12-01 08:00:00",
"exit_datetime": "2026-12-05 08:00:00",
"quantity": 1,
"hold_expires_at": null,
"license_plate": "AB-123-CD",
"customer_name": "Lucas Bernard",
"customer_email": "lucas@example.com",
"currency": "EUR",
"total": 37.5,
"amount_paid": 0,
"payment_status": "unpaid",
"modified_by": 1,
"modified_at": "2026-11-12 10:20:00",
"items": [],
"custom_fields": [],
"location_name": "Airport North",
"space_type_name": "Standard"
}
}
The example is shortened: the full booking comes back, as on Get Booking.
| Field | Type | Meaning |
|---|---|---|
data.exit_datetime |
string |
The new exit, in the site’s time zone |
data.total |
number |
Unchanged by a change of dates |
data.modified_at |
string |
UTC datetime of this change. Send it back on the next update to keep the conflict check |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_carparking_not_found |
No booking with that id, or the booking is in the trash. |
409 |
plugixa_carparking_conflict |
modified_at was sent and the booking has been changed since. |
422 |
plugixa_carparking_derived_field |
The body contains payment_status or amount_paid. |
422 |
plugixa_carparking_invalid_choice |
status is not one of the booking statuses. |
422 |
plugixa_carparking_invalid_date |
A date is not in the accepted format or is not a real date. |
422 |
plugixa_carparking_not_a_number |
quantity, space_type_id or space_id is not a number. |
422 |
plugixa_carparking_negative_number |
One of those numbers is negative. |
422 |
plugixa_carparking_invalid_quantity |
quantity is below 1. |
422 |
plugixa_carparking_invalid_space_type_id |
space_type_id is below 1. |
422 |
plugixa_carparking_invalid_email |
customer_email is not an e-mail address. |
422 |
plugixa_carparking_too_long |
A text field is longer than its column holds. |
422 |
invalid_range |
The change moves the booking and the exit is not after the entry. |
422 |
location_closed |
The location is closed on the new entry or exit date. |
422 |
outside_hours |
The new entry or exit time is outside the opening hours. |
409 |
no_availability |
No free space for the new dates. Send force=true to save anyway. |
409 |
busy |
Another booking for the same location was being saved at that moment. Try again. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/57" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"exit_datetime":"2026-12-05 08:00","license_plate":"AB-123-CD","modified_at":"2026-11-12 10:05:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/57');
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([
'exit_datetime' => '2026-12-05 08:00',
'license_plate' => 'AB-123-CD',
'modified_at' => '2026-11-12 10:05:00',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-car-parking/v1/bookings/57', {
method: 'PUT',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
'Content-Type': 'application/json',
},
body: JSON.stringify({
exit_datetime: '2026-12-05 08:00',
license_plate: 'AB-123-CD',
modified_at: '2026-11-12 10:05:00',
}),
});
const { data } = await response.json();
Quick Links
Share