Contents
On this page

Delete Customer Group - Plugixa Car Parking

DELETE /plugixa-car-parking/v1/customer-groups/{id}

Move a customer group to the trash. Its members are kept, but while it is in the trash no pricing rule treats them as members of it. Deleting it for good also removes its memberships.

Needs Plugixa Car Parking Pro. The WordPress user needs the plugixa_carparking_delete capability (delete records).

A trashed customer group is brought back with POST /customer-groups/{id}/restore and deleted for good with DELETE /customer-groups/{id}/purge: see Trash.

Request

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

Path parameters

Name Type Description
id integer The customer group’s id

Responses

200 OK. The customer group is in the trash.

{
  "success": true,
  "data": {
    "trashed": true
  }
}
Field Type Meaning
data.trashed boolean Always true

Errors

Status Code When
404 plugixa_carparking_not_found No customer group with that id, or it is already in the trash. Also returned when a site filter refuses the delete.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixa-car-parking/v1/customer-groups/3" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-car-parking/v1/customer-groups/3');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$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/3', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share