Contents
On this page
Update Inspection - Plugixa Car Rental
PUT /plugixa-car-rental/v1/bookings/{id}/inspections/{kind}
Save the draft of a pickup or return inspection: odometer, fuel, damage, photos and notes.
Needs Plugixa Car Rental Pro with the Inspections app on. The user needs the plugixa_car_rental_edit capability.
A pickup inspection can be saved while the booking is confirmed or picked_up; a return inspection while it is picked_up or returned. Once signed, an inspection cannot change.
Request
PUT https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/inspections/pickup
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The booking’s id |
kind |
string |
pickup or return |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
odometer |
integer |
No | Whole number, 0 to 9999999. null or empty clears it. On a return inspection, not below the pickup reading. |
fuel |
integer |
No | Eighths of a tank, 0 to 8. null or empty clears it. |
damage |
object[] |
No | Replaces the whole list. Each entry: zone (front_bumper, hood, windshield, roof, rear_window, trunk, rear_bumper, front_left, rear_left, front_right, rear_right, wheel_front_left, wheel_front_right, wheel_rear_left, wheel_rear_right, interior), kind (scratch, dent, chip, crack, missing, stain, other), note (up to 500 characters) and photo_ids. At most 100 entries. |
photo_ids |
integer[] |
No | Images in the media library. Ids that are not images are dropped; at most 30 are kept. |
notes |
string |
No | Plain text, up to 5000 characters. |
Fields you leave out keep their saved value. Photos are uploaded to the media library first, then named here by id.
{
"odometer": 18250,
"fuel": 8,
"damage": [
{
"zone": "rear_bumper",
"kind": "scratch",
"note": "Light scratch, left corner.",
"photo_ids": [
61
]
}
]
}
Responses
200 OK. data is the inspection as saved.
{
"success": true,
"data": {
"photo_urls": {
"61": "https://your-site.example/wp-content/uploads/2026/12/bumper-150x150.webp"
},
"id": 4,
"kind": "pickup",
"odometer": 18250,
"fuel": 8,
"damage": [
{
"zone": "rear_bumper",
"kind": "scratch",
"note": "Light scratch, left corner.",
"photo_ids": [
61
],
"new": false
}
],
"photo_ids": [],
"notes": "",
"status": "draft",
"signer_name": "",
"signed_at": null,
"contract_hash": ""
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
integer |
The inspection’s id, 0 while none has been saved |
data.kind |
string |
pickup or return |
data.odometer |
integer|null |
Reading |
data.fuel |
integer|null |
Fuel level in eighths of a tank, 0 empty to 8 full |
data.damage |
object[] |
Each: zone, kind, note, photo_ids, and new, true on a return inspection for damage the pickup inspection did not record |
data.photo_ids |
integer[] |
Photos of the car, as media library ids |
data.photo_urls |
object |
Thumbnail address of every photo named, keyed by id |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_car_rental_not_found |
No booking with that id, or it is in the trash. |
409 |
plugixa_car_rental_inspection |
The booking is not in a status where this inspection is made, or the inspection is already signed. |
422 |
plugixa_car_rental_invalid |
A value is out of range, a damage entry names an unknown zone or kind, there are more than 100 entries, or the return odometer is below the pickup one. data.field names the field. |
500 |
plugixa_car_rental_inspection |
The inspection could not be saved. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/inspections/pickup" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"odometer":18250,"fuel":8,"damage":[{"zone":"rear_bumper","kind":"scratch","note":"Light scratch, left corner.","photo_ids":[61]}]}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/bookings/128/inspections/pickup');
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([
'odometer' => 18250,
'fuel' => 8,
'damage' => [
[
'zone' => 'rear_bumper',
'kind' => 'scratch',
'note' => 'Light scratch, left corner.',
'photo_ids' => [61],
],
],
]),
]);
$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-car-rental/v1/bookings/128/inspections/pickup', {
method: 'PUT',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
odometer: 18250,
fuel: 8,
damage: [
{
zone: 'rear_bumper',
kind: 'scratch',
note: 'Light scratch, left corner.',
photo_ids: [61],
},
],
}),
});
const { data } = await response.json();
Quick Links
Share