get_orders
Get order analytics by dimension. Reports: by_status (order counts/revenue by financial status), by_country (geographic sales breakdown — supports compare for WoW/MoM/YoY trend, returns top rising/falling countries), by_product (BEST FOR: 'how many customers bought product X?', 'which products have the most unique buyers?', product-level customer counts. Returns uniqueCustomers, orderCount, unitsSold, and revenue per product. Use this whenever the question involves customers AND products together), by_tag (order volume per Shopify order tag with SUDDEN-DROP DETECTION — compares the last 7 days vs the prior weeks and flags tags whose order count fell significantly. BEST FOR: 'did orders with tag X drop?', 'has any marketplace/dropship channel stopped?'. Pass tag to focus one tag, or omit to scan all tags; returns a drops list plus per-tag current/baseline/change).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | For by_tag: focus a single order tag (case-insensitive). Omit to scan every tag and surface the ones dropping. | |
| limit | No | For by_country: number of countries (default: 10). For by_tag: max tags returned (default: 20). | |
| report | Yes | Report type | |
| sortBy | No | For by_product: sort field (default: revenue) | |
| _offset | No | Pagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page. | |
| compare | No | For by_country: attach a `comparison` block with rising/falling countries vs the WoW/MoM/YoY/previous-period window. | |
| endDate | No | End date (YYYY-MM-DD) | |
| lagDays | No | For by_tag: end the windows this many days back so the current week is complete days (default 1). Raise it if a marketplace app applies its order tag with a delay. | |
| startDate | No | Start date (YYYY-MM-DD) | |
| lookbackWeeks | No | For by_tag: number of prior weekly windows to use as the baseline (default 4, range 2-12). |