Contents
On this page

Create Resource - Plugixa Car Wash

POST /plugixa-carwash/v1/resources

Create a bay or mobile team.

Needs the plugixa_carwash_create capability.

Request

POST https://your-site.example/wp-json/plugixa-carwash/v1/resources

Request body

Content type: application/json

Field Type Required Description
location_id integer Yes An existing location.
type string No bay for a wash bay, mobile_team for a team that drives out. A mobile location books mobile teams, any other books bays. Defaults to bay.
name string Yes At most 190 characters.
color string No A hex colour such as #0EA5E9. Anything else is stored empty. Defaults to empty.
vehicle_type_ids array No Vehicle type ids this bay or team takes. Empty takes every type. Defaults to [].
notes string No Defaults to empty.
sort_order integer No 0 to 100000. A new booking gets the first free bay or team in this order. Defaults to 0.
status string No published or unpublished. Defaults to published.
{
  "location_id": 3,
  "type": "bay",
  "name": "Bay 1",
  "color": "#0EA5E9"
}

Responses

201 Created. data is the new bay or team.

{
  "success": true,
  "data": {
    "id": 5,
    "location_id": 3,
    "type": "bay",
    "name": "Bay 1",
    "color": "#0EA5E9",
    "vehicle_type_ids": [],
    "notes": "",
    "sort_order": 0,
    "status": "published",
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-10 08:15:00",
    "modified_at": "2026-11-12 09:30:00",
    "deleted_at": null
  }
}
Field Type Meaning
data.id integer The bay or team’s id
data.location_id integer Where it works
data.type string bay or mobile_team
data.color string Hex colour on the schedule, or empty
data.vehicle_type_ids array Vehicle types it takes. Empty means every type
data.created_at string UTC datetime
data.modified_at string UTC datetime of the last change. Send it back on an update to be warned about a conflicting edit
data.deleted_at string|null null unless the record is in the trash

Errors

Status Code When
422 plugixa_carwash_missing_name name is missing or empty.
422 plugixa_carwash_missing_location_id location_id is missing or empty.
422 plugixa_carwash_invalid_location location_id is not an existing location.
422 plugixa_carwash_too_small_{field} / too_large_{field} A number is outside its range. The code names the field.
422 plugixa_carwash_invalid_{field} A choice field has a value that is not one of its choices. The code names the field.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-carwash/v1/resources" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"location_id":3,"type":"bay","name":"Bay 1","color":"#0EA5E9"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-carwash/v1/resources');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'location_id' => 3,
        'type'        => 'bay',
        'name'        => 'Bay 1',
        'color'       => '#0EA5E9',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const response = await fetch('https://your-site.example/wp-json/plugixa-carwash/v1/resources', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ location_id: 3, type: 'bay', name: 'Bay 1', color: '#0EA5E9' }),
});
const { data } = await response.json();

Quick Links

Share