Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
40rty-ai avatar

Shopify Admin Partial Refund Pattern Detector

  • 2 installs
  • 173 repo stars
  • Updated June 26, 2026
  • 40rty-ai/shopify-admin-skills

shopify-admin-partial-refund-pattern-detector is a Claude Code skill that surfaces Shopify orders with multiple partial refunds or unusually high partial-refund-to-total ratios.

About

This skill scans recent Shopify orders, extracts every refund, and flags orders with two or more partial refunds or a high partial-refund-to-total ratio. It surfaces patterns that may indicate friendly fraud, chronic complaints, or a staff workflow gap, and groups flagged orders by customer to find repeat offenders. It is read-only and produces a dated CSV.

  • Surfaces orders with multiple partial refunds or high partial-refund-to-total ratios
  • Groups flagged orders by customer to find repeat offenders
  • Read-only market-signal report; outputs a dated CSV

Shopify Admin Partial Refund Pattern Detector by the numbers

  • 2 all-time installs (skills.sh)
  • Ranked #1,839 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
At a glance

shopify-admin-partial-refund-pattern-detector capabilities & compatibility

Free skill; requires an authenticated Shopify store session with read_orders scope.

Capabilities
refund pattern detection · fraud detection · refund analysis
Works with
github
Use cases
data analysis
Runs
Runs locally
Pricing
Bring your own API key
Requires keys
SHOPIFYSTOREADMINAUTHVIASHOPIFYCLI
From the docs

What shopify-admin-partial-refund-pattern-detector says it does

Scans recent orders, extracts every refund, and flags orders that have either (a) two or more partial refunds, or (b) a partial-refund-to-order-total ratio above a configurable threshold.
SKILL.md
Group flagged orders by `customer.id` to surface repeat-offender customers (more than one flagged order in the window).
SKILL.md
npx skills add https://github.com/40rty-ai/shopify-admin-skills --skill shopify-admin-partial-refund-pattern-detector

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
repo stars173
Last updatedJune 26, 2026
Repository40rty-ai/shopify-admin-skills

What it does

Detect suspicious partial-refund patterns across Shopify orders to flag fraud, complaints, or process gaps.

Who is it for?

Ops and finance reviewers hunting friendly-fraud, chronic-complaint, or piecemeal-refund workflow patterns.

Skip if: Issuing or reversing refunds; it only reads and flags, and flags are advisory.

When should I use this skill?

You want to find customers or orders with abnormal partial-refund behavior over a lookback window.

What you get

A dated CSV flags orders and repeat-offender customers by refund count and refund-to-total ratio.

  • CSV partial_refund_patterns_<date>.csv with order_total, total_refunded, refund_ratio, refund_count, flag_reason columns

By the numbers

  • 11-column output CSV
  • default 90-day lookback, min 2 partial refunds, 0.5 ratio threshold

Files

SKILL.mdMarkdownGitHub ↗

Purpose

Scans recent orders, extracts every refund, and flags orders that have either (a) two or more partial refunds, or (b) a partial-refund-to-order-total ratio above a configurable threshold. These patterns frequently indicate friendly fraud (incremental claims), an unhappy repeat customer pattern, or a staff workflow gap (refunding piecemeal instead of issuing one full credit). Read-only — no mutations.

Prerequisites

  • Authenticated Shopify CLI session: shopify store auth --store <domain> --scopes read_orders
  • API scopes: read_orders

Parameters

ParameterTypeRequiredDefaultDescription
storestringyesStore domain (e.g., mystore.myshopify.com)
days_backintegerno90Lookback window for orders to analyze
min_partialsintegerno2Minimum number of partial refunds to flag an order
ratio_thresholdfloatno0.5Flag orders where total refunded / order total exceeds this ratio (still partial, i.e. below 1.0)
min_order_valuefloatno25Skip low-value orders below this amount
formatstringnohumanOutput format: human or json

Safety

ℹ️ Read-only skill — no mutations are executed. Safe to run at any time. Flagged orders are advisory — confirm with refund notes and customer history before taking action against a customer account.

Workflow Steps

1. OPERATION: orders — query Inputs: query: "created_at:>='<NOW - days_back days>' financial_status:partially_refunded", first: 250, select refunds { id, createdAt, totalRefundedSet, note }, totalPriceSet, customer, pagination cursor Expected output: All partially refunded orders with full refund history; paginate until hasNextPage: false

