top_products (line_items unnest + GROUP BY), the optionalAuthorization: Bearer ********************curl --location 'https://numueg.app/api/v1/stores//analytics/product-performance?sort_by=&days=&start_date=&end_date=&granularity=&tz=' \
--header 'Authorization: Bearer <token>'{
"success": true,
"data": {
"products": [
{
"id": "string",
"name": "string",
"sku": "string",
"image_url": "string",
"revenue": 0,
"quantity_sold": 0,
"current_stock": 0,
"revenue_trend": [
0
],
"gross_sales": 0,
"discounts": 0,
"tax": 0,
"net_sales": 0,
"orders_count": 0,
"cost_price": 0,
"profit": 0,
"margin_percent": 0
}
],
"categories": [
{
"category_id": "string",
"category_name": "string",
"revenue": 0,
"quantity_sold": 0,
"product_count": 0
}
],
"inventory": {
"in_stock": 0,
"low_stock": 0,
"out_of_stock": 0,
"dead_stock": 0
}
},
"message": "string"
}