Skip to main content
All endpoints require an Authorization: Bearer <token> header.

Endpoint

PUT /api/inventory/:id
It is recommended to use stock movements (POST /api/stock-movements) to update quantities. That approach records every change in the movement log and provides a full audit trail. Direct inventory updates via this endpoint bypass the movement log entirely.

Path parameters

id
string
required
UUID of the inventory record to update. This is the inventory record ID, not the product ID.

Request body

All fields are optional. Only provided fields will be updated.
quantity
number
New stock quantity on hand.
minStock
number
Minimum stock threshold for low-stock alerts.
maxStock
number
Maximum stock threshold.

Response

Returns the updated inventory record.
id
string
required
Unique identifier for the inventory record (UUID).
productId
string
required
UUID of the product this inventory record tracks.
quantity
number
required
Updated stock quantity on hand.
minStock
number
required
Minimum stock threshold.
maxStock
number
required
Maximum stock threshold.
tenantId
string
required
UUID of the tenant this inventory record belongs to.
createdAt
string
required
ISO 8601 timestamp of when the record was created.
updatedAt
string
required
ISO 8601 timestamp of when the record was last updated.

Examples

curl --request PUT \
  --url http://localhost:5000/api/inventory/c3d4e5f6-a7b8-9012-cdef-345678901234 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "quantity": 200,
    "minStock": 25,
    "maxStock": 600
  }'

Example response

{
  "id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
  "productId": "d4e5f6a7-b8c9-0123-defa-456789012345",
  "quantity": 200,
  "minStock": 25,
  "maxStock": 600,
  "tenantId": "f0e1d2c3-b4a5-6789-cdef-012345678901",
  "createdAt": "2024-01-10T09:00:00.000Z",
  "updatedAt": "2024-03-20T11:00:00.000Z"
}

Build docs developers (and LLMs) love