Contents
Create Booking Form - Plugixa Chauffeur
POST /plugixa-chauffeur/v1/booking-forms
Create a booking form: the services it offers, its currency, its notice period and its look.
Needs a signed-in user with the plugixa_chauffeur_manage capability (administrators have it after activation).
Note. A form created without
statusis published, so it can take bookings as soon as its shortcode is on a page. Send"status": "draft"to create it hidden.
Request
POST https://your-site.example/wp-json/plugixa-chauffeur/v1/booking-forms
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
Yes | Must not be blank. |
slug |
string |
No | Made from the name when empty. Made unique by appending -2, -3, … |
enable_distance |
boolean |
No | Default true. |
enable_hourly |
boolean |
No | Default true. |
enable_flat |
boolean |
No | Flat-rate routes, used with Pro. Default false. |
enable_return |
boolean |
No | Default true. |
default_service_type |
string |
No | distance or hourly, plus flat with Pro. Anything else is saved as distance. Default distance. |
currency |
string |
No | A currency code such as EUR. Empty uses the site currency. Default empty. |
min_lead_time |
integer |
No | Minutes of notice, 0 or more. Default 60. |
min_passengers |
integer |
No | At least 1. Default 1. |
status |
string |
No | published; anything else is saved as draft. Default published. |
display_order |
integer |
No | Default 0. |
settings |
object |
No | require_phone (boolean) and appearance: scheme (auto, light or dark), accent, accent_text, background and card (hex colours; background also takes transparent), radius (square, rounded or xl) and border (boolean). Unknown keys and invalid values are dropped. |
{
"name": "Airport transfers",
"currency": "EUR",
"min_lead_time": 120,
"enable_hourly": true,
"settings": {
"require_phone": true,
"appearance": {
"accent": "#1D4ED8"
}
}
}
Responses
200 Created. data is the new form.
{
"success": true,
"message": "",
"data": {
"id": "1",
"name": "Airport transfers",
"slug": "airport-transfers",
"enable_distance": true,
"enable_hourly": true,
"enable_flat": false,
"enable_return": true,
"default_service_type": "distance",
"currency": "EUR",
"min_lead_time": 120,
"min_passengers": 1,
"settings": {
"require_phone": true,
"appearance": {
"scheme": "auto",
"accent": "#1d4ed8",
"accent_text": "",
"background": "",
"card": "",
"radius": "rounded",
"border": true
}
},
"status": "published",
"display_order": "0",
"created_at": "2026-11-12 09:30:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
string |
The form id, as a string. Use it in the [plugixa_chauffeur_booking_form id="1"] shortcode |
data.enable_distance |
boolean |
Offers distance bookings |
data.enable_hourly |
boolean |
Offers hourly bookings |
data.enable_flat |
boolean |
Offers flat-rate routes PRO |
data.enable_return |
boolean |
Offers return transfers |
data.default_service_type |
string |
The service the wizard starts on |
data.currency |
string |
Empty means the site currency from Settings |
data.min_lead_time |
integer |
Minutes of notice a booking needs |
data.min_passengers |
integer |
Smallest party the form accepts |
data.settings |
object |
require_phone and the wizard’s appearance |
data.status |
string |
published or draft. A draft form is not shown and cannot be booked |
data.display_order |
string |
Position in lists |
Colours come back in lower case.
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/booking-forms" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"name":"Airport transfers","currency":"EUR","min_lead_time":120,"enable_hourly":true,"settings":{"require_phone":true,"appearance":{"accent":"#1D4ED8"}}}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/booking-forms');
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' => 'Airport transfers',
'currency' => 'EUR',
'min_lead_time' => 120,
'enable_hourly' => true,
'settings' => [
'require_phone' => true,
'appearance' => [
'accent' => '#1D4ED8',
],
],
]),
]);
$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/booking-forms', {
method: 'POST',
headers: {
'Authorization': `Basic ${auth}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Airport transfers',
currency: 'EUR',
min_lead_time: 120,
enable_hourly: true,
settings: { require_phone: true, appearance: { accent: '#1D4ED8' } },
}),
});
const { data } = await response.json();
Quick Links
Share