Products
Manage your product catalog. Each product response includes real-time stock levels across all warehouses.
Endpoints
GET/productsList products
GET/products/:idGet single product
POST/productsCreate product
PUT/products/:idUpdate product
DELETE/products/:idDeactivate product
List products - GET /products
| Parameter | Type | Description |
|---|---|---|
| search | String | Search by product name (case-insensitive) |
| category_id | UUID | Filter by category |
| in_stock | Boolean | Only return products with stock > 0 |
| is_active | Boolean | Filter by active status (default: true) |
| page | Number | Page number |
| per_page | Number | Results 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
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | required | Product name |
| price | Number | required | Selling price |
| cost_price | Number | optional | Cost/purchase price (for margin reporting) |
| category_id | UUID | optional | Category UUID |
| description | String | optional | Product description |
| barcode | String | optional | EAN/UPC barcode |
| unit | String | optional | Unit of measure (default: 'unit') |
| sku | String | optional | SKU - auto-generated if omitted |