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:

Note: Movements automatically adjust stock levels in both the source and destination warehouses.

Serial Number Tracking

For high-value items, enable serial number tracking by setting trackSerialNumbers: true on the product. Serial numbers can then be assigned during inventory creation and referenced in sales documents.