Inventory
Stock per variant and location. Every change is written to the store's inventory history and fires inventory_levels/update.
Endpoints#
- GET
/inventory_levels.jsonList stock levels - POST
/inventory_levels/set.jsonSet a variant's stock - POST
/inventory_levels/adjust.jsonAdjust a variant's stock
Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.
List stock levels#
/inventory_levels.jsonread_inventoryOne entry per variant. available is what the online store can sell: the stock at active locations that fulfill online orders. locations lists the stock at each location the variant is kept at, in fulfillment priority order (inactive locations included).
| Parameter | Description |
|---|---|
variant_ids | Comma-separated variant ids (up to 250). |
product_ids | Comma-separated product ids. |
location_ids | Comma-separated location ids: only variants kept at one of them, listing only those locations. |
updated_at_min | Only stock changed since then, at any location. |
limit, page_info | Pagination when no ids are given. |
curl "https://store.weftgrid.com/api/admin/2026-10/inventory_levels.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"inventory_levels": [{
"variant_id": "cm2variant01",
"product_id": "cm2product01",
"sku": "STONEWARE-01",
"available": 24,
"tracked": true,
"inventory_policy": "deny",
"updated_at": "2026-10-23T09:30:00.000Z",
"locations": [
{ "location_id": "cm2location00", "available": 14 },
{ "location_id": "cm2location01", "available": 6 },
{ "location_id": "cm2location02", "available": 4 }
]
}]
}Set a variant's stock#
/inventory_levels/set.jsonwrite_inventorySets the count at a location exactly, e.g. after a stocktake. location_id defaults to the default location (the first active one). Setting a count turns quantity tracking on. The change is recorded in the inventory history with reason (default api). A bundle's stock comes from its items, so setting it is refused with 422: set its items' stock instead.
{ "variant_id": "cm2variant01", "location_id": "cm2location01", "available": 12, "reason": "correction" }curl -X POST "https://store.weftgrid.com/api/admin/2026-10/inventory_levels/set.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "variant_id": "cm2variant01", "location_id": "cm2location01", "available": 12, "reason": "correction" }'Example responseShowHide
{
"inventory_level": {
"variant_id": "cm2variant01",
"product_id": "cm2product01",
"sku": "STONEWARE-01",
"available": 24,
"tracked": true,
"inventory_policy": "deny",
"updated_at": "2026-10-23T09:30:00.000Z",
"locations": [
{ "location_id": "cm2location00", "available": 14 },
{ "location_id": "cm2location01", "available": 6 },
{ "location_id": "cm2location02", "available": 4 }
]
}
}Adjust a variant's stock#
/inventory_levels/adjust.jsonwrite_inventoryAdds (positive) or removes (negative) stock at a location relative to its current count, so concurrent sales aren't overwritten. location_id defaults to the default location. A bundle's stock comes from its items, so adjusting it is refused with 422: adjust its items' stock instead.
{ "variant_id": "cm2variant01", "location_id": "cm2location01", "available_adjustment": -2, "reason": "damaged" }curl -X POST "https://store.weftgrid.com/api/admin/2026-10/inventory_levels/adjust.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "variant_id": "cm2variant01", "location_id": "cm2location01", "available_adjustment": -2, "reason": "damaged" }'Example responseShowHide
{
"inventory_level": {
"variant_id": "cm2variant01",
"product_id": "cm2product01",
"sku": "STONEWARE-01",
"available": 24,
"tracked": true,
"inventory_policy": "deny",
"updated_at": "2026-10-23T09:30:00.000Z",
"locations": [
{ "location_id": "cm2location00", "available": 14 },
{ "location_id": "cm2location01", "available": 6 },
{ "location_id": "cm2location02", "available": 4 }
]
}
}