get_promotion_roi
Calculate ROI for each active promotion by comparing promotion items in orders with sales data over a specified date range. Returns order counts, revenue, discount amounts, and average discount per order.
Instructions
交叉比對促銷活動與銷售數據,計算各活動的 ROI。
【用途】取得指定時間區間內活躍的促銷活動,並比對訂單中的 promotion_items, 統計每個活動帶來的訂單數、營業額、折扣金額,計算平均每單折扣與折扣占比。 【呼叫的 Shopline API】
GET /v1/promotions(促銷活動列表)
GET /v1/orders/search(訂單查詢) 【回傳結構】dict 含 period、total_promotions、promotions(各活動 ROI 明細)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_date | Yes | 結束日期 YYYY-MM-DD。建議與 start_date 維持較短區間以加快查詢。 | |
| start_date | Yes | 起始日期 YYYY-MM-DD。⚠️ 本工具會逐頁掃描區間內所有訂單,區間越大越慢,請只查實際需要的最小區間(如單週或單月),避免一次查詢過長期間。 |