Returns analysis
get_returns_analysisWhy returns moved, from the refunds themselves (exact, not an estimate per product). gap splits the change in returns: total = fromEarlierOrders (refunds of orders placed before the period) + fromOrdersInSpan (orders placed in it); reading is the conclusion to state: customers_return_more (more finished months have a higher return rate than a year earlier than a lower one: name monthsWithHigherRate and any monthsWithLowerRate), earlier_sales_landing (most of the rise is refunds of earlier orders and rates are flat), both, mixed (as many months fell as rose: say it is not a clear rise), or unclear (say the data does not settle it). timing says where the refunds of each period came from: returns and refunds (their number), fromOrdersInSpan, fromEarlierOrders, earlierShare, avgDaysToRefund and byOrderMonth (the month each refunded order was placed). cohorts covers the 4 order months ending at the span's last month, each beside the same month a year earlier: sold (gross less discounts) with soldChange, returnedWithin30Days, and returnRate (returnedWithin30Days ÷ sold in both years, with changePoints). A cohort's rate going up means customers really return more; a flat rate with higher returns means refunds of bigger earlier sales landed in this period. mature false = that month's 30 days have not passed, so its rate can still rise: say so and do not conclude from it. Use whenever returns are part of the answer. Optional from and to (inclusive YYYY-MM-DD, both or neither, never after today) read another span instead of the default period. A named month, a week or two dates the operator gave MUST be sent here: without them this reads the last 30 days, which is not that month.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Last day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default 30-day period. | |
| from | No | First day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default 30-day period. | |
| compare | No | What to compare the span with: previous (default, the same number of days just before), yoy (the same dates last year) or yoyWeekday (52 weeks back, the same weekdays — use it for natural Monday–Sunday weeks or whenever the operator says 'last year' over weeks). | |
| salesChannel | No | Only online orders (the web shop) or only point-of-sale orders; omit for every channel. When the operator says 'solo web', 'online only' or 'sin POS', send online — and keep sending it for the rest of the conversation. |