Contents
Create Flat Rate Route - Plugixa Chauffeur
POST /plugixa-chauffeur/v1/routes
Create a route with a fixed price.
Needs Plugixa Chauffeur Pro with an active licence. Needs a signed-in user with the plugixa_chauffeur_manage capability (administrators have it after activation).
Request
POST https://your-site.example/wp-json/plugixa-chauffeur/v1/routes
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
Yes | Must not be blank. |
pickup_label |
string |
No | Plain text. |
dropoff_label |
string |
No | Plain text. |
price |
number |
No | The fixed fare. Default 0. |
status |
string |
No | inactive; anything else is saved as active. Default active. |
display_order |
integer |
No | Default 0. |
A booking form offers its active routes when enable_flat is on. See Flat-rate routes.
{
"name": "CDG to Paris centre",
"pickup_label": "Paris Charles de Gaulle Airport",
"dropoff_label": "Paris city centre",
"price": 75
}
Responses
200 Created. data is the new route.
{
"success": true,
"message": "",
"data": {
"id": "2",
"name": "CDG to Paris centre",
"pickup_label": "Paris Charles de Gaulle Airport",
"dropoff_label": "Paris city centre",
"price": 75.0,
"status": "active",
"display_order": "0",
"created_at": "2026-11-12 09:30:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
string |
The route id, as a string. The wizard sends it as route_id |
data.pickup_label |
string|null |
Saved as the booking’s pickup address |
data.dropoff_label |
string|null |
Saved as the booking’s drop-off address |
data.price |
number |
The fixed fare, whatever the vehicle |
data.status |
string |
active or inactive. Only active routes are offered |
data.display_order |
string |
Position in lists |
Errors
| Status | Code | When |
|---|---|---|
400 |
rest_error |
name is missing or blank (“Name is required.”). |
500 |
rest_error |
The database refused the row. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-chauffeur/v1/routes" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"name":"CDG to Paris centre","pickup_label":"Paris Charles de Gaulle Airport","dropoff_label":"Paris city centre","price":75}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/routes');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'CDG to Paris centre',
'pickup_label' => 'Paris Charles de Gaulle Airport',
'dropoff_label' => 'Paris city centre',
'price' => 75,
]),
]);
$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/routes', {
method: 'POST',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'CDG to Paris centre',
pickup_label: 'Paris Charles de Gaulle Airport',
dropoff_label: 'Paris city centre',
price: 75,
}),
});
const { data } = await response.json();
Quick Links
Share