Contents
On this page

Update Location - Plugixa Car Parking

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

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

The user needs the plugixa_carparking_edit capability.

Note. Only the fields you send change: this is a merge, not a replace. The exception is settings: when sent, it replaces the whole map, so send back every key you want to keep.

Request

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

Path parameters

Name Type Description
id integer The location’s id

Request body

Content type: application/json

Field Type Required Description
name string No Must not be blank when sent. At most 255 characters.
slug string No Made unique by appending -2, -3, … An empty value is ignored.
description string No HTML. Tags not allowed in a post are stripped.
status string No active or inactive.
inventory_mode string No How spaces are counted: capacity, or assigned PRO, where each space is identified on its own.
default_billing_type string No The billing unit: minute, hour, day, week or month.
currency string No A currency code, at most 10 characters. Empty means the site currency.
timezone string No At most 64 characters.
address_line1, address_line2 string No At most 255 characters each.
city, state string No At most 120 characters each.
postcode string No At most 30 characters.
country string No Two-letter country code.
latitude number No From -90 to 90. Empty or null clears it.
longitude number No From -180 to 180. Empty or null clears it.
phone string No At most 50 characters.
email string No An address that is not valid is stored as empty.
image_id integer No A media library attachment id. 0 clears it.
gallery integer[] No Attachment ids. Zeros are dropped.
settings object No Flat map of option keys to plain values. Nested values are dropped. Pro modules read deposit_enable, deposit_percentage, installments_enable and installments_rolling from it.
display_order integer No Sort position.
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.

Changing inventory_mode does not touch the location’s existing spaces.

{
  "status": "inactive",
  "modified_at": "2026-11-12 09:30:00"
}

Responses

200 OK. data is the updated location.

{
  "success": true,
  "data": {
    "id": 4,
    "language_code": null,
    "translation_group": null,
    "name": "Airport P2",
    "slug": "airport-p2",
    "description": "<p>Covered parking five minutes from Terminal 2.</p>",
    "status": "inactive",
    "inventory_mode": "capacity",
    "default_billing_type": "day",
    "currency": "EUR",
    "timezone": "Europe/Paris",
    "address_line1": "12 Rue de l'Aviation",
    "address_line2": null,
    "city": "Lyon",
    "state": null,
    "postcode": "69125",
    "country": "FR",
    "latitude": 45.7256,
    "longitude": 5.0811,
    "phone": "+33 4 72 00 00 00",
    "email": "p2@example.com",
    "image_id": 88,
    "gallery": [88, 91],
    "settings": {
      "deposit_enable": true,
      "deposit_percentage": 20
    },
    "display_order": 0,
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-12 09:30:00",
    "updated_at": null,
    "modified_at": "2026-11-12 10:15:00",
    "deleted_at": null,
    "space_type_count": 2,
    "forms": [
      {
        "id": 1,
        "name": "Default booking form",
        "status": "active",
        "all_locations": true
      }
    ],
    "image_url": "https://your-site.example/wp-content/uploads/2026/11/airport-p2-300x200.jpg"
  }
}
Field Type Meaning
data.status string active or inactive
data.modified_at string UTC datetime of this change
data.modified_by integer The user who made it

The other fields are as in Get Location.

Errors

Status Code When
404 plugixa_carparking_not_found No location with that id, or it is in the trash.
422 plugixa_carparking_missing_name name is sent blank.
422 plugixa_carparking_invalid_choice status, inventory_mode or default_billing_type is not one of its values. data.allowed lists them.
422 plugixa_carparking_invalid_latitude latitude is outside -90 to 90.
422 plugixa_carparking_invalid_longitude longitude is outside -180 to 180.
422 plugixa_carparking_too_long A text field is longer than its column. data.field names it and data.max gives the limit.
409 plugixa_carparking_conflict modified_at does not match the stored one: somebody else changed the location.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-car-parking/v1/locations/4" \
  -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/locations/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([
        '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/locations/4', {
  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