Contents
On this page

Update Exception - Plugixa Car Parking

PUT /plugixa-car-parking/v1/locations/{id}/exceptions/{exception_id}

Change some of an exception’s fields. PUT and PATCH behave the same.

The user needs the plugixa_carparking_edit capability.

Only the fields you send change. The dates are checked again together with the stored ones, so moving start_date past the stored end_date is refused.

Request

PUT https://your-site.example/wp-json/plugixa-car-parking/v1/locations/4/exceptions/8

Path parameters

Name Type Description
id integer The location’s id
exception_id integer The exception’s id

Request body

Content type: application/json

Field Type Required Description
type string No closed or special.
start_date string No YYYY-MM-DD. Any other form counts as missing.
end_date string No YYYY-MM-DD, on or after start_date.
open_time string No For special. HH:MM or HH:MM:SS. Anything else is stored as null.
close_time string No For special. Same form.
note string No Plain text.
{
  "close_time": "16:00"
}

Responses

200 OK. data is the updated exception.

{
  "success": true,
  "data": {
    "id": 8,
    "location_id": 4,
    "type": "special",
    "start_date": "2026-12-31",
    "end_date": "2026-12-31",
    "open_time": "08:00:00",
    "close_time": "16:00:00",
    "note": "New Year's Eve"
  }
}
Field Type Meaning
data.id integer The exception’s id
data.location_id integer The location
data.type string closed (closed all day) or special (open with other hours)
data.start_date string First date, YYYY-MM-DD
data.end_date string Last date, YYYY-MM-DD, included
data.open_time string|null For special: opening time, HH:MM:SS. null means no opening limit
data.close_time string|null For special: closing time. null means no closing limit
data.note string|null Your note

Errors

Status Code When
404 plugixa_carparking_not_found No exception with that id at this location.
422 plugixa_carparking_invalid_choice type is not closed or special.
422 plugixa_carparking_missing_dates start_date or end_date is missing or not in YYYY-MM-DD form.
422 plugixa_carparking_invalid_range end_date is before start_date.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-car-parking/v1/locations/4/exceptions/8" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"close_time":"16:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/locations/4/exceptions/8');
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([
        'close_time' => '16: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/locations/4/exceptions/8', {
  method: 'PUT',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    close_time: '16:00',
  }),
});
const { data } = await response.json();

Quick Links

Share