Skip to main content
Lifetime license included with every purchase
n8n workflowsfraud detectionecommerce automationchargeback risk

n8n Order Fraud Detection: Score Every Order Before You Ship

Build an n8n order fraud detection workflow that scores every Shopify and WooCommerce order, catches COD risk, and gives a ship-or-hold verdict before you fulfil.

Nn8n Marketplace Team·October 11, 2026·Updated October 11, 2026·8 min read

A high-value order lands at 2am, ships to a freight-forwarder address, pays by card, and the phone number is one digit short of valid. Three weeks later it's a chargeback. The merchant eats the goods and the fee. Most stores find out when the bank does, not before.

n8n order fraud detection flips that timing. Instead of reviewing payments by hand or trusting a single opaque risk label, you score every order the second it lands, get a ship-or-hold verdict with a reason, and gate the risky ones before a courier ever touches them. The scoring runs in your own n8n instance, against rules you control.

The pages ranking for this term don't actually solve it. Shopify's own fraud analysis docs admit the score only covers "online credit card orders" and never explain the rules. The Greip + Shopify integration page is a marketing gateway with no workflow, no COD handling, and no ship/hold logic. Nobody ships a portable, rules-transparent triage flow. That's the gap.

What an order fraud workflow can automate

Fraud screening is a chain of small checks, and the expensive one is the decision to fulfil:

  • Score every new Shopify or WooCommerce order the moment it arrives.
  • Check a self-serve blocklist of known-bad emails and phone numbers.
  • Flag high-value, mismatched-country, disposable-email, and bad-phone signals.
  • Catch fake cash-on-delivery orders with a confirmation link before fulfilment.
  • Write a plain-English verdict explaining ship, review, or hold.
  • Alert the owner on Telegram with a one-glance recommendation.
  • Log every order and decision to Google Sheets for a full audit trail.

That's not a fraud button. It's a gate that runs before money and goods move.

Why a single risk score isn't enough

Here's the stance worth defending: trusting one platform's risk label is how stores get burned on the orders that label was never built to see. Shopify's machine-learned score is decent on card fraud and blind to everything else. It doesn't run on WooCommerce. It says nothing about COD, which is where a fake name and a throwaway number cost you the product and the return shipping.

A real triage flow scores signals you can read and weight. High order value relative to your average. A billing country that doesn't match the shipping country. A disposable-email domain. A phone that fails a format check. A buyer already on your blocklist. Each adds points; the total picks the verdict. When something flags, you see why, not just a color.

The COD case needs its own gate. Card fraud you can sometimes recover through the processor. A COD order shipped to a fake address is a pure loss, so the workflow emails a confirmation link first and only releases fulfilment when the customer clicks. Different fraud, different gate.

The order fraud pipeline

New order (Shopify/WooCommerce webhook)
        │
   Normalize fields (one shape for both platforms)
        │
   Pull blocklist from Google Sheets
        │
   Score rules in a Code node → risk total + reasons
        │
   AI verdict summary (plain English)
        │
   IF risk total ≥ hold threshold? ── yes ──► hold + Telegram alert
        │ no
   COD order? ── yes ──► confirmation email, wait for click
        │ no
   Ship + log decision to Google Sheets

The verdict exists before any fulfilment step. That ordering is the whole point.

Step-by-step breakdown

1. Trigger on the new order

A n8n-nodes-base.webhook node catches the order-created event from Shopify or WooCommerce. Both platforms POST order JSON, but the field names differ, so the next step normalizes them. The Webhook node's default response is fine here; the scoring happens after the response returns, so the store isn't waiting on you.

2. Normalize both platforms into one shape

A n8n-nodes-base.code v2 node with jsCode maps Shopify and WooCommerce payloads into a single object: email, phone, total, billing_country, shipping_country, payment_method, line_items. Now every downstream rule reads the same field regardless of source. Write the platform-specific mapping once and the rest of the workflow stays platform-agnostic.

3. Score the fraud signals

The same Code node (or a second one) runs the rules. Each signal adds to a running total:

let score = 0;
const reasons = [];
if (blocklist.includes(o.email)) { score += 100; reasons.push('blocklisted email'); }
if (o.total > HIGH_VALUE) { score += 25; reasons.push('high order value'); }
if (o.billing_country !== o.shipping_country) { score += 20; reasons.push('country mismatch'); }
if (DISPOSABLE.test(o.email)) { score += 30; reasons.push('disposable email'); }
if (!/^\+?\d{7,15}$/.test(o.phone)) { score += 15; reasons.push('invalid phone'); }
return [{ json: { ...o, score, reasons } }];

Keep the thresholds in a Config Set node so you tune weights without editing code. The reasons array is what makes the verdict explainable.

4. Write the plain-English verdict

The @n8n/n8n-nodes-langchain.openAi v2.1 node takes the score and reasons and writes a one-line recommendation a human reads in two seconds. Its output lands at $json.output[0].content[0].text. Don't skip the parse step if you ask for structured fields back; the model returns text and the next node expects an object, so a n8n-nodes-base.code v2 node converts it. The AI isn't deciding the verdict here, it's explaining the score the rules already produced.

5. Route, confirm, and log

An n8n-nodes-base.if v2 node compares the score against the hold threshold. Above it, the order routes to a Telegram alert and waits for a human. Below it, a second IF checks the payment method: COD orders get a confirmation email first, card orders pass straight through. Every order, every verdict, and every reason appends to Google Sheets so the decision is auditable a month later when the chargeback would have hit.

Implementation patterns

