Contents
On this page
Update Extra - Plugixa Car Parking
PUT /plugixa-car-parking/v1/booking-extras/{id}
Change an extra’s fields. PATCH is accepted too and behaves the same.
Needs Plugixa Car Parking Pro. The WordPress user needs the plugixa_carparking_edit capability (change records).
Note. Only the fields you send change: anything left out keeps its stored value.
applies_to, though, is replaced as a whole: send the full list of locations.
Request
PUT https://your-site.example/wp-json/plugixa-car-parking/v1/booking-extras/4
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The extra’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
No | Must not be blank. |
price |
number |
No | Zero or more. |
price_type |
string |
No | What the price is multiplied by: per_booking (nothing), per_day (days of the stay), per_hour (hours of the stay) or per_unit (spaces booked). Empty leaves it unchanged. |
max_quantity |
integer |
No | Zero or more. 0 means no limit. |
status |
string |
No | active or inactive. Empty leaves it unchanged. |
description |
string |
No | HTML. Tags not allowed in a post are stripped. |
icon |
string |
No | Plain text, up to 100 characters. |
applies_to |
object|null |
No | {"locations": [2, 5]} to offer the extra only at those locations. null, an empty string or an empty list means every location. |
display_order |
integer |
No | May be negative. |
Sending price or max_quantity as null or an empty string stores 0.
{
"price": 14,
"applies_to": null
}
Responses
200 OK. data is the updated extra.
{
"success": true,
"data": {
"id": 4,
"name": "EV charging",
"description": "<p>Charge your car while it is parked.</p>",
"icon": null,
"price": 14.0,
"price_type": "per_day",
"max_quantity": 1,
"applies_to": null,
"status": "active",
"display_order": 0,
"created_by": 1,
"modified_by": 1,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 10:15:00",
"deleted_at": null
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The extra’s id |
data.name |
string |
Shown to the customer on the booking form |
data.price |
number |
The price, before price_type multiplies it |
data.price_type |
string |
per_booking, per_day, per_hour or per_unit |
data.max_quantity |
integer |
Most a customer can take on one booking. 0 means no limit |
data.status |
string |
active or inactive |
data.description |
string|null |
HTML, or null when none was given |
data.icon |
string|null |
As stored, or null when none was given |
data.applies_to |
object|null |
{"locations": [ids]} when the extra is offered only at those locations, null when it is offered everywhere |
data.display_order |
integer |
Lower numbers are listed first on the booking form |
data.created_at |
string |
UTC datetime |
data.modified_at |
string |
UTC datetime of the last change. Send it back on an update to have the change refused if somebody else saved first |
data.deleted_at |
string|null |
null unless the record is in the trash |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_carparking_not_found |
No extra with that id, or it is in the trash. |
409 |
plugixa_carparking_conflict |
You sent modified_at and the stored record has changed since: somebody else saved first. |
422 |
plugixa_carparking_missing_name |
name is sent blank. |
422 |
plugixa_carparking_invalid_choice |
status or price_type is not one of the accepted values. data.allowed lists them. |
422 |
plugixa_carparking_not_a_number |
price, max_quantity or display_order is not a number. Use a dot for decimals. |
422 |
plugixa_carparking_number_too_large |
A number is larger than 99999999. |
422 |
plugixa_carparking_negative_number |
price or max_quantity is negative. |
422 |
plugixa_carparking_invalid_scope |
applies_to is not an object whose locations is a list of location ids. |
422 |
plugixa_carparking_too_long |
A text field is longer than its column holds. data.field names it and data.max gives the limit. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-car-parking/v1/booking-extras/4" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"price":14,"applies_to":null}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/booking-extras/4');
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' => 14,
'applies_to' => null,
]),
]);
$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-extras/4', {
method: 'PUT',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
'Content-Type': 'application/json',
},
body: JSON.stringify({ price: 14, applies_to: null }),
});
const { data } = await response.json();
Quick Links
Share