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
/inventoryList inventory records with optional filtering.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
search | string | Free-text search across relevant fields. | |
warehouseId | number | Filter by warehouse ID. | |
page | number | Page number (default 1). | |
limit | number | Items 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/:idGet a single inventory record.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The 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/:productIdGet all inventory records for a specific product across all warehouses.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
productId | number | required | The 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/createCreate a new inventory record for a product in a warehouse.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
productId | number | required | The product ID. |
warehouseId | number | required | The warehouse ID. |
quantity | number | Starting quantity (default 0). | |
location | string | Location 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/editUpdate an inventory record.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The inventory record ID. |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
quantity | number | New quantity. | |
location | string | Location 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/deleteDelete an inventory record.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The 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/adjustBatch adjust inventory quantities across multiple products and warehouses.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
actions | object[] | required | Array of adjustment actions. |
productId | number | required | The product ID. |
warehouseId | number | required | The warehouse ID. |
amount | number | Quantity to adjust. Positive to add, negative to subtract. | |
reason | string | Reason for the adjustment. | |
notes | string | Additional 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
}
]
}
}