Inventory Movements
The stock audit trail. Every movement is attached to a stock record — never to a product directly — and says what changed, by how much and why.
Use cases: Use this to reconcile stock against your own system, to see what a document did to stock, and to move units between warehouses.
GET
/inventory/movementsList stock movements.
Each row nests the movement under `movement`, with the joined stock record and the user who caused it. `sortBy` accepts "id", "movementType", "quantity" or "createdAt". `documentId` is set when the movement came from a document, which is how you tie stock back to an invoice or delivery note.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
inventoryId | number | Only movements on this stock record (numeric `id`). There is no filter by product or by warehouse — resolve the stock record first via `GET /inventory`. | |
movementType | string | One of "ADD", "SUBTRACT", "ADJUST", "TRANSFER", "RESERVE", "RELEASE", "RELEASE_AND_SUBTRACT", "ADD_AND_RESERVE". | |
reason | string | Partial match on the movement's reason text. | |
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/movements" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": [
{
"movement": {
"id": 55012,
"inventoryId": 771,
"warehouseId": 1,
"userId": 12,
"documentId": 88301,
"movementType": "SUBTRACT",
"quantity": 2,
"unitPrice": 31.5,
"reason": "מכירה",
"referenceId": 88301,
"referenceType": "SALE",
"notes": null,
"isVirtual": false,
"createdAt": "2026-08-20T13:45:00.000Z"
},
"inventory": {
"id": 771,
"productId": 4102,
"warehouseId": 1
},
"user": {
"id": 12,
"name": "מיכל"
}
}
],
"pagination": {
"total": 1240,
"limit": 50,
"offset": 0,
"hasMore": true,
"page": 1,
"pageSize": 50,
"totalPages": 25
}
}POST
/inventory/movements/createRecord a stock movement.
A TRANSFER writes two movements — one out of the source, one into the destination — and its response additionally carries `targetInventoryId`, `targetPreviousQuantity` and `targetNewQuantity`.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
inventoryId | number | required | The stock record to move — its numeric `id`, not a product id. |
movementType | string | required | What kind of movement: "ADD" and "SUBTRACT" change quantity, "ADJUST" sets it relative, "RESERVE" and "RELEASE" move stock in and out of the reserved pool, "RELEASE_AND_SUBTRACT" ships previously reserved stock, "ADD_AND_RESERVE" receives and reserves in one step, and "TRANSFER" moves units to another warehouse. |
quantity | number | required | How much to move. Always positive — the direction comes from `movementType`. |
targetWarehouseId | number | The destination warehouse. Required when `movementType` is "TRANSFER", ignored otherwise. The destination stock record is created if it does not exist yet. | |
unitPrice | number | Unit cost at the time of the movement. | |
reason | string | Why the movement happened. | |
referenceId | number | Id of whatever caused the movement in your own or in Glance's data. | |
referenceType | string | What that id refers to, e.g. "SALE", "EXPENSE", "ADJUSTMENT". | |
notes | string | Free-text note. |
Request
curl -X POST "https://api.glance.co.il/inventory/movements/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"inventoryId": 0,
"movementType": "example_movementType",
"quantity": 0,
"targetWarehouseId": 0,
"unitPrice": 0,
"reason": "example_reason",
"referenceId": 0,
"referenceType": "example_referenceType",
"notes": "example_notes"
}'Response
Response
{
"success": true,
"movementId": 55013,
"previousQuantity": 42,
"newQuantity": 40,
"previousReservedQuantity": 4,
"newReservedQuantity": 4
}