Contents
On this page

Delete Stock Movement - Plugixa Inventory

DELETE /plugixa-inventory/v1/stock-movements/{id}

Move a draft stock movement to the trash.

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 stock movement.

Only drafts can be deleted. A finalized document is part of the stock audit trail and stays.

Request

DELETE https://your-site.example/wp-json/plugixa-inventory/v1/stock-movements/57

Path parameters

Name Type Description
id integer The stock movement’s id

Responses

200 OK. The draft is in the trash.

{
  "success": true,
  "data": {
    "trashed": true
  }
}

Errors

Status Code When
404 plugixa_inventory_not_found No document with that id, or it is already in the trash.
409 plugixa_inventory_document_finalized The document is finalized.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixa-inventory/v1/stock-movements/57" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-inventory/v1/stock-movements/57');
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/stock-movements/57', {
  method: 'DELETE',
  headers: { 'Authorization': auth },
});
const { data } = await response.json();

Quick Links

Share