Contents
On this page
Search Cars - Plugixa Car Rental
POST /plugixa-car-rental/v1/public/search
For a rental window, list the models a visitor can book, with whether each is free and what it would cost.
Public: no sign-in and no nonce. Needs the Booking form app on. Rate limited to 120 requests an hour per visitor address: see Public routes.
Unlike the staff search, a visitor’s window must respect the booking rules: the shortest notice and the furthest horizon. A model that cannot be priced for the window is left out.
Request
POST https://your-site.example/wp-json/plugixa-car-rental/v1/public/search
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
pickup_location_id |
integer |
Yes | A published location that allows pickups. |
return_location_id |
integer |
No | A published location that allows returns. Omitted or 0: the pickup location. |
pickup_at |
string |
Yes | Local time at the pickup location: YYYY-MM-DD HH:MM, with optional seconds, a space or a T between. No time-zone offset, and a bare date is refused. |
return_at |
string |
Yes | Local time at the return location, in the same form. After pickup_at. |
extras |
object[] |
No | Extras to add, as {"id": 3, "quantity": 1}. Only published extras count, and a quantity above the extra’s max_quantity is cut to it. Needs the Extras app. |
coupon |
string |
No | A coupon code. Needs the Coupons app. |
driver_age |
integer |
No | The driver’s age, 16 to 99, for the young and senior driver surcharges and each model’s minimum age. Needs Pro with the Driver age app. |
delivery_address |
string |
No | Deliver the car to this address. Needs Pro with the Delivery and collection app. |
collection_address |
string |
No | Collect the car from this address at the end. Needs Pro with the Delivery and collection app. |
currency |
string |
No | Price in another of your currencies, by its code. Needs Pro with the Multi-currency app. Unknown codes are ignored. |
{
"pickup_location_id": 1,
"pickup_at": "2026-12-01 10:00",
"return_at": "2026-12-04 10:00",
"extras": [
{
"id": 3,
"quantity": 1
}
]
}
Responses
200 OK. data holds the window and the bookable models.
{
"success": true,
"data": {
"window": {
"pickup_location_id": 1,
"return_location_id": 1,
"pickup_at": "2026-12-01T10:00:00+01:00",
"return_at": "2026-12-04T10:00:00+01:00",
"days": 3,
"one_way": false,
"after_hours": []
},
"vehicles": [
{
"model": {
"id": 4,
"name": "Peugeot 3008",
"make": "Peugeot",
"model": "3008",
"transmission": "automatic",
"fuel": "diesel",
"seats": 5,
"doors": 5,
"bags": 3,
"air_conditioning": true,
"mileage_limit": 300,
"min_driver_age": 23,
"image_url": "https://your-site.example/wp-content/uploads/2026/11/peugeot-3008-768x512.webp",
"description": "<p>A roomy SUV with a large boot.</p>"
},
"available": true,
"quote": {
"days": 3,
"daily_rate": 65.0,
"currency": "EUR",
"line_items": [
{
"type": "rental",
"label": "Peugeot 3008, 3 days",
"quantity": 3.0,
"unit_price": 65.0,
"total": 195.0
},
{
"type": "extra",
"label": "Child seat",
"quantity": 1.0,
"unit_price": 24.0,
"total": 24.0
}
],
"subtotal": 219.0,
"discount_total": 0,
"tax_total": 0.0,
"total": 219.0,
"deposit": 800.0,
"refusal": ""
}
}
]
}
}
| Field | Type | Meaning |
|---|---|---|
data.window |
object |
The rental window as understood, with days and after_hours |
data.vehicles[].model |
object |
What a visitor may see of the model, with a medium-large image_url |
data.vehicles[].available |
boolean |
true when a car is free and nothing refused it for this request |
data.vehicles[].quote |
object |
The price: days, daily_rate, currency, line_items, subtotal, discount_total, tax_total, total, deposit, and refusal, why it cannot be booked, or empty |
Errors
| Status | Code | When |
|---|---|---|
422 |
plugixa_car_rental_unknown_location |
A location is missing, unpublished or in the trash. data.field names it. |
422 |
plugixa_car_rental_location_not_allowed |
The pickup location takes no pickups, or the return location takes no returns. |
422 |
plugixa_car_rental_invalid_datetime |
pickup_at or return_at is missing, a bare date, not a date, or a time skipped by a clock change at that location. |
422 |
plugixa_car_rental_return_before_pickup |
return_at is not after pickup_at. |
422 |
plugixa_car_rental_location_closed |
The location is closed on that day. |
422 |
plugixa_car_rental_outside_hours |
The time is outside the location’s opening hours and it charges no after-hours fee. |
422 |
plugixa_car_rental_too_short |
The rental is shorter than the shortest rental in the booking rules. |
422 |
plugixa_car_rental_too_long |
The rental is longer than the longest rental in the booking rules. data.field is return_at. |
422 |
plugixa_car_rental_too_soon |
The pickup is sooner than the shortest notice, or already past. |
422 |
plugixa_car_rental_too_far |
The pickup is further ahead than the booking horizon. |
422 |
plugixa_car_rental_driver_age_missing |
With Pro and the Driver age app: driver_age is missing or not 16 to 99. |
422 |
plugixa_car_rental_refused |
A module refused the whole request, for example a delivery address out of range. data.field names the field. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-car-rental/v1/public/search" \
-H "Content-Type: application/json" \
-d '{"pickup_location_id":1,"pickup_at":"2026-12-01 10:00","return_at":"2026-12-04 10:00","extras":[{"id":3,"quantity":1}]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/public/search');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'pickup_location_id' => 1,
'pickup_at' => '2026-12-01 10:00',
'return_at' => '2026-12-04 10:00',
'extras' => [
[
'id' => 3,
'quantity' => 1,
],
],
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-car-rental/v1/public/search', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
pickup_location_id: 1,
pickup_at: '2026-12-01 10:00',
return_at: '2026-12-04 10:00',
extras: [{ id: 3, quantity: 1 }],
}),
});
const { data } = await response.json();
Quick Links
Share