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

Shopify Admin Abandoned Cart Recovery

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

shopify-admin-abandoned-cart-recovery is a Claude Code skill that queries abandoned Shopify checkouts, generates a unique discount code per customer, and tags them for re-engagement.

About

shopify-admin-abandoned-cart-recovery queries checkouts abandoned in the last N days, creates a unique discount code for each eligible customer, and tags them in Shopify for re-engagement. A store operator runs it to prepare a cart-recovery campaign; sending the actual email requires a separate tool. It executes mutations and supports a dry-run preview.

  • Finds abandoned Shopify checkouts and generates a unique discount code per customer
  • Tags eligible customers for follow-up campaigns
  • Runs mutations; supports dry_run preview before committing

Shopify Admin Abandoned Cart Recovery by the numbers

  • 7 all-time installs (skills.sh)
  • Ranked #1,587 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-abandoned-cart-recovery capabilities & compatibility

Free; requires an authenticated Shopify session with checkout, discount, and customer write scopes.

Capabilities
abandoned cart recovery · bulk customer tag update · automated order tagger
Use cases
marketing · email
Pricing
Free
From the docs

What shopify-admin-abandoned-cart-recovery says it does

Query checkouts abandoned in the last N days, generate unique discount codes per customer, and tag them for re-engagement.
SKILL.md
This skill handles the Shopify-native data layer (querying, discounts, tagging); sending the actual email requires an external tool.
SKILL.md
npx skills add https://github.com/40rty-ai/shopify-admin-skills --skill shopify-admin-abandoned-cart-recovery

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

Prepare a Shopify cart-recovery campaign by generating per-customer discount codes and tagging abandoned-checkout customers.

Who is it for?

Operators setting up a discount-driven abandoned-cart recovery campaign in Shopify.

Skip if: Sending the recovery emails themselves, which require an external email tool.

When should I use this skill?

You want to generate recovery discount codes and tag customers who abandoned checkout.

What you get

Unique discount codes created and cart-recovery tags applied to eligible customers, with a recovery list CSV.

  • Unique per-customer discount codes
  • Cart-recovery customer tags
  • recovery_list CSV

By the numbers

  • Default 7-day abandoned-checkout lookback
  • Default 10% discount per customer
  • Codes carry usage limit 1 and 30-day expiry

Files

SKILL.mdMarkdownGitHub ↗

Purpose

Identifies customers who started checkout but did not complete their purchase, generates a unique discount code for each one, and tags them in Shopify so they can be targeted in follow-up campaigns. This skill handles the Shopify-native data layer (querying, discounts, tagging); sending the actual email requires an external tool.

Prerequisites

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

Parameters

ParameterTypeRequiredDefaultDescription
storestringyesStore domain (e.g., mystore.myshopify.com)
formatstringnohumanOutput format: human or json
dry_runboolnofalsePreview operations without executing mutations
days_backintegerno7Lookback window for abandoned checkouts
min_cart_valuefloatno0Minimum cart total to include (USD)
discount_pctintegerno10Discount percentage to create per customer
code_prefixstringnoRECOVERPrefix for generated discount codes
tagstringnocart-recoveryTag applied to eligible customers

Safety

⚠️ Steps 2 and 3 execute mutations (discount code creation, customer tagging). Discount codes created via discountCodeBulkCreate cannot be bulk-deleted via the Admin API — they must be removed individually or via the price rule. Run with dry_run: true to verify eligible customer count before committing.

Workflow Steps

1. OPERATION: abandonedCheckouts — query Inputs: first: 250, query: "created_at:>='<NOW - days_back days>'", pagination cursor Expected output: List of checkout objects with email, totalPrice, createdAt, lineItems; paginate until hasNextPage: false

2. OPERATION: discountCodeBulkCreate — mutation Inputs: For each eligible customer email: a unique code {code_prefix}-{UUID[:8].toUpperCase()}, percentage discount discount_pct, usage limit 1, expiry 30 days Expected output: Confirmation of code creation with code and priceRule.id; collect userErrors

