Contents
On this page

Restore Warehouse - Plugixa Inventory

POST /plugixa-inventory/v1/warehouses/{id}/restore

Bring a trashed warehouse back.

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 warehouse.

Request

POST https://your-site.example/wp-json/plugixa-inventory/v1/warehouses/1/restore

Path parameters

Name Type Description
id integer The warehouse’s id

Responses

200 OK. The warehouse is live again.

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

Errors

Status Code When
404 plugixa_inventory_not_found No warehouse with that id, or the warehouse is not in the trash.
409 plugixa_inventory_duplicate_code Another live warehouse now uses this warehouse’s code. Rename that one first.

Plus the errors every endpoint can return.

Examples

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

Quick Links

Share