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

Shopify Admin Loyalty Segment Export

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

shopify-admin-loyalty-segment-export is a Claude Code skill that identifies high-lifetime-value Shopify customers by order count and spend, tags them, and exports a loyalty-ready contact list.

About

This Claude Code skill segments a Shopify store's highest-value customers by lifetime order count and total spend, tags the qualifying customers, and exports a loyalty-ready contact list. Marketing teams use it to build VIP or loyalty-program audiences from first-party Shopify customer data. It handles the data layer only; sending loyalty emails or managing rewards points requires an external tool.

  • Segments highest-value customers by order count and lifetime spend, then tags them in Shopify
  • Exports a loyalty-ready contact list for VIP campaign targeting or program enrollment
  • Configurable min_orders, min_spend, and tag; supports a dry_run preview

Shopify Admin Loyalty Segment Export by the numbers

  • 7 all-time installs (skills.sh)
  • Ranked #702 of 853 Sales & Marketing skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
At a glance

shopify-admin-loyalty-segment-export capabilities & compatibility

Free; requires read_customers and write_customers scopes on a Shopify CLI session.

Capabilities
customer segmentation · loyalty export · customer tagging
Use cases
marketing
Pricing
Free
From the docs

What shopify-admin-loyalty-segment-export says it does

Segments your highest-value customers by order count and total lifetime spend, tags them in Shopify, and exports a list ready for loyalty program enrollment or VIP campaign targeting.
SKILL.md
This skill handles the data layer; managing rewards points or sending loyalty emails requires an external tool.
SKILL.md
npx skills add https://github.com/40rty-ai/shopify-admin-skills --skill shopify-admin-loyalty-segment-export

Add your badge

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

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

What it does

Tag and export high-LTV Shopify customers as a loyalty or VIP segment.

Who is it for?

Building a VIP or loyalty segment from Shopify customers by lifetime order count and spend.

Skip if: Managing rewards points or sending loyalty emails; that requires an external tool.

When should I use this skill?

You want to identify and tag your most valuable customers for a loyalty or VIP campaign.

What you get

Qualifying high-LTV customers are tagged in Shopify and exported as a contact list.

  • Tagged high-LTV customers in Shopify
  • Exported loyalty-ready contact list

By the numbers

  • Default thresholds min_orders 3 and min_spend 200
  • 2-step workflow (customers query + tagsAdd mutation)

Files

SKILL.mdMarkdownGitHub ↗

Purpose

Segments your highest-value customers by order count and total lifetime spend, tags them in Shopify, and exports a list ready for loyalty program enrollment or VIP campaign targeting. This skill handles the data layer; managing rewards points or sending loyalty emails requires an external tool.

Prerequisites

  • Authenticated Shopify CLI session: shopify auth login --store <domain>
  • API scopes: read_customers, write_customers

Parameters

ParameterTypeRequiredDefaultDescription
storestringyesStore domain
formatstringnohumanhuman or json
dry_runboolnofalsePreview without tagging
min_ordersintegerno3Minimum lifetime order count
min_spendfloatno200Minimum lifetime spend (store currency)
tagstringnoloyalty-vipTag applied to qualifying customers

Workflow Steps

1. OPERATION: customers — query Inputs: filter orders_count:>=(min_orders), total_spent:>=(min_spend), first: 250, pagination Expected output: List with id, defaultEmailAddress { emailAddress }, firstName, lastName, ordersCount, totalSpentV2; paginate until hasNextPage: false

2. OPERATION: tagsAdd — mutation Inputs: Customer id, tag from tag parameter Expected output: Confirmation per customer; collect userErrors

GraphQL Operations

# customers:query — validated against api_version 2025-04
query LoyaltyCustomers($first: Int!, $after: String, $query: String) {
  customers(first: $first, after: $after, query: $query) {
    edges {
      node {
        id
        defaultEmailAddress {
          emailAddress
        }
        firstName
        lastName
        ordersCount
        totalSpentV2 {
          amount
          currencyCode
        }
        tags
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
# tagsAdd:mutation — validated against api_version 2025-01
mutation TagsAdd($id: ID!, $tags: [String!]!) {
  tagsAdd(id: $id, tags: $tags) {
    node { id }
    userErrors { field message }
  }
}

Session Tracking

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

On start, emit:

╔══════════════════════════════════════════════╗
║  SKILL: Loyalty Segment Export               ║
║  Store: <store domain>                       ║
║  Started: <YYYY-MM-DD HH:MM UTC>             ║
╚══════════════════════════════════════════════╝

After each step, emit:

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

If dry_run: true, prefix mutation steps with [DRY RUN] and do not execute.

On completion, for format: human:

══════════════════════════════════════════════
OUTCOME SUMMARY
  VIP customers found:  <n>
  Customers tagged:     <n>
  Errors:               <n>
  Output:               loyalty_segment_<date>.csv
══════════════════════════════════════════════

For format: json, emit the standard JSON schema with outcome keys: vip_customers_found, customers_tagged, errors, output_file.

Output Format

CSV loyalty_segment_<YYYY-MM-DD>.csv with columns: customer_id, email, first_name, last_name, orders_count, total_spent, currency, tag_applied

Error Handling

ErrorCauseRecovery
THROTTLEDRate limitWait 2s, retry up to 3 times
userErrors on tagsAddInvalid customer IDLog, skip, continue

Best Practices

  • Before running, check if customers already have the loyalty tag — add NOT tag:loyalty-vip to your query filter to skip already-enrolled customers.
  • Export and review the customer list before tagging if you're unsure about the threshold values — use dry_run: true to see the count, then adjust min_orders and min_spend before committing.
  • Combine with customer-win-back: tag high-LTV lapsed customers with both loyalty-vip and a win-back tag to identify your highest-priority re-engagement targets.

Related skills

FAQ

How does it define high value?

By min_orders (default 3 lifetime orders) and min_spend (default 200 in store currency); qualifying customers get the tag (default loyalty-vip).

Does it send emails?

No. It handles the data layer; managing rewards points or sending loyalty emails requires an external tool.

This week in AI coding

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

unsubscribe anytime.