Contents
On this page
Update Pricing Rule - Plugixa Chauffeur
PUT /plugixa-chauffeur/v1/pricing-rules/{id}
Change the fields you send and keep the others.
Needs Plugixa Chauffeur Pro with an active licence. Needs a signed-in user with the plugixa_chauffeur_manage capability (administrators have it after activation).
Note.
conditionsis replaced as a whole: a condition you leave out of it is removed.
Request
PUT https://your-site.example/wp-json/plugixa-chauffeur/v1/pricing-rules/4
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The rule’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
No | Must not be blank. |
status |
string |
No | inactive; anything else is saved as active. |
priority |
integer |
No | Lower runs first. |
adjustment_type |
string |
No | set_value, increase_value, decrease_value, increase_percent or decrease_percent. Anything else is saved as increase_percent. |
adjustment_value |
number |
No | An amount in the booking currency, or a percentage. |
apply_to |
string |
No | Stored as sent; has no effect. |
stop_processing |
boolean |
No | Default false. |
display_order |
integer |
No | Default 0. |
conditions |
object |
No | Any of: service_types (distance, hourly, flat), vehicle_ids (integers), days_of_week (0 Sunday to 6 Saturday), date_from and date_to (YYYY-MM-DD, both included), min_distance and max_distance (above 0), min_passengers and max_passengers (above 0). Other keys and empty values are dropped. |
A merge at the top level: fields you leave out keep their value. Changes apply to the next quote; existing bookings keep their price.
{
"adjustment_value": 20,
"conditions": {
"days_of_week": [
0,
6
],
"min_distance": 10
}
}
Responses
200 OK. data is the updated rule.
{
"success": true,
"message": "",
"data": {
"id": "4",
"name": "Weekend surcharge",
"status": "active",
"priority": 10,
"conditions": {
"days_of_week": [
0,
6
],
"min_distance": 10.0
},
"adjustment_type": "increase_percent",
"adjustment_value": 20.0,
"apply_to": "total",
"stop_processing": false,
"display_order": 0,
"created_at": "2026-11-12 09:30:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
string |
The rule id, as a string |
data.status |
string |
active or inactive. Only active rules run |
data.priority |
integer |
Lower runs first |
data.conditions |
object|array |
What a trip must match. An empty [] when the rule has no conditions |
data.adjustment_type |
string |
set_value, increase_value, decrease_value, increase_percent or decrease_percent |
data.adjustment_value |
number |
The amount or the percentage |
data.apply_to |
string |
Stored, but the rule engine does not read it: rules always change the total |
data.stop_processing |
boolean |
When the rule matches, no later rule runs |
data.display_order |
integer |
Tie-breaker after priority |
Errors
| Status | Code | When |
|---|---|---|
404 |
rest_error |
No pricing rule with that id. |
400 |
rest_error |
The body holds none of the fields below (“No fields to update.”). |
Plus the errors every endpoint can return.
Examples
curl -s -X PUT "https://your-site.example/wp-json/plugixa-chauffeur/v1/pricing-rules/4" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"adjustment_value":20,"conditions":{"days_of_week":[0,6],"min_distance":10}}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/pricing-rules/4');
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([
'adjustment_value' => 20,
'conditions' => [
'days_of_week' => [0, 6],
'min_distance' => 10,
],
]),
]);
$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-chauffeur/v1/pricing-rules/4', {
method: 'PUT',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
adjustment_value: 20,
conditions: { days_of_week: [0, 6], min_distance: 10 },
}),
});
const { data } = await response.json();
Quick Links
Share