Inventory Movements

Track and create inventory movements between warehouses.

Use cases: Use movements to transfer stock between warehouses and maintain an audit trail of all inventory changes.
GET/inventory/movements

List inventory movements with optional filtering.

Query Parameters

NameTypeDescription
productId
numberFilter by product ID.
warehouseId
numberFilter by warehouse ID (source or destination).
type
stringMovement type filter.
startDate
stringStart date filter (YYYY-MM-DD).
endDate
stringEnd date filter (YYYY-MM-DD).
page
numberPage number (default 1).
limit
numberItems per page (default 50).

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": [
    {
      "id": 1,
      "product": {
        "id": 1,
        "name": "Widget Pro",
        "sku": "WDG-001"
      },
      "fromWarehouse": {
        "id": 1,
        "name": "Main Warehouse"
      },
      "toWarehouse": {
        "id": 2,
        "name": "Secondary Storage"
      },
      "quantity": 20,
      "reason": "Restock secondary location",
      "createdAt": "2024-03-15T09:00:00Z"
    }
  ],
  "pagination": {
    "total": 230,
    "limit": 50,
    "offset": 0,
    "hasMore": true
  }
}
POST/inventory/movements/create

Create an inventory movement (transfer between warehouses).

Body Parameters

NameTypeDescription
productId
numberrequiredThe product ID.
fromWarehouseId
numberSource warehouse ID.
toWarehouseId
numberDestination warehouse ID.
quantity
numberrequiredNumber of units to move.
reason
stringReason for the movement.

Request

curl -X POST "https://api.glance.co.il/inventory/movements/create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "productId": 0,
  "fromWarehouseId": 0,
  "toWarehouseId": 0,
  "quantity": 0,
  "reason": "example_reason"
}'

Response

Response
{
  "data": {
    "id": 15,
    "productId": 1,
    "fromWarehouseId": 1,
    "toWarehouseId": 2,
    "quantity": 10,
    "reason": "Customer demand shift",
    "createdAt": "2024-03-20T14:00:00Z"
  }
}