2. For each order, count refunds and sum totalRefundedSet.shopMoney.amount. Compute ratio = total_refunded / order_total.

3. Flag orders meeting either condition: refund_count >= min_partials OR ratio >= ratio_threshold (and ratio < 1.0 so fully refunded orders are excluded).

4. Group flagged orders by customer.id to surface repeat-offender customers (more than one flagged order in the window).

GraphQL Operations

# orders:query — validated against api_version 2025-01
query PartialRefundPatterns($query: String!, $after: String) {
  orders(first: 250, after: $after, query: $query) {
    edges {
      node {
        id
        name
        createdAt
        displayFinancialStatus
        totalPriceSet {
          shopMoney {
            amount
            currencyCode
          }
        }
        totalRefundedSet {
          shopMoney {
            amount
            currencyCode
          }
        }
        refunds {
          id
          createdAt
          note
          totalRefundedSet {
            shopMoney {
              amount
              currencyCode
            }
          }
          refundLineItems(first: 50) {
            edges {
              node {
                quantity
                lineItem {
                  id
                  title
                  sku
                }
              }
            }
          }
        }
        customer {
          id
          displayName
          defaultEmailAddress {
            emailAddress
          }
          numberOfOrders
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Session Tracking

Claude MUST emit the following output at each stage. This is mandatory.

On start, emit:

╔══════════════════════════════════════════════╗
║  SKILL: Partial Refund Pattern Detector      ║
║  Store: <store domain>                       ║
║  Started: <YYYY-MM-DD HH:MM UTC>             ║
╚══════════════════════════════════════════════╝

After each step, emit:

[N/TOTAL] <QUERY|MUTATION>  <OperationName>
          → Params: <brief summary of key inputs>
          → Result: <count or outcome>

On completion, emit:

For format: human (default):

══════════════════════════════════════════════
PARTIAL REFUND PATTERN REPORT  (<days_back> days)
  Partially refunded orders:   <n>
  Flagged (multi-refund):      <n>
  Flagged (high ratio):        <n>
  Repeat-flagged customers:    <n>

  Top flagged customers by amount:
    <customer>  Orders: <n>  Refunded: $<n>  Ratio: <pct>%
  Output: partial_refund_patterns_<date>.csv
══════════════════════════════════════════════

For format: json, emit:

{
  "skill": "partial-refund-pattern-detector",
  "store": "<domain>",
  "period_days": 90,
  "partially_refunded_orders": 0,
  "flagged_multi_refund": 0,
  "flagged_high_ratio": 0,
  "repeat_flagged_customers": 0,
  "output_file": "partial_refund_patterns_<date>.csv"
}

Output Format

CSV file partial_refund_patterns_<YYYY-MM-DD>.csv with columns: order_name, order_id, customer_email, customer_lifetime_orders, order_total, total_refunded, refund_ratio, refund_count, flag_reason, first_refund_at, last_refund_at

Error Handling

ErrorCauseRecovery
THROTTLEDAPI rate limit exceededWait 2 seconds, retry up to 3 times
Order has refund but totalRefundedSet is zeroRefund recorded as $0 (note only, no money moved)Skip from ratio calc, count refund
Customer is null (guest order)No customer attachedGroup by email instead of customer ID
No partially refunded ordersClean windowExit with summary: 0 flagged

Best Practices

  • Combine min_partials: 2 and ratio_threshold: 0.5 for the most useful signal — single small partial refunds are usually legitimate.
  • Sort by refund_ratio descending: high ratios on high-value orders are the strongest fraud signal.
  • A repeat-flagged customer with numberOfOrders > 5 is often a chronic complainer, not a fraudster — review the refund notes before action.
  • Use this skill quarterly alongside order-risk-report to detect post-purchase fraud that fraud filters miss at checkout.
  • Refund note content frequently reveals the pattern (e.g., "item missing" repeated three times) — read the notes before flagging a customer.

Related skills

FAQ

What triggers a flag?

An order is flagged if refund_count >= min_partials (default 2) OR refund ratio >= ratio_threshold (default 0.5) while still below a full refund.

Does it act on customers automatically?

No, flagged orders are advisory; confirm with refund notes and customer history before taking action against a customer account.

Automation & Workflowsecommercefinance

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.