Skip to main content

Get Assortment Explorer Report

GET 

/api/reports/assortment-explorer

Nested rows grouped by up to four dimensions, each with the buyer metrics, a trend series, an optional comparison period and a Winners / Chasers / Losers classification with its reason. A parent row is always the exact sum of its children. Products count when they sold in the period or are unarchived with stock on hand; a variant without its own value inherits its parent's; rows with no value come last (value_key __none__, label e.g. "Not set", "No brand").

Required scope: reports:read

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Metrics on every row (ratios are fractions and null when undefined, never zero-filled): net units = units sold − units returned (units on return requests (RMAs) that weren't cancelled, against orders placed in the period — repair returns excluded); net sales and cost from order-line financials; gross margin $ / %; full-price share = units on lines with no discount ÷ units sold; ASP = net sales ÷ net units; on hand now; sell-through = net units ÷ (net units + on hand); weeks of supply = on hand ÷ weekly net units; GMROI = annualised gross margin ÷ inventory at cost now (an estimate from current stock); return rate = returned ÷ sold (a cohort rate: both counts come from the period's orders).

Every row gets classification (winner, chaser, steady, loser, not_enough_data), an index (its weekly units per product ÷ the same rate for the row above it; the whole report for top rows) and a plain-language reason. Rules, first match wins: under min_units → not_enough_data; sell-through ≥ chaser_sell_through and weeks of supply ≤ chaser_max_weeks_of_supply → chaser; index ≥ winner_index and sell-through ≥ winner_sell_through → winner; index ≤ loser_index or sell-through < loser_sell_through → loser; otherwise steady.

coverage gives the share of products and units sold with a value for each grouping. notices: style_needs_parents (style grouping but no product has a parent), compare_no_history / compare_partial_history, full_price_partly_unclassified (some recent lines have no price type yet, so for those full price falls back to no discount on the line). full_price_basis is price_type: a unit is full price when it sold with no markdown and no discount.

Optional column groups (extras, a list; each is computed only when asked for):

  • stockouts: every row (and totals_stockout) gets stockout — stockout_days, in_stock_days, carried_days, in_stock_rate, in_stock_velocity_per_week (units sold ÷ in-stock days × 7) and a separately labelled ESTIMATE of lost demand: est_lost_units = in-stock velocity × stockout days and est_lost_sales = lost units × each product's average net selling price (est_lost_sales_partial when some lost units had no price). Stock days come from a day-by-day rebuild of each product's on-hand stock from the inventory ledger (account-timezone days, inventory debt included). A product with no ledger, or one whose ledger goes negative (more units left than were ever received), gets no stockout days and no estimate — counted in no_history_products / incomplete_history_products. A product in stock fewer than 14 days in the period keeps its stockout days but gets no estimate (too few days to trust a rate), counted in short_in_stock_products; one never in stock is counted in never_in_stock_products; stock_coverage says how much of the report rests on real history. confidence is high / medium / low / none (high needs 10+ units over 28+ in-stock days per product, medium 4+ over 14+; weighted by each product's share of the estimated loss; dropped a tier when under half the products can be estimated) with plain-language confidence_reasons. Products count when they sold in the period or are in stock now (the explorer's usual scope).
  • return_reasons: every row (and totals_return_reasons) gets return_reasons — the row's returned units split into families (too_small, too_large, fit_width, comfort, defect, wrong_item, not_as_described, preference, other, unspecified) by keywords in the reason name (Shopify's Size Too Small, Size Too Large, Defective… arrive this way); when the reason is blank, Unknown or Other the customer's note is read and those units count in inferred_units. Also unlinked_returned_units (RMA units with no order link dated in the period: in the families, never in a rate; left out with a channel filter), size_related_units, size_related_rate (too small + too large + fit/width ÷ units sold), top_bucket and top_reasons (raw reason names). sort also accepts stockout_days, est_lost_units (needs stockouts) and size_related_return_rate (needs return_reasons). extras is echoed back.

Requires access to the Assortment Explorer report and the reports scope.

Request​

Responses​

OK

Response Headers
    Content-Type