Products
Manage your product catalog. Products can be physical items with inventory tracking or service-based line items.
Use cases: Use the Products API to sync your catalog from an e-commerce platform, manage SKUs, and set pricing.
GET
/productsList all products with optional filtering.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
search | string | Free-text search across relevant fields. | |
page | number | Page number (default 1). | |
limit | number | Items per page (default 50). | |
vendorId | number | Filter by vendor visible ID. | |
isPhysical | boolean | Filter by physical (true) or service (false) products. |
Request
curl -X GET "https://api.glance.co.il/products" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": [
{
"id": 1,
"name": "Widget Pro",
"sku": "WDG-001",
"unit": "pcs",
"unitCost": 49.99,
"buyingPrice": 25,
"isPhysical": true,
"isWithInventory": true,
"trackSerialNumbers": false,
"createdAt": "2024-01-15T10:00:00Z"
}
],
"pagination": {
"total": 120,
"limit": 50,
"offset": 0,
"hasMore": true
}
}GET
/products/id/:idGet a product by its ID.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The product ID. |
Request
curl -X GET "https://api.glance.co.il/products/id/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": {
"id": 1,
"name": "Widget Pro",
"sku": "WDG-001",
"unit": "pcs",
"unitCost": 49.99,
"buyingPrice": 25,
"isPhysical": true,
"isWithInventory": true,
"trackSerialNumbers": false,
"vendor": {
"visibleId": 1,
"name": "Supplier Co"
},
"createdAt": "2024-01-15T10:00:00Z"
}
}GET
/products/sku/:skuLook up a product by its SKU.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
sku | string | required | The unique product SKU. |
Request
curl -X GET "https://api.glance.co.il/products/sku/:sku" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": {
"id": 1,
"name": "Widget Pro",
"sku": "WDG-001",
"unit": "pcs",
"unitCost": 49.99,
"buyingPrice": 25,
"isPhysical": true,
"isWithInventory": true,
"trackSerialNumbers": false,
"vendor": {
"visibleId": 1,
"name": "Supplier Co"
},
"createdAt": "2024-01-15T10:00:00Z"
}
}POST
/products/createCreate a new product.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
name | string | required | Product name. |
sku | string | required | Unique product SKU. |
unit | string | required | Unit of measure (e.g. "pcs", "kg", "hour"). |
manufacturerSku | string | Manufacturer / supplier SKU. | |
description | string | Product description. | |
fileId | number | ID of an uploaded file to use as the product image. | |
vendorId | number | Visible ID of the vendor / supplier. | |
isPhysical | boolean | Whether this is a physical product (default true). | |
unitCost | number | Selling price per unit (default 0). | |
buyingPrice | number | Purchase / cost price per unit (default 0). | |
minStockLevel | number | Minimum stock level for low-stock alerts (default 0). | |
maxStockLevel | number | Maximum stock level. | |
trackSerialNumbers | boolean | Enable serial number tracking (default false). | |
isWithInventory | boolean | Enable inventory tracking (default false). | |
warehouseId | number | Warehouse ID for initial inventory. Required if isWithInventory is true. | |
startingInventory | number | Starting quantity in warehouse (default 0). | |
inventoryLocation | string | Location within the warehouse (e.g. shelf, bin). |
Request
curl -X POST "https://api.glance.co.il/products/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "example_name",
"sku": "example_sku",
"unit": "example_unit",
"manufacturerSku": "example_manufacturerSku",
"description": "example_description",
"fileId": 0,
"vendorId": 0,
"isPhysical": true,
"unitCost": 0,
"buyingPrice": 0,
"minStockLevel": 0,
"maxStockLevel": 0,
"trackSerialNumbers": true,
"isWithInventory": true,
"warehouseId": 0,
"startingInventory": 0,
"inventoryLocation": "example_inventoryLocation"
}'Response
Response
{
"data": {
"id": 2,
"name": "Gadget X",
"sku": "GDX-100",
"unit": "pcs",
"unitCost": 29.99,
"buyingPrice": 15,
"isPhysical": true,
"isWithInventory": true,
"trackSerialNumbers": false,
"createdAt": "2024-03-20T14:30:00Z"
}
}PUT
/products/edit/:idUpdate an existing product. Only provided fields are changed.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The product ID. |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
name | string | Product name. | |
sku | string | Unique product SKU. | |
unit | string | Unit of measure. | |
manufacturerSku | string | Manufacturer SKU. | |
description | string | Product description. | |
fileId | number | Product image file ID. | |
vendorId | number | Vendor visible ID. | |
isPhysical | boolean | Whether this is a physical product. | |
unitCost | number | Selling price per unit. | |
buyingPrice | number | Purchase price per unit. | |
minStockLevel | number | Minimum stock level. | |
maxStockLevel | number | Maximum stock level. | |
trackSerialNumbers | boolean | Enable serial number tracking. | |
isWithInventory | boolean | Enable inventory tracking. | |
warehouseId | number | Warehouse ID. | |
inventoryLocation | string | Location within the warehouse. |
Request
curl -X PUT "https://api.glance.co.il/products/edit/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "example_name",
"sku": "example_sku",
"unit": "example_unit",
"manufacturerSku": "example_manufacturerSku",
"description": "example_description",
"fileId": 0,
"vendorId": 0,
"isPhysical": true,
"unitCost": 0,
"buyingPrice": 0,
"minStockLevel": 0,
"maxStockLevel": 0,
"trackSerialNumbers": true,
"isWithInventory": true,
"warehouseId": 0,
"inventoryLocation": "example_inventoryLocation"
}'Response
Response
{
"data": {
"id": 1,
"name": "Widget Pro v2",
"sku": "WDG-001",
"unit": "pcs",
"unitCost": 59.99
}
}DELETE
/products/delete/:idDelete a product.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The product ID. |
Request
curl -X DELETE "https://api.glance.co.il/products/delete/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": {
"success": true
}
}