Inventory API

Inventory reports for staff and admin. All routes require Authorization: Bearer <access_token> and manage_inventory permission. Base path: <API_BASE_URL>/inventory. For product-scoped inventory (create, status, restock, logs), see Products API — Product inventory.

Low-stock, out-of-stock, needs-reorder

Each endpoint returns a list of ProductInventory records with the product relation included (id, sku, name). Only products with track_inventory enabled are considered.

GET /inventory/low-stock

Products where 0 < available_quantity ≤ low_stock_threshold. Response: {"products": [{"id", "product_id", "stock_quantity", "reserved_quantity", "available_quantity", "low_stock_threshold", "is_in_stock", "is_low_stock", "product": {"id", "sku", "name"}, ...}, ...]}.

GET /inventory/out-of-stock

Products where available_quantity = 0 (excluding backorder-eligible). Response: same shape as low-stock.

GET /inventory/needs-reorder

Products where reorder_point is set and available_quantity ≤ reorder_point. Response: same shape as low-stock, with reorder_point, reorder_quantity, needs_reorder.

Create, status, restock, logs

These endpoints live under /products. See Products API — Product inventory for:

  • POST /products/products/<product_id>/inventory — create inventory
  • GET /products/products/<product_id>/inventory — get stock status (permission: view_products)
  • POST /products/products/<product_id>/restock — restock
  • GET /products/products/<product_id>/inventory/logs — stock history

Common responses

401 if missing or invalid token. 403 if user does not have manage_inventory permission. 404 if resource not found.