Contents
On this page

Create Customer Group - Plugixa Car Parking

POST /plugixa-car-parking/v1/customer-groups

Create a customer group. Add users to it afterwards with Add Member. See Customer groups.

Needs Plugixa Car Parking Pro. The WordPress user needs the plugixa_carparking_create capability (create records).

Request

POST https://your-site.example/wp-json/plugixa-car-parking/v1/customer-groups

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. Tags are stripped; line breaks are kept.

Members cannot be sent here.

{
  "name": "Season ticket holders",
  "description": "Commuters on a yearly contract."
}

Responses

201 Created. data is the new customer group.

{
  "success": true,
  "data": {
    "id": 3,
    "name": "Season ticket holders",
    "slug": "season-ticket-holders",
    "description": "Commuters on a yearly contract.",
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 09:30:00",
    "deleted_at": null,
    "member_count": 12
  }
}
Field Type Meaning
data.id integer The group’s id
data.name string The group’s name
data.slug string Unique among all groups, trashed ones included
data.description string|null Plain text, or null when none was given
data.member_count integer How many users are in the group
data.created_at string UTC datetime
data.modified_at string UTC datetime of the last change. Send it back on an update to have the change refused if somebody else saved first
data.deleted_at string|null null unless the record is in the trash

Errors

Status Code When
422 plugixa_carparking_missing_name name is missing or blank.
422 plugixa_carparking_too_long A text field is longer than its column holds. data.field names it and data.max gives the limit.
500 plugixa_carparking_insert_failed The database refused the new row.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-car-parking/v1/customer-groups" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"name":"Season ticket holders","description":"Commuters on a yearly contract."}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/customer-groups');
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'        => 'Season ticket holders',
        'description' => 'Commuters on a yearly contract.',
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-car-parking/v1/customer-groups', {
  method: 'POST',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Season ticket holders', description: 'Commuters on a yearly contract.' }),
});
const { data } = await response.json();

Quick Links

Share