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/products

List all products with optional filtering.

Query Parameters

NameTypeDescription
search
stringFree-text search across relevant fields.
page
numberPage number (default 1).
limit
numberItems per page (default 50).
vendorId
numberFilter by vendor visible ID.
isPhysical
booleanFilter 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/:id

Get a product by its ID.

Path Parameters

NameTypeDescription
id
numberrequiredThe 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/:sku

Look up a product by its SKU.

Path Parameters

NameTypeDescription
sku
stringrequiredThe 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/create

Create a new product.

Body Parameters

NameTypeDescription
name
stringrequiredProduct name.
sku
stringrequiredUnique product SKU.
unit
stringrequiredUnit of measure (e.g. "pcs", "kg", "hour").
manufacturerSku
stringManufacturer / supplier SKU.
description
stringProduct description.
fileId
numberID of an uploaded file to use as the product image.
vendorId
numberVisible ID of the vendor / supplier.
isPhysical
booleanWhether this is a physical product (default true).
unitCost
numberSelling price per unit (default 0).
buyingPrice
numberPurchase / cost price per unit (default 0).
minStockLevel
numberMinimum stock level for low-stock alerts (default 0).
maxStockLevel
numberMaximum stock level.
trackSerialNumbers
booleanEnable serial number tracking (default false).
isWithInventory
booleanEnable inventory tracking (default false).
warehouseId
numberWarehouse ID for initial inventory. Required if isWithInventory is true.
startingInventory
numberStarting quantity in warehouse (default 0).
inventoryLocation
stringLocation 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/:id

Update an existing product. Only provided fields are changed.

Path Parameters

NameTypeDescription
id
numberrequiredThe product ID.

Body Parameters

NameTypeDescription
name
stringProduct name.
sku
stringUnique product SKU.
unit
stringUnit of measure.
manufacturerSku
stringManufacturer SKU.
description
stringProduct description.
fileId
numberProduct image file ID.
vendorId
numberVendor visible ID.
isPhysical
booleanWhether this is a physical product.
unitCost
numberSelling price per unit.
buyingPrice
numberPurchase price per unit.
minStockLevel
numberMinimum stock level.
maxStockLevel
numberMaximum stock level.
trackSerialNumbers
booleanEnable serial number tracking.
isWithInventory
booleanEnable inventory tracking.
warehouseId
numberWarehouse ID.
inventoryLocation
stringLocation 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/:id

Delete a product.

Path Parameters

NameTypeDescription
id
numberrequiredThe 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
  }
}