MishaBook a demo

Aug 14, 2026

AI for Shopify Merchandising and Margin

Merchandising AI for ecommerce: systems that ingest transaction, refund, and discount data to calculate SKU-level margin contribution, identify refund patterns by product attributes, and flag discount leakage - then surface ranked lists for human assortment review.

Why SKU-Level Margin Visibility Matters

Most Shopify brands report revenue per SKU. Few report margin per SKU. The gap matters: a high-volume SKU with 35% refund rate and 25% average discount depth can destroy profitability even if top-line sales look strong.

Margin leakage happens in three places: refunds (cost of goods sold lost, shipping and processing costs sunk), discounts (price reduction without volume offset), and bundling (low-margin SKUs paired with high-margin ones to move inventory). AI surfaces these patterns at scale; humans decide whether to delist, reposition, or fix the product.

  • SKU contribution = (Revenue - COGS - Refund Cost - Discount Leakage) / Revenue
  • Refund cost includes COGS, inbound/outbound shipping, and restocking labor
  • Discount leakage = (List Price - Avg Selling Price) * Units Sold
  • Threshold: flag SKUs with <15% contribution margin or >25% refund rate for review

Connecting Transaction and Refund Data

AI systems need three data streams: Shopify order data (SKU, price, discount applied, customer segment), refund records (SKU, reason code if available, timing), and cost of goods (COGS per SKU, updated quarterly or monthly). Most brands have the first two in Shopify; COGS lives in spreadsheets or accounting software.

The connection point: ingest Shopify order and refund tables weekly, join on SKU and date, match COGS from a cost feed. Calculate refund rate (refunds / orders) and average discount depth (sum of discounts / sum of orders) per SKU, rolling 90 days. Flag outliers.

  • Export Shopify Orders API: order_id, line_item_sku, price, discount_amount, created_at
  • Export Shopify Refunds API: refund_id, line_item_sku, refund_reason, created_at
  • Upload COGS table: SKU, unit_cost, last_updated
  • Join on SKU; calculate refund_rate and avg_discount_depth; rank by margin contribution

Identifying Refund Clustering and Root Causes

Refund rates vary by product attribute - size, color, material, price tier. A size cluster (e.g., XL shirts) might have 40% refund rate while S and M are 12%. AI groups SKUs by shared attributes and flags clusters for investigation. The human decision: is it a fit issue (product description, size chart), a quality issue (supplier change), or a customer segment mismatch (wrong audience)?

Procedure: cluster SKUs by variant attributes (size, color, material, price range). Calculate refund rate per cluster. Compare to brand baseline. Flag clusters >5 percentage points above baseline. Assign to product or customer service team for root cause analysis.

  • Baseline refund rate = total refunds / total orders, all SKUs, 90 days
  • Cluster refund rate = refunds in cluster / orders in cluster, same period
  • Flag if cluster rate > baseline + 5 percentage points
  • Common causes: size fit (XL/XXL), color accuracy (dark dyes), material durability (thin fabrics), price sensitivity (high-ticket items)

Measuring and Stopping Discount Leakage

Discount leakage is the revenue lost when a SKU is discounted below list price without a corresponding volume lift. A 30% discount on a SKU that sells 10 units at full price and 12 units at 30% off is leakage: the extra 2 units don't offset the margin loss on all 12.

AI calculates discount depth per SKU and correlates it to volume change. If discount increases but volume stays flat or grows <10%, flag it as leakage. The human decision: remove the discount, restrict it to a specific customer segment (email list, loyalty tier), or bundle the SKU with a higher-margin item.

  • Discount leakage = (List Price - Avg Selling Price) * Units Sold
  • Calculate for each SKU: avg_discount_depth = total_discount_amount / total_orders
  • Compare volume in periods with discount vs. without (if available)
  • Flag if avg_discount_depth > 20% and volume growth < 10% YoY or MoM
  • Decision rule: remove discount if leakage > 15% of SKU margin

Assortment Review Workflow: AI Surfaces, Humans Decide

The output is a ranked list: SKUs sorted by margin contribution (lowest first), with refund rate, discount depth, and cluster membership. The merchandising team reviews the bottom 10 - 20% of the list monthly. For each SKU, the decision is: keep (no action), reposition (move to a different category or audience), fix (improve product description, size chart, or supplier), or delist (remove from catalog).

Timing: run the analysis weekly, review monthly. Delisting decisions should account for inventory on hand, supplier commitments, and customer lifetime value (a low-margin SKU might still serve a loyal segment).

  • Rank SKUs by margin contribution (lowest first)
  • Include: refund rate, avg discount depth, cluster membership, 90-day revenue, 90-day margin dollars
  • Review bottom 10 - 20% of list monthly
  • Decision options: keep, reposition, fix (product data or supplier), delist
  • Document decisions and re-evaluate quarterly

Avoiding False Positives: Seasonality and Cohort Effects

A high refund rate on winter coats in July is not a product problem - it's seasonality. A high refund rate on a new SKU in week one is not a trend - it's sample size. AI systems need filters to avoid flagging noise as signal.

Use rolling 90-day windows (not weekly snapshots). Exclude SKUs with <50 orders in the period (too small to trust). Account for seasonality by comparing to the same period last year, not the previous month. For new SKUs, wait 30 days and 100 orders before flagging.

  • Minimum threshold: 50 orders per SKU in 90-day window
  • For new SKUs: wait 30 days and 100 orders before flagging
  • Compare refund rates to same period last year, not previous month
  • Exclude clearance and seasonal SKUs from discount leakage analysis

Connecting Merchandising to Retention and AOV

Assortment decisions affect repeat purchase rate and average order value. Removing a low-margin SKU that serves a specific customer segment (e.g., gift buyers, first-time customers) can hurt retention. Repositioning a SKU (moving it from homepage to a collection page) can reduce visibility and sales without improving margin.

Before delisting, check: does this SKU appear in repeat customer orders? Is it a gateway product (low margin, high conversion) that drives AOV on subsequent orders? If yes, reposition or fix instead of delisting. If no, delisting is safe.

  • Calculate repeat purchase rate for customers who bought the SKU
  • Calculate AOV on customer's next order (if repeat purchase occurred)
  • If repeat rate > 20% or next-order AOV > 1.5x average, reposition instead of delist
  • If repeat rate < 10% and next-order AOV < average, delisting is low-risk

Questions

FAQ

How often should we review SKU margin contribution?

Run the analysis weekly to catch trends early, but schedule formal assortment review monthly. Weekly runs let you spot sudden spikes in refund rate or discount depth; monthly review prevents decision fatigue and accounts for natural variance.

What if a SKU has high refund rate but high repeat purchase rate?

High repeat rate suggests the product works for a specific segment despite the refunds. Investigate the refund reason code: if it's size/fit, improve the size chart or description. If it's damage in transit, improve packaging. Reposition or fix before delisting.

Should we apply the same margin threshold to all SKUs?

No. Gateway products (low margin, high conversion) and loss leaders (intentional margin sacrifice for volume) need different thresholds. Set baseline at 15% for core assortment, 8% for gateway products, 5% for seasonal clearance. Document the rationale.

How do we account for bundled SKUs in margin calculation?

Calculate margin per bundle as a unit, not per component SKU. If a bundle contains a low-margin SKU, the bundle's overall margin is what matters. If the bundle margin is healthy, keep the low-margin SKU. If not, either remove the SKU from the bundle or increase the bundle price.

Want this on your account?

Thirty minutes. Bring the number that keeps you up.

More from the blog