Contents
On this page
Update Extra - Plugixa Car Rental
PUT /plugixa-car-rental/v1/extras/{id}
Change an extra. Only the fields you send are changed; PATCH works the same way.
Needs the Extras app on. The user needs the plugixa_car_rental_edit capability.
Note. A new price applies to new quotes and bookings only. Bookings already made keep the lines they were priced with.
Request
PUT https://your-site.example/wp-json/plugixa-car-rental/v1/extras/3
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The extra’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
No | Must not be blank. |
price |
number |
No | Not negative. Rounded to 2 decimals. |
price_type |
string |
No | per_day or per_rental. |
max_total |
number |
No | For a per-day extra, the most it costs for one rental. 0 for no cap. When set, at least price. |
max_quantity |
integer |
No | 1 to 20. |
description |
string |
No | Plain text. |
sort_order |
integer |
No | Position in lists, lowest first. May be negative. |
status |
string |
No | published or unpublished. |
modified_at |
string |
No | The modified_at you read. When it differs from the stored one the update is refused with 409. See Edit conflicts. |
Fields you leave out keep their stored value. The whole extra, as it would be after the change, is checked again.
{
"price": 9,
"modified_at": "2026-11-12 09:30:00"
}
Responses
200 OK. data is the extra as it now is.
{
"success": true,
"data": {
"id": 3,
"name": "Child seat",
"description": "For children from 9 to 18 kg.",
"price": 9.0,
"price_type": "per_day",
"max_total": 40.0,
"max_quantity": 2,
"sort_order": 0,
"status": "published",
"created_by": 1,
"modified_by": 1,
"created_at": "2026-11-12 09:30:00",
"modified_at": "2026-11-12 10:15:00",
"deleted_at": null
}
}
| Field | Type | Meaning |
|---|---|---|
data.price |
number |
Price per day or per rental |
data.modified_at |
string |
UTC datetime of this change |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_car_rental_not_found |
No extra with that id, or it is in the trash. |
422 |
plugixa_car_rental_invalid |
name is blank, price or max_total is negative, max_quantity is outside 1 to 20, or max_total is below price. data.field names the field. |
422 |
plugixa_car_rental_invalid_choice |
status or price_type is not one of its values. data.allowed lists them. |
422 |
plugixa_car_rental_not_a_number |
A number field was sent as something else. data.field names it. |
422 |
plugixa_car_rental_negative_number |
A number field that cannot be negative is. data.field names it. |
422 |
plugixa_car_rental_too_long |
A text field is longer than its column. data.field names it and data.max gives the limit. |
409 |
plugixa_car_rental_conflict |
You sent modified_at and the extra has been saved by someone else since. data.expected and data.current carry both values. |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-car-rental/v1/extras/3" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"price":9,"modified_at":"2026-11-12 09:30:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-rental/v1/extras/3');
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([
'price' => 9,
'modified_at' => '2026-11-12 09:30:00',
]),
]);
$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/extras/3', {
method: 'PUT',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ price: 9, modified_at: '2026-11-12 09:30:00' }),
});
const { data } = await response.json();
Quick Links
Share