Inventory
Stock records. One record is one product in one warehouse, carrying a quantity, a reserved quantity and stock thresholds.
Use cases: Use this to read live stock levels, set reorder thresholds, and reconcile counts against your own system.
GET
/inventoryList stock records.
`sortBy` accepts "id", "quantity", "reservedQuantity", "location" or "createdAt"; anything else falls back to "createdAt". Available stock is `quantity - reservedQuantity` — the API does not return it as its own field on this list.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
search | string | Free-text search across the joined product. | |
warehouseId | number | Only records in this warehouse. | |
productId | number | Only records for this product (numeric id). | |
location | string | Partial match on the location within the warehouse. | |
sortBy | string | Column to sort by. | |
sortOrder | string | "asc" or "desc". | |
limit | number | Items per page. Default 50, clamped to 1-200. | |
offset | number | Row offset to start from (default 0). | |
page | number | 1-based page number (default 1). Converted to an offset; an explicit `offset` wins over it. | |
pageSize | number | Alias of `limit`. Wins over `limit` when both are sent. |
Request
curl -X GET "https://api.glance.co.il/inventory" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": [
{
"id": 771,
"visibleId": "b7e1c3a4-2f5d-4c8b-9a0e-1d2c3b4a5f60",
"productId": 4102,
"warehouseId": 1,
"quantity": 42,
"reservedQuantity": 4,
"minStockLevel": 10,
"maxStockLevel": 200,
"location": "A-3-2",
"createdAt": "2026-02-11T07:00:00.000Z",
"updatedAt": "2026-08-20T13:45:00.000Z",
"product": {
"id": 4102,
"name": "Widget Pro",
"sku": "WDG-001"
},
"warehouse": {
"id": 1,
"name": "מחסן ראשי"
},
"file": null,
"vendor": null
}
],
"pagination": {
"total": 87,
"limit": 50,
"offset": 0,
"hasMore": true,
"page": 1,
"pageSize": 50,
"totalPages": 2
}
}GET
/inventory/:idGet a single stock record.
Returned flat. A record that does not exist answers `200` with a body of `null` rather than a 404 — check for null, not for the status code.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | string | required | The record's `visibleId` (a UUID). |
Request
curl -X GET "https://api.glance.co.il/inventory/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"id": 771,
"visibleId": "b7e1c3a4-2f5d-4c8b-9a0e-1d2c3b4a5f60",
"productId": 4102,
"warehouseId": 1,
"quantity": 42,
"reservedQuantity": 4,
"minStockLevel": 10,
"maxStockLevel": 200,
"location": "A-3-2",
"product": {
"id": 4102,
"name": "Widget Pro",
"sku": "WDG-001"
},
"warehouse": {
"id": 1,
"name": "מחסן ראשי"
}
}GET
/inventory/product/:productIdGet one product's stock across every warehouse, with totals.
This is the one endpoint that gives you `availableQuantity` directly.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
productId | number | required | The product's numeric `id`. |
Request
curl -X GET "https://api.glance.co.il/inventory/product/:productId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"productId": 4102,
"warehouses": [
{
"id": 771,
"warehouseId": 1,
"quantity": 42,
"reservedQuantity": 4,
"location": "A-3-2",
"warehouse": {
"id": 1,
"name": "מחסן ראשי"
}
}
],
"totals": {
"quantity": 42,
"reservedQuantity": 4,
"availableQuantity": 38
}
}POST
/inventory/createOpen a stock record for a product in a warehouse. Usually unnecessary — creating a product with `isWithInventory` opens one for you.
One record per product per warehouse — a second attempt answers 400 INVENTORY_ALREADY_EXISTS.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
productId | number | required | The product's numeric `id`. |
warehouseId | number | required | The warehouse's numeric `id`. |
quantity | number | Opening quantity. Defaults to 0. | |
reservedQuantity | number | Opening reserved quantity. Defaults to 0. | |
minStockLevel | number | Reorder threshold. Defaults to 0. | |
maxStockLevel | number | Upper stock threshold. | |
location | string | Free-text location within the warehouse. |
Request
curl -X POST "https://api.glance.co.il/inventory/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"productId": 0,
"warehouseId": 0,
"quantity": 0,
"reservedQuantity": 0,
"minStockLevel": 0,
"maxStockLevel": 0,
"location": "example_location"
}'Response
Response
{
"success": true,
"inventoryId": 771
}PUT
/inventory/:id/editUpdate a stock record's quantities, thresholds or location. All fields are optional.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The record's numeric `id` — this endpoint takes the numeric id, while `GET /inventory/:id` takes the `visibleId`. |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
quantity | number | Sets the quantity outright. This is a correction, not a movement — it writes no row to the movement log. Use `POST /inventory/adjust` when you want the change recorded. | |
reservedQuantity | number | Sets the reserved quantity outright. | |
minStockLevel | number | Reorder threshold. | |
maxStockLevel | number | Upper stock threshold. | |
location | string | Location within the warehouse. |
Request
curl -X PUT "https://api.glance.co.il/inventory/:id/edit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"quantity": 0,
"reservedQuantity": 0,
"minStockLevel": 0,
"maxStockLevel": 0,
"location": "example_location"
}'Response
Response
{
"success": true
}DELETE
/inventory/:id/deleteDelete a stock record.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The record's numeric `id`. |
Request
curl -X DELETE "https://api.glance.co.il/inventory/:id/delete" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true
}POST
/inventory/adjustApply one or more relative stock adjustments, each recorded as a movement.
`errors` is present only when at least one action failed. This is the endpoint to use for stock changes you want in the audit trail — each action writes an ADJUST movement.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
actions | object[] | required | At least one adjustment. Each is applied on its own; the ones that fail come back in `errors` while the rest are applied. |
productId | number | required | The product's numeric `id`. |
warehouseId | number | required | The warehouse's numeric `id`. |
amount | number | required | Relative change — positive adds, negative subtracts. Not a target quantity. |
reason | string | Why, e.g. "ספירת מלאי" or "שבר". | |
notes | string | Free-text note stored on the movement. |
Request
curl -X POST "https://api.glance.co.il/inventory/adjust" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"actions": "example_actions"
}'Response
Response
{
"success": true,
"results": [
{
"productId": 4102,
"warehouseId": 1,
"previousQuantity": 42,
"adjustment": -2,
"newQuantity": 40,
"success": true
}
]
}