Contents
On this page

Create Vehicle Type - Plugixa Chauffeur

POST /plugixa-chauffeur/v1/vehicle-types

Create a vehicle type, such as a sedan, a van or a limousine.

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/vehicle-types

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 Plain text, line breaks kept.
image_id integer No Attachment id of an image. 0 or empty stores null.
display_order integer No Default 0.
language_code string No Language of this entry, for multilingual sites. Can only be set on create.
translation_group string No Groups the translations of one type. Can only be set on create.
{
  "name": "Executive sedan",
  "description": "Up to 3 passengers with luggage."
}

Responses

200 Created. data is the new type.

{
  "success": true,
  "message": "",
  "data": {
    "id": "1",
    "language_code": "",
    "translation_group": "",
    "name": "Executive sedan",
    "slug": "executive-sedan",
    "description": "Up to 3 passengers with luggage.",
    "image_id": null,
    "display_order": "0",
    "created_at": "2026-11-12 09:30:00"
  }
}
Field Type Meaning
data.id string The type id, as a string
data.description string Plain text
data.image_id string|null Attachment id of its image
data.image_url string URL of the image. Only present when image_id is set
data.display_order string Position in lists
data.language_code string|null Language of this entry on a multilingual site
data.translation_group string|null Links the translations of one type

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/vehicle-types" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"name":"Executive sedan","description":"Up to 3 passengers with luggage."}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-chauffeur/v1/vehicle-types');
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'        => 'Executive sedan',
        'description' => 'Up to 3 passengers with luggage.',
    ]),
]);
$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/vehicle-types', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${auth}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Executive sedan',
    description: 'Up to 3 passengers with luggage.',
  }),
});
const { data } = await response.json();

Quick Links

Share