Browse the API docs

Inventory

Stock per variant and location. Every change is written to the store's inventory history and fires inventory_levels/update.

Endpoints#

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#

GET/inventory_levels.jsonread_inventory

One 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).

Query parameters
ParameterDescription
variant_idsComma-separated variant ids (up to 250).
product_idsComma-separated product ids.
location_idsComma-separated location ids: only variants kept at one of them, listing only those locations.
updated_at_minOnly stock changed since then, at any location.
limit, page_infoPagination when no ids are given.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/inventory_levels.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "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#

POST/inventory_levels/set.jsonwrite_inventory

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

Request body
{ "variant_id": "cm2variant01", "location_id": "cm2location01", "available": 12, "reason": "correction" }
Request with curl
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 responseShow
{
  "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#

POST/inventory_levels/adjust.jsonwrite_inventory

Adds (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.

Request body
{ "variant_id": "cm2variant01", "location_id": "cm2location01", "available_adjustment": -2, "reason": "damaged" }
Request with curl
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 responseShow
{
  "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 }
    ]
  }
}