{
"_links": {
"next": "/api/inventory/health?group_by=product&status=all&dormant_months=6&velocity_window_months=12&sort_by=stock_value&limit=2&offset=2",
"products_analytics": "/api/products/analytics?from=2025-10-12&to=2026-10-07&group_by=product",
"sales_velocity": "/api/products/sales-velocity?from=2025-10-12&to=2026-10-07",
"self": "/api/inventory/health?group_by=product&status=all&dormant_months=6&velocity_window_months=12&sort_by=stock_value&limit=2&offset=0"
},
"buckets": [
{
"_links": {
"product_detail": "/api/inventory/products/by-id/412"
},
"cogs_window": 9207.5,
"coverage_days": 59.8,
"dormant_products_count": 0,
"dormant_value": 0,
"is_dormant": false,
"last_sale_date": "2026-10-02",
"overstock_products_count": 0,
"products_count": 1,
"qty_available": 228,
"qty_on_hand": 240,
"qty_on_order": 100,
"qty_reserved": 12,
"qty_sold_window": 1450,
"ref": {
"code": "VIS-008",
"id": 412,
"name": "Vis à bois n° 8 — boîte de 100"
},
"stock_value": 1584,
"turnover": 5.81
},
{
"_links": {
"product_detail": "/api/inventory/products/by-id/518"
},
"cogs_window": 0,
"dormant_products_count": 1,
"dormant_value": 1062.5,
"is_dormant": true,
"overstock_products_count": 0,
"products_count": 1,
"qty_available": 85,
"qty_on_hand": 85,
"qty_on_order": 0,
"qty_reserved": 0,
"qty_sold_window": 0,
"ref": {
"code": "PEN-EXT-20",
"id": 518,
"name": "Penture extérieure 20 cm"
},
"stock_value": 1062.5
}
],
"cache": {
"age_seconds": 0,
"cached_at": "2026-10-07T09:12:00-04:00",
"components": {
"sales": {
"age_seconds": 5520,
"cached_at": "2026-10-07T07:40:00-04:00",
"expires_at": "2026-10-07T11:40:00-04:00",
"force_refreshed": false,
"key_hash": "sha1:7c4a8d09ca3762af61e59520943dc26494f8941b",
"status": "hit",
"ttl_policy": "current_period_4h",
"ttl_remaining_seconds": 8880
},
"stock": {
"age_seconds": 0,
"cached_at": "2026-10-07T09:12:00-04:00",
"expires_at": "2026-10-07T10:12:00-04:00",
"force_refreshed": false,
"key_hash": "sha1:5d41402abc4b2a76b9719d911017c592ae2f8c31",
"status": "miss",
"ttl_policy": "stock_1h",
"ttl_remaining_seconds": 3600
}
},
"expires_at": "2026-10-07T10:12:00-04:00",
"force_refreshed": false,
"key_hash": "sha1:5d41402abc4b2a76b9719d911017c592ae2f8c31",
"status": "partial_hit",
"ttl_policy": "stock_1h",
"ttl_remaining_seconds": 3600
},
"filter": {
"dormant_months": 6,
"group_by": "product",
"include_inactive": false,
"limit": 2,
"offset": 0,
"sort_by": "stock_value",
"status": "all",
"velocity_window_months": 12
},
"group_by": "product",
"metadata": {
"buckets_matching_status": 214,
"dormant_threshold_date": "2026-04-10",
"extracted_at": "2026-10-07T09:12:00-04:00",
"has_more": true,
"limit_applied": 2,
"next_offset": 2,
"offset_applied": 0,
"organisation_id": "entreprise_exemple",
"products_inactive_excluded": 12,
"sales_products_not_in_stock": 2,
"scope": "stock_product_level_plus_invoicing_lines_type_1",
"scope_note": "Stock lu sur les fiches produit (items inclus), valorisé au coût moyen actuel ; ventes lues sur les lignes de produits des factures de la fenêtre.",
"sdk_indexes_used": {
"invoicing": 6,
"invoicing_line": 6,
"product": 1
},
"truncated": true
},
"summary": {
"buckets_count": 214,
"cogs_window_total": 412880.15,
"dormant_count": 41,
"dormant_value_total": 23915.6,
"overstock_count": 3,
"products_count": 214,
"products_never_sold_in_window": 29,
"products_without_max_qty": 176,
"qty_on_hand_total": 18640,
"qty_sold_window_total": 52310,
"stock_value_total": 186420.35
},
"window": {
"days": 361,
"from": "2025-10-12",
"to": "2026-10-07"
}
}