BBC Debug
Live health checks for Next.js proxy and Supabase Edge.
envcheck
NEXT /api/envcheck
200
{
"hasUrl": true,
"hasAnon": true,
"hasApiKey": true
}kpis
NEXT /api/kpis
200
{
"production_days": 63,
"ingredients": 27,
"invoices": 4247,
"last_xero_sync": "2026-03-25 06:26:54.6+00"
}production (limit=10)
NEXT /api/production/daily?limit=10
200
{
"rows": [
{
"date": "2026-03-25",
"product_group": "GF",
"batches": "6",
"units_small": "112",
"units_large": "0",
"notes": null,
"created_at": "2026-03-25 07:48:26.793+00"
},
{
"date": "2026-03-24",
"product_group": "RC",
"batches": "6",
"units_small": "115",
"units_large": "0",
"notes": null,
"created_at": "2026-03-24 07:39:38.98+00"
},
{
"date": "2026-03-23",
"product_group": "SS",
"batches": "6",
"units_small": "110",
"units_large": "0",
"notes": null,
"created_at": "2026-03-23 09:00:52.946+00"
},
{
"date": "2026-03-20",
"product_group": "SS",
"batches": "6",
"units_small": "111",
"units_large": "0",
"notes": null,
"created_at": "2026-03-21 07:42:58.224+00"
},
{
"date": "2026-03-18",
"product_group": "PC",
"batches": "6",
"units_small": "115",
"units_large": "0",
"notes": null,
"created_at": "2026-03-18 07:49:32.708+00"
},
{
"date": "2026-03-17",
"product_group": "GFPC",
"batches": "1",
"units_small": "20",
"units_large": "0",
"notes": "DB config test",
"created_at": "2026-03-17 10:05:24.175+00"
},
{
"date": "2026-03-17",
"product_group": "GFPC",
"batches": "1",
"units_small": "20",
"units_large": "0",
"notes": "DB config test",
"created_at": "2026-03-17 09:10:07.616+00"
},
{
"date": "2026-03-17",
"product_group": "GF",
"batches": "6",
"units_small": "116",
"units_large": "0",
"notes": null,
"created_at": "2026-03-17 07:16:03.986+00"
},
{
"date": "2026-03-16",
"product_group": "SS",
"batches": "6",
"units_small": "86",
"units_large": "6",
"notes": null,
"created_at": "2026-03-16 07:52:34.359+00"
},
{
"date": "2026-03-12",
"product_group": "PC",
"batches": "6",
"units_small": "114",
"units_large": "0",
"notes": null,
"created_at": "2026-03-12 09:26:24.771+00"
}
],
"limit": 10
}sales summary (30d)
NEXT /api/sales/summary?period=30d
404
{
"code": 404,
"message": "Not found",
"path": "/sales/summary",
"method": "GET"
}sales summary (mtd)
NEXT /api/sales/summary?period=mtd
404
{
"code": 404,
"message": "Not found",
"path": "/sales/summary",
"method": "GET"
}inventory FG latest
NEXT /api/inventory/fg/latest
200
{
"ok": true,
"snapshot_at": "2026-03-25T08:56:20",
"rows": [
{
"item_code": "GFPC115",
"stock_units": 0,
"unit_cost": 4.85,
"value": 0,
"snapshot_at": "2026-03-25T08:56:20",
"display_name": "Gluten Free Paprika & Chilli 115g",
"product_group": "GFPC",
"size_kind": "small",
"is_active": true,
"is_discontinued": true
},
{
"item_code": "GFPC500",
"stock_units": 0,
"unit_cost": 16.6,
"value": 0,
"snapshot_at": "2026-03-25T08:56:20",
"display_name": "Gluten Free Paprika & Chilli 500g",
"product_group": "GFPC",
"size_kind": "large",
"is_active": true,
"is_discontinued": false
},
{
"item_code": "GFSS115",
"stock_units": 456,
"unit_cost": 4.8,
"value": 2188.8,
"snapshot_at": "2026-03-25T08:56:20",
"display_name": "Gluten Free Salt & Seed 115g",
"product_group": "GF",
"size_kind": "small",
"is_active": true,
"is_discontinued": false
},
{
"item_code": "GFSS500",
"stock_units": 7,
"unit_cost": 16.55,
"value": 115.85,
"snapshot_at": "2026-03-25T08:56:20",
"display_name": "Gluten Free Salt & Seed 500g",
"product_group": "GF",
"size_kind": "large",
"is_active": true,
"is_discontinued": false
},
{
"item_code": "PC125",
"stock_units": 159,
"unit_cost": 4.4,
"value": 699.6,
"snapshot_at": "2026-03-25T08:56:20",
"display_name": "Paprika & Chilli 125g",
"product_group": "PC",
"size_kind": "small",
"is_active": true,
"is_discontinued": false
},
{
"item_code": "RC115",
"stock_units": 195,
"unit_cost": 4.33,
"value": 844.35,
"snapshot_at": "2026-03-25T08:56:20",
"display_name": "Rye & Caraway 115g",
"product_group": "RC",
"size_kind": "small",
"is_active": true,
"is_discontinued": false
},
{
"item_code": "SS125",
"stock_units": 420,
"unit_cost": 4.39,
"value": 1843.8,
"snapshot_at": "2026-03-25T08:56:20",
"display_name": "Salt & Seed 125g",
"product_group": "SS",
"size_kind": "small",
"is_active": true,
"is_discontinued": false
},
{
"item_code": "SS500",
"stock_units": 12,
"unit_cost": 16.56,
"value": 198.72,
"snapshot_at": "2026-03-25T08:56:20",
"display_name": "Salt & Seed 500g",
"product_group": "SS",
"size_kind": "large",
"is_active": true,
"is_discontinued": false
}
],
"meta": {
"mode": "snapshot_only",
"snapshot_at_raw": "2026-03-25T08:56:20"
}
}inventory ING latest
NEXT /api/inventory/ing/latest
200
{
"ok": true,
"snapshot_at": "2026-03-25T08:56:20",
"rows": [
{
"ingredient_code": "BAG50",
"ingredient_name": "Packaging - Sample Bags",
"unit": "each",
"stock_qty": 3513,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "BAG500",
"ingredient_name": "Packaging - Pouches",
"unit": "each",
"stock_qty": 1341,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "BAKEP",
"ingredient_name": "Baking Powder",
"unit": "g",
"stock_qty": 3920,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "BAKINGSHEET",
"ingredient_name": "Baking Paper sheets",
"unit": "sheets",
"stock_qty": 121,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "BRRICEFL",
"ingredient_name": "Brown Rice Flour",
"unit": "g",
"stock_qty": 71000,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "CARAS",
"ingredient_name": "Caraway Seeds",
"unit": "g",
"stock_qty": 950,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "CHILLI",
"ingredient_name": "Chilli Powder",
"unit": "g",
"stock_qty": 4140,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "FLOUR",
"ingredient_name": "Plain Flour",
"unit": "g",
"stock_qty": 51100,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "GFPCBAG",
"ingredient_name": "GF Paprika & Chilli Pouches",
"unit": "each",
"stock_qty": 0,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "GFSSBAG",
"ingredient_name": "GF S&S Pouches",
"unit": "each",
"stock_qty": 5672,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "LINS",
"ingredient_name": "Linseed",
"unit": "g",
"stock_qty": 197260,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "OATS",
"ingredient_name": "Rolled Oats",
"unit": "g",
"stock_qty": 27200,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "OIL",
"ingredient_name": "Olive Oil",
"unit": "g",
"stock_qty": 37370,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "PAPRIKA",
"ingredient_name": "Paprika",
"unit": "g",
"stock_qty": 1520,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "PCBAG",
"ingredient_name": "P&C Pouches",
"unit": "each",
"stock_qty": 4635,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "PEP",
"ingredient_name": "Pepitas",
"unit": "g",
"stock_qty": 20700,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "POTSTARCH",
"ingredient_name": "Potato Starch",
"unit": "g",
"stock_qty": 15950,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "RCBAG",
"ingredient_name": "R&C Pouches",
"unit": "each",
"stock_qty": 6035,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "ROSEMARY",
"ingredient_name": "Rosemary Extract",
"unit": "g",
"stock_qty": 1749.34,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "RYEFL",
"ingredient_name": "Rye Flour",
"unit": "g",
"stock_qty": 4300,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "SALT",
"ingredient_name": "Murray Sea Salt 2",
"unit": "g",
"stock_qty": 24055,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "SESS",
"ingredient_name": "Sesame Seed",
"unit": "g",
"stock_qty": 23340,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "SSBAG",
"ingredient_name": "S&S Pouches",
"unit": "each",
"stock_qty": 8096,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "SUNFL",
"ingredient_name": "Sunflower Seeds",
"unit": "g",
"stock_qty": 46320,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "TAPSTARCH",
"ingredient_name": "Tapioca Starch",
"unit": "g",
"stock_qty": 19250,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "TESTPACK1",
"ingredient_name": "GF P&C Pouches",
"unit": "each",
"stock_qty": 0,
"snapshot_at": "2026-03-25T08:56:20"
},
{
"ingredient_code": "WHRICEFL",
"ingredient_name": "White Rice Flour",
"unit": "g",
"stock_qty": 20000,
"snapshot_at": "2026-03-25T08:56:20"
}
]
}inventory valuation latest
NEXT /api/inventory/valuation/latest
200
{
"fg_snapshot_at": "2026-03-25T08:56:20",
"ing_snapshot_at": "2026-03-25T08:56:20",
"totals": {
"finished_goods_value": 5891.12,
"ingredient_value": 8427.26,
"total_value": 14318.38
},
"finished_goods": [
{
"item_code": "GFSS115",
"stock_units": 456,
"unit_cost": 4.8,
"value": 2188.8
},
{
"item_code": "SS125",
"stock_units": 420,
"unit_cost": 4.39,
"value": 1843.8
},
{
"item_code": "RC115",
"stock_units": 195,
"unit_cost": 4.33,
"value": 844.35
},
{
"item_code": "PC125",
"stock_units": 159,
"unit_cost": 4.4,
"value": 699.6
},
{
"item_code": "SS500",
"stock_units": 12,
"unit_cost": 16.56,
"value": 198.72
},
{
"item_code": "GFSS500",
"stock_units": 7,
"unit_cost": 16.55,
"value": 115.85
},
{
"item_code": "GFPC115",
"stock_units": 0,
"unit_cost": 4.85,
"value": 0
},
{
"item_code": "GFPC500",
"stock_units": 0,
"unit_cost": 16.6,
"value": 0
}
],
"ingredients": [
{
"ingredient_code": "BRRICEFL",
"stock_qty": 71000,
"stock_unit": "g",
"qty_in_cost_units": 71,
"cost_unit": "kg",
"unit_cost": 74.5,
"value": 5289.5
},
{
"ingredient_code": "LINS",
"stock_qty": 197260,
"stock_unit": "g",
"qty_in_cost_units": 197.26,
"cost_unit": "kg",
"unit_cost": 4.45,
"value": 877.81
},
{
"ingredient_code": "ROSEMARY",
"stock_qty": 1749.34,
"stock_unit": "g",
"qty_in_cost_units": 1.74934,
"cost_unit": "kg",
"unit_cost": 286,
"value": 500.31
},
{
"ingredient_code": "OIL",
"stock_qty": 37370,
"stock_unit": "g",
"qty_in_cost_units": 37.37,
"cost_unit": "kg",
"unit_cost": 12.5,
"value": 467.13
},
{
"ingredient_code": "SUNFL",
"stock_qty": 46320,
"stock_unit": "g",
"qty_in_cost_units": 46.32,
"cost_unit": "kg",
"unit_cost": 5.2,
"value": 240.86
},
{
"ingredient_code": "PEP",
"stock_qty": 20700,
"stock_unit": "g",
"qty_in_cost_units": 20.7,
"cost_unit": "kg",
"unit_cost": 9.8,
"value": 202.86
},
{
"ingredient_code": "SESS",
"stock_qty": 23340,
"stock_unit": "g",
"qty_in_cost_units": 23.34,
"cost_unit": "kg",
"unit_cost": 7.45,
"value": 173.88
},
{
"ingredient_code": "SALT",
"stock_qty": 24055,
"stock_unit": "g",
"qty_in_cost_units": 24.055,
"cost_unit": "kg",
"unit_cost": 6,
"value": 144.33
},
{
"ingredient_code": "FLOUR",
"stock_qty": 51100,
"stock_unit": "g",
"qty_in_cost_units": 51100,
"cost_unit": "g",
"unit_cost": 0.0025,
"value": 127.75
},
{
"ingredient_code": "OATS",
"stock_qty": 27200,
"stock_unit": "g",
"qty_in_cost_units": 27.2,
"cost_unit": "kg",
"unit_cost": 3.33,
"value": 90.58
},
{
"ingredient_code": "TAPSTARCH",
"stock_qty": 19250,
"stock_unit": "g",
"qty_in_cost_units": 19.25,
"cost_unit": "kg",
"unit_cost": 4.15,
"value": 79.89
},
{
"ingredient_code": "POTSTARCH",
"stock_qty": 15950,
"stock_unit": "g",
"qty_in_cost_units": 15.95,
"cost_unit": "kg",
"unit_cost": 3.85,
"value": 61.41
},
{
"ingredient_code": "WHRICEFL",
"stock_qty": 20000,
"stock_unit": "g",
"qty_in_cost_units": 20,
"cost_unit": "kg",
"unit_cost": 2.55,
"value": 51
},
{
"ingredient_code": "CHILLI",
"stock_qty": 4140,
"stock_unit": "g",
"qty_in_cost_units": 4.14,
"cost_unit": "kg",
"unit_cost": 8.2,
"value": 33.95
},
{
"ingredient_code": "BAKEP",
"stock_qty": 3920,
"stock_unit": "g",
"qty_in_cost_units": 3.92,
"cost_unit": "kg",
"unit_cost": 6.1,
"value": 23.91
},
{
"ingredient_code": "RYEFL",
"stock_qty": 4300,
"stock_unit": "g",
"qty_in_cost_units": 4.3,
"cost_unit": "kg",
"unit_cost": 5.1,
"value": 21.93
},
{
"ingredient_code": "BAKINGSHEET",
"stock_qty": 121,
"stock_unit": "sheets",
"qty_in_cost_units": 121,
"cost_unit": "each",
"unit_cost": 0.14,
"value": 16.94
},
{
"ingredient_code": "CARAS",
"stock_qty": 950,
"stock_unit": "g",
"qty_in_cost_units": 0.95,
"cost_unit": "kg",
"unit_cost": 13.25,
"value": 12.59
},
{
"ingredient_code": "PAPRIKA",
"stock_qty": 1520,
"stock_unit": "g",
"qty_in_cost_units": 1.52,
"cost_unit": "kg",
"unit_cost": 7,
"value": 10.64
},
{
"ingredient_code": "BAG50",
"stock_qty": 3513,
"stock_unit": "each",
"qty_in_cost_units": 3513,
"cost_unit": "",
"unit_cost": 0,
"value": 0
},
{
"ingredient_code": "BAG500",
"stock_qty": 1341,
"stock_unit": "each",
"qty_in_cost_units": 1341,
"cost_unit": "",
"unit_cost": 0,
"value": 0
},
{
"ingredient_code": "GFPCBAG",
"stock_qty": 0,
"stock_unit": "each",
"qty_in_cost_units": 0,
"cost_unit": "",
"unit_cost": 0,
"value": 0
},
{
"ingredient_code": "GFSSBAG",
"stock_qty": 5672,
"stock_unit": "each",
"qty_in_cost_units": 5672,
"cost_unit": "",
"unit_cost": 0,
"value": 0
},
{
"ingredient_code": "PCBAG",
"stock_qty": 4635,
"stock_unit": "each",
"qty_in_cost_units": 4635,
"cost_unit": "",
"unit_cost": 0,
"value": 0
},
{
"ingredient_code": "RCBAG",
"stock_qty": 6035,
"stock_unit": "each",
"qty_in_cost_units": 6035,
"cost_unit": "",
"unit_cost": 0,
"value": 0
},
{
"ingredient_code": "SSBAG",
"stock_qty": 8096,
"stock_unit": "each",
"qty_in_cost_units": 8096,
"cost_unit": "",
"unit_cost": 0,
"value": 0
},
{
"ingredient_code": "TESTPACK1",
"stock_qty": 0,
"stock_unit": "each",
"qty_in_cost_units": 0,
"cost_unit": "",
"unit_cost": 0,
"value": 0
}
]
}SB sales summary (30d)
SUPABASE /sales/summary?period=30d
401
{
"code": 401,
"message": "Missing authorization header"
}SB inventory valuation
SUPABASE /inventory/valuation/latest
401
{
"code": 401,
"message": "Missing authorization header"
}