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/movements

List 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

NameTypeDescription
inventoryId
numberOnly 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
stringOne of "ADD", "SUBTRACT", "ADJUST", "TRANSFER", "RESERVE", "RELEASE", "RELEASE_AND_SUBTRACT", "ADD_AND_RESERVE".
reason
stringPartial match on the movement's reason text.
sortBy
stringColumn to sort by.
sortOrder
string"asc" or "desc".
limit
numberItems per page. Default 50, clamped to 1-200.
offset
numberRow offset to start from (default 0).
page
number1-based page number (default 1). Converted to an offset; an explicit `offset` wins over it.
pageSize
numberAlias 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/create

Record 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

NameTypeDescription
inventoryId
numberrequiredThe stock record to move — its numeric `id`, not a product id.
movementType
stringrequiredWhat 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
numberrequiredHow much to move. Always positive — the direction comes from `movementType`.
targetWarehouseId
numberThe destination warehouse. Required when `movementType` is "TRANSFER", ignored otherwise. The destination stock record is created if it does not exist yet.
unitPrice
numberUnit cost at the time of the movement.
reason
stringWhy the movement happened.
referenceId
numberId of whatever caused the movement in your own or in Glance's data.
referenceType
stringWhat that id refers to, e.g. "SALE", "EXPENSE", "ADJUSTMENT".
notes
stringFree-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
}

Last updated