Inventory Sync
Guide
Manage real-time inventory across multiple warehouses and channels using the Glance Inventory API.
Setting Up Inventory
To track inventory for a product, set isWithInventory: true when creating the product and specify a warehouse:
{
"name": "Widget Pro",
"sku": "WDG-001",
"unit": "pcs",
"unitCost": 49.99,
"isWithInventory": true,
"warehouseId": 1,
"startingInventory": 100
}Batch Adjustments
Adjust stock levels for multiple products at once:
POST /inventory/adjust
{
"actions": [
{
"productId": 1,
"warehouseId": 1,
"amount": -5,
"reason": "Damaged goods",
"notes": "Items damaged during shipping"
},
{
"productId": 2,
"warehouseId": 1,
"amount": 50,
"reason": "New stock received"
}
]
}Warehouse Transfers
Move inventory between warehouses using the movements API:
POST /inventory/movements/create
{
"inventoryId": 771,
"movementType": "TRANSFER",
"quantity": 10,
"targetWarehouseId": 2,
"reason": "Restocking the shop"
}Note: A movement hangs off a stock record (
inventoryId), not off a product — resolve the record first with GET /inventory?productId=…. A TRANSFER writes two movements and adjusts both warehouses, creating the destination stock record if it does not exist yet.Serial Number Tracking
For high-value items, enable serial number tracking by setting trackSerialNumbers: true on the product. Serials are then registered in bulk against the product and a warehouse with POST /products/id/:id/serials, and quoted per line as serialNumbers when you issue a document.