Contents
On this page
Update Booking Form - Plugixa Car Parking
PUT /plugixa-car-parking/v1/booking-forms/{id}
Change some or all of a booking form. PATCH does exactly the same.
The signed-in user needs the plugixa_carparking_edit capability (change records).
Note. Top-level fields merge: only what you send changes. But
steps,fields,style,location_idsandspace_type_idseach replace their whole list or object when sent: send every step or question you want to keep, not only the changed one.fieldsreplaces the questions and keeps any other stored setting.
Request
PUT https://your-site.example/wp-json/plugixa-car-parking/v1/booking-forms/3
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The form’s id |
Request body
Content type: application/json
The fields of Create Booking Form, all optional, with the same rules and the same steps and fields formats:
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
No | Must not be blank when sent. |
slug |
string |
No | Made unique by appending -2, -3, … An empty value is ignored. |
status |
string |
No | active or inactive. The default form cannot be made inactive. |
is_default |
boolean |
No | true makes this the default and takes the flag off every other form. false on the current default is refused: make another form the default instead. |
location_ids |
array |
No | Replaces the list. Empty means every location. |
all_locations |
boolean |
No | true offers every location. false keeps the stored list (or the one sent) and refuses an empty one. |
space_type_ids |
array |
No | Replaces the list. Empty means every space type. |
steps |
array |
No | Replaces every step. |
fields |
array |
No | Replaces every extra question. |
style |
object |
No | Replaces primary_color and design; one left out goes back to its default. |
settings |
object |
No | PRO settings.map (boolean). Any other key is ignored. |
modified_at |
string |
No | The modified_at you read. When it no longer matches the stored one, the update is refused with 409. Leave it out to skip the check. |
{
"is_default": true,
"modified_at": "2026-11-12 09:30:00"
}
Responses
200 OK. data is the updated form.
{
"success": true,
"data": {
"id": 3,
"name": "Airport parking",
"slug": "airport-parking",
"status": "active",
"steps": [
{ "key": "dates", "enabled": true, "options": [] },
{ "key": "space", "enabled": true, "options": { "coupon": false } },
{ "key": "details", "enabled": true, "options": [] },
{ "key": "confirm", "enabled": true, "options": [] }
],
"style": { "primary_color": "#0f766e", "design": "split" },
"location_ids": [4],
"space_type_ids": null,
"is_default": true,
"settings": {
"fields": [
{ "key": "flight_number", "label": "Flight number", "type": "text", "required": true, "options": [] }
]
},
"created_by": 1,
"modified_by": 1,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 10:20:00",
"deleted_at": null,
"fields": [
{ "key": "flight_number", "label": "Flight number", "type": "text", "required": true, "options": [] }
],
"all_locations": false,
"location_names": ["Terminal 2"],
"space_type_names": []
}
}
| Field | Type | Meaning |
|---|---|---|
data.is_default |
boolean |
Whether this is the default form |
data.steps |
array |
The steps as now stored |
data.fields |
array |
The extra questions as now stored |
data.modified_at |
string |
UTC datetime of this change |
Making a form the default changes the other forms’ is_default without changing their modified_at.
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_carparking_not_found |
No form with that id, or it is in the trash. |
409 |
plugixa_carparking_conflict |
modified_at was sent and somebody changed the form since. |
422 |
plugixa_carparking_missing_name |
name was sent blank. |
422 |
plugixa_carparking_invalid_choice |
status, a step key or a question type is not allowed. data.line gives the step’s or question’s position from 1. |
422 |
plugixa_carparking_no_locations |
all_locations is false and no location is chosen. |
422 |
plugixa_carparking_unknown_scope |
An id in location_ids or space_type_ids is not a live location or space type. |
422 |
plugixa_carparking_default_form |
is_default: false on the default form, or the default form made inactive. |
422 |
plugixa_carparking_too_long |
name or slug is longer than its column holds. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-car-parking/v1/booking-forms/3" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"is_default":true,"modified_at":"2026-11-12 09:30:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/booking-forms/3');
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([
'is_default' => true,
'modified_at' => '2026-11-12 09:30: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/booking-forms/3', {
method: 'PUT',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
'Content-Type': 'application/json',
},
body: JSON.stringify({ is_default: true, modified_at: '2026-11-12 09:30:00' }),
});
const { data } = await response.json();
Quick Links
Share