Contents
On this page

Create Driver - Plugixa Chauffeur

POST /plugixa-chauffeur/v1/drivers

Add a driver you can then assign to bookings.

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/drivers

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, …
email string No Characters not allowed in an e-mail address are removed.
phone string No Plain text.
photo_id integer No Attachment id of a photo. 0 or empty stores null.
bio string No Plain text, line breaks kept.
status string No active or inactive; anything else is saved as active. Default active.
display_order integer No Default 0.

Assign the driver to a booking with Update Booking and driver_id.

{
  "name": "Thomas Leroy",
  "email": "thomas.leroy@example.com",
  "phone": "+33 6 98 76 54 32",
  "bio": "Ten years of airport and event transfers."
}

Responses

200 Created. data is the new driver.

{
  "success": true,
  "message": "",
  "data": {
    "id": "2",
    "language_code": null,
    "translation_group": null,
    "name": "Thomas Leroy",
    "slug": "thomas-leroy",
    "email": "thomas.leroy@example.com",
    "phone": "+33 6 98 76 54 32",
    "photo_id": null,
    "bio": "Ten years of airport and event transfers.",
    "status": "active",
    "display_order": "0",
    "created_at": "2026-11-12 09:30:00"
  }
}
Field Type Meaning
data.id string The driver id, as a string. Use it as a booking’s driver_id
data.email string E-mail address
data.phone string Phone number
data.photo_id string|null Attachment id of the photo
data.photo_url string URL of the photo. Only present when photo_id is set
data.bio string Plain text
data.status string active or inactive
data.display_order string Position in lists

Ids and the columns this endpoint does not convert come back as strings, exactly as the database returns them: compare them as strings or convert them.

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/drivers" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"name":"Thomas Leroy","email":"thomas.leroy@example.com","phone":"+33 6 98 76 54 32","bio":"Ten years of airport and event transfers."}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/drivers');
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'  => 'Thomas Leroy',
        'email' => 'thomas.leroy@example.com',
        'phone' => '+33 6 98 76 54 32',
        'bio'   => 'Ten years of airport and event transfers.',
    ]),
]);
$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/drivers', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Thomas Leroy',
    email: 'thomas.leroy@example.com',
    phone: '+33 6 98 76 54 32',
    bio: 'Ten years of airport and event transfers.',
  }),
});
const { data } = await response.json();

Quick Links

Share