Contents
On this page
Delete Fleet Account - Plugixa Car Wash
DELETE /plugixa-carwash/v1/fleet-accounts/{id}
Move a company account to the trash. It can be restored.
Needs Plugixa Car Wash Pro with the Fleet accounts app on, and the plugixa_carwash_delete capability.
Request
DELETE https://your-site.example/wp-json/plugixa-carwash/v1/fleet-accounts/6
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The company account’s id |
Restore or delete for good
A trashed company account stays in the database and out of every list unless you ask for view=trash. Two more routes act on it, with the same plugixa_carwash_delete capability:
| Method and path | Answer | Does |
|---|---|---|
POST /plugixa-carwash/v1/fleet-accounts/{id}/restore |
{"restored": true} |
Takes the company account out of the trash. One that is not in the trash answers 404. |
DELETE /plugixa-carwash/v1/fleet-accounts/{id}/purge |
{"purged": true} |
Deletes the company account for good. It does not need the company account to be in the trash first, and it skips the in-use checks of the trash route: a live company account that other records depend on is deleted at once. |
Responses
200 OK. The company account is in the trash.
{
"success": true,
"data": {
"trashed": true
}
}
| Field | Type | Meaning |
|---|---|---|
data.trashed |
boolean |
Always true |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_carwash_not_found |
No company account with that id, or it is already in the trash. |
409 |
plugixa_carwash_in_use |
The company still owes money (unbilled or outstanding). Settle its statements first, or unpublish it. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-carwash/v1/fleet-accounts/6" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-carwash/v1/fleet-accounts/6');
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 auth = Buffer.from(`admin:${process.env.WP_APP_PASSWORD}`).toString('base64');
const response = await fetch('https://your-site.example/wp-json/plugixa-carwash/v1/fleet-accounts/6', {
method: 'DELETE',
headers: {
'Authorization': `Basic ${auth}`,
},
});
const { data } = await response.json();
Quick Links
Share