Contents
On this page
Look Up a Code - Plugixa Inventory
GET /plugixa-inventory/v1/lookup
Find one item from a scanned or typed code: an exact barcode, SKU or serial number.
The user needs the plugixa_inventory_view capability (administrators have every inventory capability). With Pro Roles and permissions enforcing, their role must also allow reading items. Needs the Scanner and quick search app on in Plugixa Inventory -> App Manager; with it off, this route answers 404.
A miss is
200, not404. An unknown code answersfound: false, so a scanning loop never confuses a network failure with an unknown item.
Request
GET https://your-site.example/wp-json/plugixa-inventory/v1/lookup?code=3045140105502
Query parameters
| Name | Type | Default | Description |
|---|---|---|---|
code |
string |
Required. Compared exactly with the barcode, then the SKU, then the serial number. The first match wins. |
Only published items are found.
Responses
200 OK. data says whether the code matched.
{
"success": true,
"data": {
"found": true,
"matched": "barcode",
"item": {
"id": 42,
"name": "Printer paper A4",
"sku": "PAP-A4",
"barcode": "3045140105502",
"serial_number": "",
"item_type": "consumable",
"category_id": 3,
"default_warehouse_id": 1,
"unit_id": null,
"image_id": null,
"stock_quantity": 120.0,
"reorder_level": 20.0,
"unit_price": 6.9,
"cost_price": 4.2,
"weight": 2.5,
"weight_unit": "kg",
"weight_base": 2.5,
"track_weight": false,
"status": "published",
"description": "",
"custom_fields": null,
"assigned_user_id": null,
"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,
"stock_levels": {
"1": 80.0,
"2": 40.0
},
"on_hand": 120.0
}
}
}
| Field | Type | Meaning |
|---|---|---|
data.found |
boolean |
Whether an item matched |
data.matched |
string|null |
barcode, sku or serial_number: which field matched |
data.item |
object|null |
The item as stored, with no image URLs or names |
data.item.stock_levels |
object |
On hand by warehouse id. An empty list ([]) when the item has none |
data.item.on_hand |
number |
Total on hand |
A miss:
{
"success": true,
"data": { "found": false, "matched": null, "item": null }
}
Errors
| Status | Code | When |
|---|---|---|
400 |
rest_missing_callback_param |
code is missing. |
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-inventory/v1/lookup?code=3045140105502" \
-u "admin:$WP_APP_PASSWORD"
<?php
$query = http_build_query(['code' => '3045140105502']);
$ch = curl_init('https://your-site.example/wp-json/plugixa-inventory/v1/lookup?' . $query);
curl_setopt_array($ch, [
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 query = new URLSearchParams({ code: '3045140105502' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-inventory/v1/lookup?${query}`, {
headers: { 'Authorization': auth },
});
const { data } = await response.json();
Quick Links
Share