Ecommerce · Returns & risk
How we built a deterministic, explainable rules engine that scores Shopify return and refund requests, shows the reasons behind every score, and never declines a customer automatically.
Returns are a normal cost of selling online, but some of them aren't honest: serial returning, repeated "damaged" or "item not received" claims, refunds for goods that never come back, and a refund followed by a chargeback on the same order. Shopify's native return rules handle windows, fees and eligibility. They weren't designed to look across a customer's history at the moment a return request arrives.
So the checking falls to the support team, often in exported spreadsheets, one order at a time. Getting it wrong is costly both ways. Accusing a good customer can cost more than the refund, so many merchants simply approve everything.
We wanted to give the person deciding a return the context they're missing, without taking the decision away from them. Two constraints shaped Return Intelligence from the start. Every score had to be explainable down to the individual signal, and the product must never decline a customer automatically. That ruled out an opaque scoring approach. We built explainable return risk scoring on a deterministic rules engine instead. We often recommend the same for client internal tools where staff must be able to defend a decision.
The scoring engine is a pure, deterministic function, so the same inputs always give the same output. It combines nine signals: return frequency, refunds as a share of lifetime spend, repeated claim types, bracketing, refunds without a completed return, returns opened within hours of the delivery scan, multiple accounts at one address, high-value exposure and refund-plus-chargeback double dips. Each signal adds points to a 0 to 100 score in four bands. Every score stores its signals, raw values and confidence, plus the engine and rule-set version that produced it.
We built fairness in from the start. Bracketing is discounted for size-driven categories such as footwear and apparel. The shared-address signal is capped low and can be suppressed in one click for a legitimate household. Return frequency only applies once a customer has at least three orders. Confidence is calculated separately from risk, and below the merchant's confidence threshold every case goes to a person. No protected or demographic characteristics are used.
There is no automatic-decline option at any score or setting. Recommendations range from approve to urgent review, and declines are human decisions that cite the store's policy. The app starts in monitor mode, where it scores and records without touching Shopify returns. Rule changes can be previewed against open cases before saving, and each save creates a new versioned rule set. Email, phone and address are stored only as salted one-way hashes. See Return Intelligence for the full feature set.
Return Intelligence today imports up to 12 months of history through Shopify's bulk operations API and produces a leakage audit that shows its own formula for potential exposure. New return requests are scored as they arrive. New orders are scored against the buyer's history before they ship, and merchants can opt into a releasable fulfillment hold for the highest band. Staff work a score-sorted queue and see a "why this score" breakdown on every case. They can request evidence through a neutral upload page with duplicate-photo detection, and print a chargeback evidence pack with the full timeline. Results reach Shopify through order tags, metafields, an admin order block and a Flow trigger.
The product also reports on itself. It shows an approved-after-elevated-flag rate as a false-positive proxy, plus how often agents override its recommendation. We think a risk tool should show its own errors.
Our main lesson: explainability is a feature, not a compliance checkbox. An agent who can see which signals fired and how many points each added makes a faster, fairer call than one handed a bare number. We also learned that default weights are only a starting point. Each store needs to tune them, and that's why the preview tool exists. The same thinking shapes our reporting automation work.
How it's built
The engine is a pure function, so the same inputs give the same score, and every score records the rule-set version that produced it.
Each case shows the signals that fired, their point contributions and the raw values behind them in plain English.
There is no auto-decline option at any score or setting. Declines are human decisions that cite the store's published policy.
Thin customer history lowers confidence, and below the merchant's threshold every case goes to a person regardless of score.
Email, phone and address are stored only as salted one-way hashes, and customer data is never shared across merchants.
Lessons
Any system that scores people, whether for returns, credit, leads or disputes, needs more care than a typical automation. Here's what we'd tell a client.
If you're considering a scoring or triage tool, talk to us before you decide how it should work.
Live product · Shopify
Return Intelligence
How we designed a Shopify app that syncs supplier stock and prices from any file or API, shows a diff before writing, and refuses to import files it doesn't trust.
Read the storyHow we turned a Google Form, a serial-number spreadsheet and a claims inbox into one Shopify app that registers units, issues coverage and resolves claims with real Shopify objects.
Read the storyHow we designed a rep portal, territory rules and an append-only commission ledger on top of Shopify's native B2B, built so the numbers stay correct after refunds and edits.
Read the storyTell us how it works today. We'll tell you honestly what's worth automating, what it would take, and what it would cost.