Contents
On this page
Update Space Type - Plugixa Car Parking
PUT /plugixa-car-parking/v1/space-types/{id}
Change some or all of a space type’s fields. PATCH does exactly the same.
The signed-in user needs the plugixa_carparking_edit capability (change records).
Note. This is a merge, not a replace: only the fields you send change, and a field you leave out keeps its value. A
slugsent empty is ignored rather than cleared.
Request
PUT https://your-site.example/wp-json/plugixa-car-parking/v1/space-types/2
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The space type’s id |
Request body
Content type: application/json
| 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. |
description |
string |
No | HTML. Only the tags allowed in WordPress post content are kept. |
icon |
string |
No | Plain text, at most 100 characters. |
color |
string |
No | Plain text, at most 20 characters. |
width |
number |
No | Not negative, at most 999999.99. Empty or null clears it. |
length |
number |
No | Same rules as width. |
dimension_unit |
string |
No | At most 10 characters. |
features |
object |
No | Replaces the whole set of key/value pairs. Values must be strings, numbers or booleans. |
display_order |
integer |
No | Position in lists. |
status |
string |
No | active or inactive. |
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. |
To change the prices, use Update Space Type Prices.
{
"status": "inactive",
"modified_at": "2026-11-12 09:30:00"
}
Responses
200 OK. data is the updated space type.
{
"success": true,
"data": {
"id": 2,
"language_code": null,
"translation_group": null,
"name": "Covered car space",
"slug": "covered-car-space",
"description": "<p>Under cover, on level -1.</p>",
"icon": "car",
"color": "#1976d2",
"width": 2.5,
"length": 5,
"dimension_unit": "m",
"features": { "covered": true },
"display_order": 1,
"status": "inactive",
"created_by": 1,
"modified_by": 1,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 10:05:00",
"deleted_at": null
}
}
| Field | Type | Meaning |
|---|---|---|
data.status |
string |
active or inactive |
data.modified_by |
integer |
WordPress user id of the caller |
data.modified_at |
string |
UTC datetime of this change |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_carparking_not_found |
No space type with that id, or it is in the trash. |
409 |
plugixa_carparking_conflict |
modified_at was sent and somebody changed the space type since. |
422 |
plugixa_carparking_missing_name |
name was sent blank. |
422 |
plugixa_carparking_invalid_choice |
status is not active or inactive. |
422 |
plugixa_carparking_not_a_number |
width or length is not a number. |
422 |
plugixa_carparking_negative_number |
width or length is negative. |
422 |
plugixa_carparking_number_too_large |
width or length is above 999999.99. |
422 |
plugixa_carparking_too_long |
A text field 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/space-types/2" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"status":"inactive","modified_at":"2026-11-12 09:30:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/space-types/2');
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([
'status' => 'inactive',
'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/space-types/2', {
method: 'PUT',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
'Content-Type': 'application/json',
},
body: JSON.stringify({ status: 'inactive', modified_at: '2026-11-12 09:30:00' }),
});
const { data } = await response.json();
Quick Links
Share