Contents
On this page

Create Vehicle - Plugixa Chauffeur

POST /plugixa-chauffeur/v1/vehicles

Add a vehicle with its capacity and rates.

Needs a signed-in user with the plugixa_chauffeur_manage capability (administrators have it after activation).

Note. A vehicle is created as a draft unless you send "status": "published". Drafts are never quoted or bookable in the wizard.

Request

POST https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicles

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, …
description string No HTML. The tags allowed in a post are kept.
vehicle_type_id integer No Its vehicle type. 0 or empty stores null.
image_id integer No Media library attachment id of the main photo. 0 or empty stores null.
gallery integer[] No Attachment ids of the extra photos.
max_passengers integer No Default 4.
max_luggage integer No Default 2.
base_location_id integer No The location it is based at. 0 or empty stores null.
base_price number No Fixed part of every fare. Default 0.
price_per_distance number No Price per distance unit. Default 0.
price_per_hour number No Price per hour. Default 0.
min_price number No Fare floor, 0 for none. Default 0.
status string No published or draft; anything else is saved as draft. Default draft.
display_order integer No Default 0.

How the rates make a fare is explained in Pricing.

{
  "name": "Mercedes E-Class",
  "description": "<p>Executive sedan with leather seats and Wi-Fi.</p>",
  "vehicle_type_id": 1,
  "image_id": 57,
  "gallery": [
    58,
    59
  ],
  "max_passengers": 3,
  "max_luggage": 3,
  "base_price": 20,
  "price_per_distance": 1.8,
  "price_per_hour": 55,
  "min_price": 45,
  "status": "published"
}

Responses

200 Created. data is the new vehicle.

{
  "success": true,
  "message": "",
  "data": {
    "id": "3",
    "language_code": null,
    "translation_group": null,
    "name": "Mercedes E-Class",
    "slug": "mercedes-e-class",
    "description": "<p>Executive sedan with leather seats and Wi-Fi.</p>",
    "vehicle_type_id": "1",
    "image_id": "57",
    "gallery": [
      58,
      59
    ],
    "max_passengers": 3,
    "max_luggage": 3,
    "base_location_id": null,
    "base_price": 20.0,
    "price_per_distance": 1.8,
    "price_per_hour": 55.0,
    "min_price": 45.0,
    "status": "published",
    "display_order": "0",
    "created_at": "2026-11-12 09:30:00",
    "created_by": "1",
    "modified_at": "2026-11-12 09:30:00",
    "modified_by": "1",
    "image_url": "https://your-site.example/wp-content/uploads/2026/11/e-class-300x200.jpg"
  }
}
Field Type Meaning
data.id string The vehicle id, as a string
data.vehicle_type_id string|null Its vehicle type
data.image_id string|null Media library attachment id of the main photo
data.image_url string Medium-size URL of the main photo. Only present when image_id is set
data.gallery integer[] Attachment ids of the extra photos
data.max_passengers integer Seats. The wizard only offers the vehicle to parties that fit
data.max_luggage integer Bags
data.base_price number Fixed part of every fare
data.price_per_distance number Price per distance unit, doubled for a return transfer
data.price_per_hour number Price per hour, for hourly bookings
data.min_price number Floor for a fare. 0 means no floor
data.status string published (offered in the wizard) or draft
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/vehicles" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"name":"Mercedes E-Class","description":"<p>Executive sedan with leather seats and Wi-Fi.</p>","vehicle_type_id":1,"image_id":57,"gallery":[58,59],"max_passengers":3,"max_luggage":3,"base_price":20,"price_per_distance":1.8,"price_per_hour":55,"min_price":45,"status":"published"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicles');
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'               => 'Mercedes E-Class',
        'description'        => '<p>Executive sedan with leather seats and Wi-Fi.</p>',
        'vehicle_type_id'    => 1,
        'image_id'           => 57,
        'gallery'            => [58, 59],
        'max_passengers'     => 3,
        'max_luggage'        => 3,
        'base_price'         => 20,
        'price_per_distance' => 1.8,
        'price_per_hour'     => 55,
        'min_price'          => 45,
        'status'             => 'published',
    ]),
]);
$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/vehicles', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Mercedes E-Class',
    description: '<p>Executive sedan with leather seats and Wi-Fi.</p>',
    vehicle_type_id: 1,
    image_id: 57,
    gallery: [58, 59],
    max_passengers: 3,
    max_luggage: 3,
    base_price: 20,
    price_per_distance: 1.8,
    price_per_hour: 55,
    min_price: 45,
    status: 'published',
  }),
});
const { data } = await response.json();

Quick Links

Share