Products API

Endpoints

GET/productsList products
GET/products/:idGet single product
POST/productsCreate product
PUT/products/:idUpdate product
DELETE/products/:idDeactivate product

List products - GET /products

ParameterTypeDescription
searchStringSearch by product name (case-insensitive)
category_idUUIDFilter by category
in_stockBooleanOnly return products with stock > 0
is_activeBooleanFilter by active status (default: true)
pageNumberPage number
per_pageNumberResults per page (max: 100)
curl "https://qatxonlxvtgxvqjgfxpl.supabase.co/functions/v1/api/products?in_stock=true&per_page=50" \
  -H "Authorization: Bearer do_live_YOUR_KEY"
const products = await client.products.list({
  search: 'widget',
  in_stock: true,
  per_page: 50,
})
products = client.products.list(search='widget', in_stock=True, per_page=50)

Product response object

{
  "id": "a1b2c3d4-...",
  "name": "Widget Pro",
  "sku": "WDGPRO-1234",
  "price": 49.99,
  "cost_price": 22.00,
  "unit": "piece",
  "description": "Premium widget with extended warranty",
  "barcode": "1234567890123",
  "is_active": true,
  "category": { "id": "cat-uuid", "name": "Electronics" },
  "stock": 142,
  "stock_by_warehouse": [
    { "warehouse_id": "wh-1", "warehouse_name": "Main Store", "quantity": 100 },
    { "warehouse_id": "wh-2", "warehouse_name": "Warehouse B", "quantity": 42 }
  ],
  "created_at": "2026-01-15T10:00:00.000Z",
  "updated_at": "2026-06-01T09:00:00.000Z"
}

Create product - POST /products

FieldTypeRequiredDescription
nameStringrequiredProduct name
priceNumberrequiredSelling price
cost_priceNumberoptionalCost/purchase price (for margin reporting)
category_idUUIDoptionalCategory UUID
descriptionStringoptionalProduct description
barcodeStringoptionalEAN/UPC barcode
unitStringoptionalUnit of measure (default: 'unit')
skuStringoptionalSKU - auto-generated if omitted