Contents
List Vehicle Units - Plugixa Car Rental
GET /plugixa-car-rental/v1/vehicle-units
List cars, one page at a time.
The user needs the plugixa_car_rental_view capability.
Request
GET https://your-site.example/wp-json/plugixa-car-rental/v1/vehicle-units?vehicle_model_id__in=4
Query parameters
This list takes the list parameters every paged list accepts. search matches plate, vin and color. orderby accepts id, plate, vin, odometer, status, created_at, modified_at.
Filters, as described in Filtering lists: status (in, ne, empty, not_empty), vehicle_model_id (in, ne, empty, not_empty), home_location_id (in, ne, empty, not_empty), created_at and modified_at (dates).
Responses
200 OK. data is one page of cars.
{
"success": true,
"data": [
{
"id": 9,
"vehicle_model_id": 4,
"plate": "AB-123-CD",
"plate_key": "AB123CD",
"vin": "VF3MCYHZRNS123456",
"color": "Grey",
"odometer": 18250,
"home_location_id": 1,
"notes": "",
"status": "published",
"created_by": 1,
"modified_by": 1,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 09:30:00",
"deleted_at": null,
"vehicle_model_name": "Peugeot 3008",
"home_location_name": "Paris Gare de Lyon"
}
],
"meta": {
"total": 4,
"pages": 1
}
}
| Field | Type | Meaning |
|---|---|---|
data[].id |
integer |
The car’s id |
data[].vehicle_model_id |
integer |
The model this car is |
data[].vehicle_model_name |
string|null |
That model’s name |
data[].plate |
string |
Licence plate, upper case, single spaces |
data[].status |
string |
published or unpublished. Only a published car is given to bookings |
data[].home_location_id |
integer|null |
The desk it is based at, or null for any desk |
data[].home_location_name |
string|null |
That location’s name |
data[].odometer |
integer |
Last known reading |
meta.total |
integer |
Vehicle Units matching the search and filters, before paging |
meta.pages |
integer |
Number of pages at this per_page |
Errors
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-car-rental/v1/vehicle-units?vehicle_model_id__in=4" \
-u "admin:$WP_APP_PASSWORD"
<?php
$query = http_build_query([
'vehicle_model_id__in' => '4',
]);
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/vehicle-units?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const query = new URLSearchParams({ vehicle_model_id__in: '4' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-car-rental/v1/vehicle-units?${query}`, {
headers: {
'Authorization': `Basic ${auth}`,
},
});
const { data, meta } = await response.json();
Quick Links
Share