Inventory

Track stock levels across warehouses. Each inventory record links a product to a warehouse with a quantity.

Use cases: Use the Inventory API to keep stock levels in sync with your e-commerce store or POS system.
GET/inventory

List inventory records with optional filtering.

Query Parameters

NameTypeDescription
search
stringFree-text search across relevant fields.
warehouseId
numberFilter by warehouse ID.
page
numberPage number (default 1).
limit
numberItems per page (default 50).

Request

curl -X GET "https://api.glance.co.il/inventory" \
  -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"
      },
      "warehouse": {
        "id": 1,
        "name": "Main Warehouse"
      },
      "quantity": 150,
      "location": "Shelf A3"
    }
  ],
  "pagination": {
    "total": 85,
    "limit": 50,
    "offset": 0,
    "hasMore": true
  }
}
GET/inventory/:id

Get a single inventory record.

Path Parameters

NameTypeDescription
id
numberrequiredThe inventory record ID.

Request

curl -X GET "https://api.glance.co.il/inventory/:id" \
  -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"
    },
    "warehouse": {
      "id": 1,
      "name": "Main Warehouse"
    },
    "quantity": 150,
    "location": "Shelf A3"
  }
}
GET/inventory/product/:productId

Get all inventory records for a specific product across all warehouses.

Path Parameters

NameTypeDescription
productId
numberrequiredThe product ID.

Request

curl -X GET "https://api.glance.co.il/inventory/product/:productId" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

Response
{
  "data": [
    {
      "id": 1,
      "warehouse": {
        "id": 1,
        "name": "Main Warehouse"
      },
      "quantity": 150,
      "location": "Shelf A3"
    },
    {
      "id": 4,
      "warehouse": {
        "id": 2,
        "name": "Secondary Storage"
      },
      "quantity": 30,
      "location": "Bin 7"
    }
  ]
}
POST/inventory/create

Create a new inventory record for a product in a warehouse.

Body Parameters

NameTypeDescription
productId
numberrequiredThe product ID.
warehouseId
numberrequiredThe warehouse ID.
quantity
numberStarting quantity (default 0).
location
stringLocation within the warehouse (e.g. shelf, bin).

Request

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

Response

Response
{
  "data": {
    "id": 10,
    "productId": 5,
    "warehouseId": 1,
    "quantity": 100,
    "location": "Shelf B1"
  }
}
PUT/inventory/:id/edit

Update an inventory record.

Path Parameters

NameTypeDescription
id
numberrequiredThe inventory record ID.

Body Parameters

NameTypeDescription
quantity
numberNew quantity.
location
stringLocation within the warehouse.

Request

curl -X PUT "https://api.glance.co.il/inventory/:id/edit" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "quantity": 0,
  "location": "example_location"
}'

Response

Response
{
  "data": {
    "id": 1,
    "productId": 1,
    "warehouseId": 1,
    "quantity": 200,
    "location": "Shelf A3-Updated"
  }
}
DELETE/inventory/:id/delete

Delete an inventory record.

Path Parameters

NameTypeDescription
id
numberrequiredThe inventory record ID.

Request

curl -X DELETE "https://api.glance.co.il/inventory/:id/delete" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

Response
{
  "data": {
    "success": true
  }
}
POST/inventory/adjust

Batch adjust inventory quantities across multiple products and warehouses.

Body Parameters

NameTypeDescription
actions
object[]requiredArray of adjustment actions.
productId
numberrequiredThe product ID.
warehouseId
numberrequiredThe warehouse ID.
amount
numberQuantity to adjust. Positive to add, negative to subtract.
reason
stringReason for the adjustment.
notes
stringAdditional notes.

Request

curl -X POST "https://api.glance.co.il/inventory/adjust" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "actions": "example_actions"
}'

Response

Response
{
  "data": {
    "adjusted": [
      {
        "productId": 1,
        "warehouseId": 1,
        "previousQuantity": 150,
        "newQuantity": 145,
        "amount": -5
      },
      {
        "productId": 2,
        "warehouseId": 1,
        "previousQuantity": 80,
        "newQuantity": 90,
        "amount": 10
      }
    ]
  }
}