get_refunds
Get refund/return analytics. Reports: summary (total refunds, refund rate, % of revenue — supports compare for WoW/MoM/YoY trend), top_products (most refunded products by amount or rate), by_reason (classifies refund notes into buckets: size_fit_too_small, size_fit_too_large, quality_defect, wrong_item, shipping_late_or_lost, color_style_mismatch, comfort, changed_mind, duplicate, out_of_stock — with top affected products and sample verbatim notes per bucket. The out_of_stock bucket is a fulfilment/overselling signal, not a customer preference. Best for diagnosing high refund rates).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | For top_products and by_reason: number of results (default: 10) | |
| report | Yes | Report type | |
| sortBy | No | For top_products: sort field (default: amount) | |
| _offset | No | Pagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page. | |
| compare | No | For summary: attach a `comparison` block showing the same metrics for the WoW/MoM/YoY/previous-period window with percentage changes. | |
| endDate | No | End date (YYYY-MM-DD). Defaults to yesterday (last fully-closed day — today is excluded by default to avoid partial-day totals; pass an explicit endDate to include today). | |
| startDate | No | Start date (YYYY-MM-DD). Defaults to a 30-day window ending yesterday. |