3. OPERATION: tagsAdd — mutation Inputs: Customer id (from checkout email lookup), tag string from tag parameter Expected output: Updated customer tags; collect userErrors

GraphQL Operations

# abandonedCheckouts:query — validated against api_version 2025-04
query AbandonedCheckouts($first: Int!, $after: String, $query: String) {
  abandonedCheckouts(first: $first, after: $after, query: $query) {
    edges {
      node {
        id
        customer {
          defaultEmailAddress {
            emailAddress
          }
        }
        totalPriceSet {
          shopMoney {
            amount
            currencyCode
          }
        }
        createdAt
        lineItems {
          edges {
            node {
              title
              quantity
              variant {
                price
              }
            }
          }
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
# discountCodeBulkCreate:mutation — validated against api_version 2025-01
mutation DiscountCodeBulkCreate($priceRuleId: ID!, $codes: [DiscountCodeInput!]!) {
  discountCodeBulkCreate(priceRuleId: $priceRuleId, codes: $codes) {
    bulkCreations {
      id
      done
    }
    userErrors {
      field
      message
    }
  }
}
# 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: Abandoned Cart Recovery              ║
║  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>

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

On completion, emit:

For format: human (default):

══════════════════════════════════════════════
OUTCOME SUMMARY
  Checkouts found:     <n>
  Eligible customers:  <n>
  Codes created:       <n>
  Customers tagged:    <n>
  Errors:              <n>
  Output:              recovery_list_<date>.csv
══════════════════════════════════════════════

For format: json, emit:

{
  "skill": "abandoned-cart-recovery",
  "store": "<domain>",
  "started_at": "<ISO8601>",
  "completed_at": "<ISO8601>",
  "dry_run": false,
  "steps": [
    { "step": 1, "operation": "AbandonedCheckouts", "type": "query", "params_summary": "last 7 days, cart >= $0", "result_summary": "<n> checkouts", "skipped": false },
    { "step": 2, "operation": "DiscountCodeBulkCreate", "type": "mutation", "params_summary": "<n> codes, 10% off, prefix RECOVER", "result_summary": "<n> created", "skipped": false },
    { "step": 3, "operation": "TagsAdd", "type": "mutation", "params_summary": "tag: cart-recovery", "result_summary": "<n> customers tagged", "skipped": false }
  ],
  "outcome": {
    "checkouts_found": 0,
    "eligible_customers": 0,
    "codes_created": 0,
    "customers_tagged": 0,
    "errors": 0,
    "output_file": "recovery_list_<date>.csv"
  }
}

Output Format

CSV file recovery_list_<YYYY-MM-DD>.csv with columns: customer_email, cart_total, abandoned_at, discount_code, discount_pct, tag_applied

Error Handling

ErrorCauseRecovery
THROTTLEDAPI rate limit exceededWait 2 seconds, retry up to 3 times
userErrors on discount creationInvalid price rule or duplicate codeLog error, skip customer, continue
userErrors on tagsAddCustomer ID not foundLog error, skip tag, continue
No email on checkoutGuest checkout without emailSkip checkout, do not count as eligible

Best Practices

  • Run with dry_run: true first and confirm eligible customer count — discount codes cannot be bulk-deleted via API and will persist in your price rules until manually removed.
  • Set min_cart_value to focus recovery effort on higher-value carts (e.g., 50 for $50+). Small carts often have lower recovery intent and may not justify a discount.
  • Use a unique tag per run (e.g., cart-recovery-2026-04-11) so you can identify exactly which customers were targeted in each campaign and avoid re-targeting them in subsequent runs.
  • The code_prefix should be meaningful to operators reviewing discount codes in Shopify Admin (e.g., CART10 for a 10% cart recovery discount).
  • This skill produces the data layer. Use Shopify Email or another email tool to send the generated codes to customers.

Related skills

FAQ

Does it send the recovery email?

No. It handles the Shopify data layer - querying, discount creation, and tagging - while sending the actual email requires an external tool.

Can I preview before creating codes?

Yes. Run with dry_run: true to verify the eligible customer count before the mutations execute.

This week in AI coding

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

unsubscribe anytime.