Contents
On this page

Update Warehouse - Plugixa Inventory

PUT /plugixa-inventory/v1/warehouses/{id}

Change some or all of a warehouse’s fields. PATCH does the same.

The user needs the plugixa_inventory_edit capability (administrators have every inventory capability). With Pro Roles and permissions enforcing, their role must also allow editing this warehouse.

Note. Only the fields you send change: a field you leave out keeps its stored value, so PUT and PATCH behave the same. Sending a field with an empty value does clear it, and a blank name is refused.

Request

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

Path parameters

Name Type Description
id integer The warehouse’s id

Request body

Content type: application/json

Field Type Required Description
name string No Must not be blank. At most 255 characters.
code string No Turned to upper case. Letters, digits, - and _ only. Must be unique among live warehouses. At most 50 characters.
address string No HTML. Tags not allowed in a WordPress post are removed.
status string No published (the default) or unpublished.
modified_at string No The modified_at you last read. When the stored value differs, the update is refused with 409 because someone else saved in between. Leave it out to skip the check.
{
  "address": "<p>14 Harbour Road, Leeds</p>",
  "modified_at": "2026-11-12 09:30:00"
}

Responses

200 OK. data is the updated warehouse.

{
  "success": true,
  "data": {
    "id": 1,
    "code": "MAIN",
    "name": "Main warehouse",
    "address": "<p>14 Harbour Road, Leeds</p>",
    "custom_fields": null,
    "status": "published",
    "created_by": 1,
    "modified_by": 1,
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 10:15:00",
    "deleted_at": null
  }
}
Field Type Meaning
data.address string|null The new address
data.modified_at string UTC datetime of this change

Errors

Status Code When
404 plugixa_inventory_not_found No warehouse with that id, or it is in the trash.
422 plugixa_inventory_missing_name name is missing or blank.
422 plugixa_inventory_invalid_choice status is not one of the allowed values. data.allowed lists them.
422 plugixa_inventory_too_long A text field is longer than its column. data.field names it and data.max gives the limit.
422 plugixa_inventory_invalid_code code contains a character other than letters, digits, - and _.
409 plugixa_inventory_duplicate_code Another live warehouse already uses this code.
409 plugixa_inventory_conflict You sent modified_at and the record has changed since. data.expected and data.current carry both values.

Plus the errors every endpoint can return.

Examples

curl -s -X PUT "https://your-site.example/wp-json/plugixa-inventory/v1/warehouses/1" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"address":"<p>14 Harbour Road, Leeds</p>","modified_at":"2026-11-12 09:30:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-inventory/v1/warehouses/1');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'address'     => '<p>14 Harbour Road, Leeds</p>',
        'modified_at' => '2026-11-12 09:30:00',
    ]),
]);
$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', {
  method: 'PUT',
  headers: { 'Authorization': auth, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    address: '<p>14 Harbour Road, Leeds</p>',
    modified_at: '2026-11-12 09:30:00',
  }),
});
const { data } = await response.json();

Quick Links

Share