Ecommerce ops · Production

Shopify's machine learning playbook: scaling from order fraud detection to hundreds of products

The problem

Shopify's rule-based order fraud detection had a high false positive rate, forcing merchants to manually investigate flagged orders and causing them to cancel legitimate sales.

First attempt

The existing rule-based fraud system flagged orders whenever billing and shipping addresses differed, generating excessive false positives and prompting merchants to cancel valid orders.

Workflow diagram · grounded in source
1
Order placed at checkout
trigger
“In order to detect fraud as soon as an order is made, our system would have to do a real-time evaluation”
2
ML model scores order for fraud
ai_action
“What we shipped was a very simple logistic regression model, but that simplicity allowed us to ship quickly and show impact”
3
Risk-based routing before fulfillment
routing
“A merchant won't want to fulfill an order if it's a high risk of fraud. With this dependency in mind, we realized that we needed to detect fraud before an order is fulfilled: after would leave our prediction useless”
4
Human oversight of model anomalies
feedback_loop
“we still have humans in the loop to dig into any anomalies that are flagged”
Reported outcome

The ML fraud detection model beat the baseline and now processes millions of orders a day; the same approach was extended to hundreds of other Shopify products including Shopify Capital, product categorization, and Help Center search.

Reported metrics
Daily orders processedmillions of orders a day
Model performance vs baselinebeat the baseline
Reported stack
TrinoRuby on Rails
Source
https://shopify.engineering/shopify-playbook-scaling-machine-learning
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

The ML fraud detection model beat the baseline and now processes millions of orders a day; the same approach was extended to hundreds of other Shopify products including Shopify Capital, product categorization, and He…

What tools did this team use?

Trino, Ruby on Rails.

What results were reported?

Daily orders processed: millions of orders a day; Model performance vs baseline: beat the baseline (source-reported, not independently verified).

What failed first in this deployment?

The existing rule-based fraud system flagged orders whenever billing and shipping addresses differed, generating excessive false positives and prompting merchants to cancel valid orders.

How is this ecommerce ops AI workflow structured?

Order placed at checkout → ML model scores order for fraud → Risk-based routing before fulfillment → Human oversight of model anomalies.