Pattern 1 — The transparent rules engine. Keep every threshold in one Config Set node (n8n-nodes-base.set v3.4) and reference it with ={{ $('Config').first().json.highValue }}. When a clean order keeps landing in review, you adjust one number, not the workflow graph.

Config (Set) → Code (score) → IF (verdict)
   weights         reasons        threshold

Pattern 2 — The COD confirmation gate. For cash-on-delivery, email a unique confirmation link and pause fulfilment until the click arrives. A fake address never confirms, so it never ships.

COD order → confirmation email → wait for click → release fulfilment

Pattern 3 — The owned blocklist. Pull a Google Sheets tab of known-bad emails and phones at the top of every run. When a fraud attempt slips through, you add the contact once and every future order checks against it automatically. You own this list, not a vendor.

n8n nodes you'll use most

NodePurpose
n8n-nodes-base.webhookCatch the order-created event from Shopify/WooCommerce
n8n-nodes-base.code v2Normalize fields and run the fraud-scoring rules
n8n-nodes-base.set v3.4Hold tunable rule weights and thresholds in one Config node
@n8n/n8n-nodes-langchain.openAi v2.1Write the plain-English ship/hold verdict
n8n-nodes-base.if v2Route by risk score and by payment method
n8n-nodes-base.googleSheets v4.5Pull the blocklist and log every decision
n8n-nodes-base.telegram v1.2Send the one-glance owner alert

Getting started

  1. Stand up the workflow on self-hosted n8n so the order data and blocklist stay on your instance.
  2. Add the Webhook node and register it as the order-created destination in Shopify or WooCommerce.
  3. Write the normalize-and-score Code node for your platform's payload shape.
  4. Put your fraud thresholds in a Config Set node and start conservative.
  5. Wire the IF verdict gate, the COD confirmation email, and the Telegram alert.
  6. Append every decision to Google Sheets, then watch the log for a week and tune weights.
  7. Skip the build below if you'd rather start from a tested flow.
Start from a working flow

Wiring fraud rules, a COD gate, and a blocklist from scratch is a half-day of fiddly logic. The OrderShield: High-Risk & Fake Order Triage template ships the whole thing: a normalize step for both Shopify and WooCommerce, the scoring Code node, the OpenAI verdict, the Telegram ship/review/hold alert, the COD confirmation email, and the Google Sheets audit log.

Browse the ecommerce templates →

Where this fits in your store

Fraud triage is one gate in a larger order flow. Once an order clears the risk check, it hands off to fulfilment and, if something goes wrong later, to returns. The same explainable-rules pattern that scores fraud also drives gated returns automation, where a blind auto-refund is the mirror-image mistake to a blind auto-ship. Stores running the full pipeline usually pair this with order fulfilment automation so the clean 80 percent ships untouched while the risky minority waits for a human.

Skip the build

The OrderShield Order Risk Triage template ships this end-to-end, including the dual Shopify/WooCommerce normalizer and the COD confirmation sub-flow that Shopify's native score can't touch. It's part of The Complete n8n Templates Bundle, a one-time lifetime license to the whole catalog plus every template added later, worth it if you run more than one of these automations.

Get OrderShield Order Risk Triage →

A store that scores orders before it ships them stops finding out about fraud from the bank. For the broader picture, see how this connects to ecommerce workflow automation across the whole order lifecycle, and pair it with the Stripe Failed Payment Recovery flow to catch revenue leaking on the payment side too.

See OrderShield in the catalog →
FAQ

Common questions

Can n8n detect fraudulent orders before they ship?
Yes. A webhook fires the moment an order lands, the workflow scores it against fraud rules (high value, mismatched country, disposable email, bad phone, blocklist hits), and an IF node routes it to ship, review, or hold before any fulfilment step runs. The score is computed in a Code node, so nothing downstream fires until the verdict exists.
Does this work for cash-on-delivery fraud, not just card fraud?
That's the gap most fraud tooling leaves open. Shopify's native risk score only covers online credit-card orders. For COD, the workflow emails the customer a confirmation link before you fulfil, so a fake address or throwaway number never reaches the courier. Card fraud and COD fraud need different gates, and the rules engine handles both.
How is this different from Shopify's built-in fraud analysis?
Shopify's fraud analysis is a black box that returns low, medium, or high for card orders. It doesn't expose its rules, doesn't cover COD, and doesn't run on WooCommerce. A self-hosted n8n workflow lets you write your own thresholds, keep a blocklist you control, and get a plain-English reason for every verdict instead of an opaque label.
What stops the workflow from flagging every order?
Tune the rule weights. Each signal adds points; the verdict thresholds decide where ship ends and hold begins. Start conservative, watch the Google Sheets log for a week, then raise the hold threshold if too many clean orders land in review. The log is the audit trail that tells you which rule is over-firing.
Stop reading. Start running.

Get the workflow templates this guide is built on

Import-ready n8n JSON, step-by-step setup, and tested end-to-end. One-time payment, own it forever.

Free — $40 value

Get 3 tested n8n templates, free

The full customer package for three real catalog templates — workflow JSON, step-by-step setup guide, credential checklist. Built through the same live-instance release process as everything we sell. Plus new templates and automation guides in your inbox. No spam, unsubscribe anytime.

  • 01Smart To-Do List ManagerPre-built n8n workflow template that automates productivity with OpenAI. Live in about 10 minutes.$14
  • 02Email Follow-Up AutomatorPre-built n8n workflow template that automates crm with OpenAI. Live in about 15 minutes.$12
  • 03Market Trend AnalyzerPre-built n8n workflow template that automates data processing with OpenAI. Live in about 10 minutes.$14