Contents
On this page
Update Recipient - Plugixa Inventory
PUT /plugixa-inventory/v1/recipients/{id}
Change some or all of a recipient’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 recipient.
Note. Only the fields you send change: a field you leave out keeps its stored value, so
PUTandPATCHbehave the same. Sending a field with an empty value does clear it, and a blanknameis refused.
Request
PUT https://your-site.example/wp-json/plugixa-inventory/v1/recipients/8
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The recipient’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
No | Must not be blank. At most 255 characters. |
email |
string |
No | Must be a valid address when given. |
phone |
string |
No | At most 50 characters. |
department |
string |
No | At most 100 characters. |
user_id |
integer |
No | An existing WordPress user this person is. 0 or null for none. |
notes |
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. |
{
"department": "Facilities",
"modified_at": "2026-11-12 09:30:00"
}
Responses
200 OK. data is the updated recipient.
{
"success": true,
"data": {
"id": 8,
"name": "Lucas Bernard",
"email": "lucas.bernard@example.com",
"phone": "+44 113 496 0000",
"department": "Facilities",
"user_id": null,
"notes": "",
"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.department |
string |
The new department |
data.modified_at |
string |
UTC datetime of this change |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_inventory_not_found |
No recipient 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_email |
email is not a valid address. |
422 |
plugixa_inventory_unknown_user |
user_id is not a WordPress user. |
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/recipients/8" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"department":"Facilities","modified_at":"2026-11-12 09:30:00"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-inventory/v1/recipients/8');
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([
'department' => 'Facilities',
'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/recipients/8', {
method: 'PUT',
headers: { 'Authorization': auth, 'Content-Type': 'application/json' },
body: JSON.stringify({
department: 'Facilities',
modified_at: '2026-11-12 09:30:00',
}),
});
const { data } = await response.json();
Quick Links
Share