Contents
On this page

Update Space - Plugixa Car Parking

PUT /plugixa-car-parking/v1/location-spaces/{id}

Change some of a space row’s fields. PUT and PATCH behave the same.

The user needs the plugixa_carparking_edit capability.

Only the fields you send change: this is a merge, not a replace.

Note. The identified-space rule is checked only when the request itself sends is_assigned: true. Moving an identified space to another location with location_id alone is not checked against that location’s inventory_mode.

Request

PUT https://your-site.example/wp-json/plugixa-car-parking/v1/location-spaces/31

Path parameters

Name Type Description
id integer The space row’s id

Request body

Content type: application/json

Field Type Required Description
location_id integer No A location that exists and is not in the trash.
space_type_id integer No A space type that exists and is not in the trash.
quantity integer No A number, not negative.
label string No Plain text, at most 100 characters. null clears it.
is_assigned boolean No One individually identified space PRO. Only accepted at a location whose inventory_mode identifies each space (assigned).
status string No active or inactive.
display_order integer No Sort position. Negative values become 0.
meta object No Flat map of keys to plain values. Nested values are dropped. Replaces the stored map.
modified_at string No The modified_at you read. When it no longer matches the stored one, the update is refused with 409. See edit conflicts.
{
  "quantity": 45,
  "modified_at": "2026-11-12 09:30:00"
}

Responses

200 OK. data is the updated space row.

{
  "success": true,
  "data": {
    "id": 31,
    "location_id": 4,
    "space_type_id": 2,
    "label": "Covered row A",
    "quantity": 45,
    "is_assigned": false,
    "status": "active",
    "display_order": 0,
    "meta": null,
    "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,
    "location_name": "Airport P2",
    "space_type_name": "Standard car"
  }
}
Field Type Meaning
data.quantity integer How many spaces the row stands for
data.modified_at string UTC datetime of this change

The other fields are as in Get Space.

Errors

Status Code When
404 plugixa_carparking_not_found No space row with that id, or it is in the trash.
422 plugixa_carparking_invalid_location_id location_id is missing, 0, or not a live location.
422 plugixa_carparking_invalid_space_type_id space_type_id is missing, 0, or not a live space type.
422 plugixa_carparking_not_a_number quantity is not a number.
422 plugixa_carparking_negative_number quantity is negative.
422 plugixa_carparking_invalid_choice status is not active or inactive.
400 plugixa_carparking_mode_unsupported is_assigned is true but the location does not identify each space.
422 plugixa_carparking_too_long label is longer than 100 characters.
409 plugixa_carparking_conflict modified_at does not match the stored one: somebody else changed the row.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-car-parking/v1/location-spaces/31" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"quantity":45,"modified_at":"2026-11-12 09:30:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/location-spaces/31');
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([
        'quantity'    => 45,
        '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/location-spaces/31', {
  method: 'PUT',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    quantity: 45,
    modified_at: '2026-11-12 09:30:00',
  }),
});
const { data } = await response.json();

Quick Links

Share