Skip to content
DEV BY SALDEV BY SAL
Case studiesLoblaws
LOBLAWSGrocery Retail / E-commerce2025

Real-time substitution intelligence for PC Express

Loblaws PC Express runs at a scale where a single percentage point of "rejected substitution" costs millions of dollars in lost basket value. We shipped a real-time substitution intelligence service that picks better stand-ins mid-pick, cutting customer-initiated rejection by 17% across a national rollout.

Substitution rejection
↓ ~17%
Stores live
~1,400
Decisions/day
6M+
p95 latency
<80ms
LOBLAWSPC Express
Store 1188 · Maple Leaf Gardens·Shopper: Aaliyah K.

Order #PCX-08842

Your PC Express order

Delivering Sat, 10:00 – 12:00 · 28 items · 2 need your review

Cart total

$182.46

Picking · 22 / 28 itemsETA 14 min

Items in this order

AllReview (2)Packed

Astro Original yogurt 750g

Out of stock · suggested PC Organic Plain 750g94% match

Needs review

Heinz Beans 398mL

Out of stock · suggested PC Beans in Tomato 398mL88% match

Needs review

PC organic bananas

1.2 kg · Packed by shopper

Packed

Olympic Greek yogurt 500g

2 · Packed by shopper

Packed

PC free-range chicken thighs

2.4 kg · Packed by shopper

Packed

Sourdough loaf, Ace Bakery

1 · Packed by shopper

Packed

Why this substitution?

Astro Original → PC Organic Plain
You accepted this swap 4× before
96%
Similar protein + fat profile
91%
In stock at this store right now
100%
Within your usual price band
87%

Delivery window

Sat, Mar 22

10:00 – 12:00

Free

Sat, Mar 22

12:00 – 14:00

Free

Sat, Mar 22

14:00 – 16:00

$3.99

PC Optimum

+940 pts

on this order ($9.40 value)

Balance · 24,180 pts·$241.80

This week's substitutions

Rejection rate, your basket

Your rejection

6%

Avg shopper

23%

The brief

For online grocery, the moment a personal shopper picks up the customer's order, the application stops being a website and starts being an operations product. Every out-of-stock SKU is a real-time decision: pick a substitute, ask the customer, or skip the item entirely. Loblaws was losing customers at this exact moment.

The bet: a real-time scoring service that learns from acceptance history across millions of orders can choose substitutes that customers overwhelmingly accept — without slowing the shopper down or requiring a new app for the shopper to learn.

What we built

A standalone substitution intelligence service in Go, sitting on the hot path between the shopper's handheld and the order. When the shopper marks a SKU out-of-stock, the service returns a ranked substitute list inside 80 milliseconds at p95, scored against:

  • Customer-level history (what this customer has accepted before).
  • Order-level context (what else is in the basket; what dietary signal it implies).
  • Store-level inventory (what is genuinely on the shelf right now).
  • Category-level acceptance baselines (what anyone accepts as a substitute for this SKU).

The shopper sees the top suggestion as a single tap. The customer sees, in their app, the explicit reasoning behind the substitution and a one-tap reject — which feeds back into the model.

Roll-out was instrumented as a city-by-city A/B against the legacy heuristic, so the lift was measured under real load, not in a back-test.

Outcome

Customer-initiated substitution rejection dropped by ~17% across the national footprint of roughly 1,400 stores. The service handles 6 million substitution decisions a day, well under its latency budget. Basket abandonment from "too many substitutions" — the legacy worst-case — fell from a meaningful tail behavior to a rounding error.

The model retrains nightly on the previous day's acceptance signal, keeping it adaptive to seasonality and promotional shifts without manual tuning.

"Substitution was one of the few places where we were silently losing customers every weekend. It is now one of the places we're winning them."