Contents
On this page
Purge Item - Plugixa Inventory
DELETE /plugixa-inventory/v1/items/{id}/purge
Delete an item permanently. This cannot be undone.
The user needs the plugixa_inventory_delete capability (administrators have every inventory capability). With Pro Roles and permissions enforcing, their role must also allow deleting this item.
Note. Purging does not ask whether the item holds stock or has ledger history, and it works on a live item as well as a trashed one. The checks that stop Delete Item do not run here, so a purge can remove an item that ledger rows and stock levels still point at. Trash first, and purge only items that never held stock.
Request
DELETE https://your-site.example/wp-json/plugixa-inventory/v1/items/42/purge
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The item’s id |
Responses
200 OK. The item is gone.
{
"success": true,
"data": {
"purged": true
}
}
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_inventory_not_found |
No item with that id, live or trashed. |
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-inventory/v1/items/42/purge" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-inventory/v1/items/42/purge');
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 = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-inventory/v1/items/42/purge', {
method: 'DELETE',
headers: { 'Authorization': auth },
});
const { data } = await response.json();
Quick Links
Share