Skip to content
woo-abandoned-cart-recovery logo

Woo Abandoned Cart Recovery

woo-abandoned-cart-recovery

Read-only: Query WooCommerce pending orders older than a configurable threshold and export a re-engagement list for abandoned cart recovery campaigns.

SKILL.md

Full skill instructions

woo-abandoned-cart-recovery

Purpose

Identify WooCommerce orders in pending status that are older than a configurable age threshold — these represent potential abandoned checkouts where payment was not completed. Export a list with customer email, cart value, and items for use in re-engagement email campaigns. Read-only — no orders are modified.

Note: Native WooCommerce does not expose shopping cart sessions via REST API. This skill uses pending orders as a proxy for abandoned checkouts, which is accurate for stores where WooCommerce creates the order before payment (the default checkout behavior).

Prerequisites

  • WooCommerce store with REST API enabled (WooCommerce → Settings → Advanced → REST API)
  • Consumer Key and Consumer Secret with Read scope
  • Store accessible over HTTPS
  • Minimum WooCommerce version: 3.5.0

Parameters

ParameterTypeRequiredDefaultDescription
store_urlstringyes—Base URL of the WooCommerce store (e.g., https://mystore.com)
consumer_keystringyes—WooCommerce REST API consumer key (ck_...)
consumer_secretstringyes—WooCommerce REST API consumer secret (cs_...)
dry_runboolnofalseNo effect — this is a read-only skill
formatstringnohumanOutput format: human or json
min_age_hoursintno1Minimum hours old for an order to be included
max_age_hoursintno72Maximum hours old — exclude very stale orders
min_cart_valuenumberno0Minimum order total to include
exclude_guestboolnofalseExclude guest (non-registered) checkouts
max_resultsintno500Maximum orders to include in export

Authentication

WooCommerce uses OAuth 1.0a for HTTP and Basic Auth over HTTPS.

For HTTPS stores (recommended):

Authorization: Basic base64(consumer_key:consumer_secret)

For HTTP stores (development only): Use OAuth 1.0a — include oauth_consumer_key, oauth_nonce, oauth_signature, oauth_signature_method=HMAC-SHA1, oauth_timestamp, oauth_version=1.0

Never log or output consumer_key or consumer_secret values.

See docs/​AUTHENTICATION.md for full setup instructions.

Safety

Read-only skill — no mutations are executed. Safe to run at any time.

Workflow Steps

Step 1 — Fetch pending orders within the age window

GET /​wp-json/​wc/​v3/​orders
  ?status=pending
  &after=<ISO-8601 timestamp of now - max_age_hours>
  &before=<ISO-8601 timestamp of now - min_age_hours>
  &per_page=100
  &page=1
  &orderby=date
  &order=desc

Extract per order: id, number, date_created, total, total_tax, customer_id, billing.first_name, billing.last_name, billing.email, billing.phone, line_items[].name, line_items[].quantity, line_items[].total

Paginate until response length < 100 or max_results is reached.

Step 2 — Filter by min_cart_value and exclude_guest

For each order:

  • Skip if total < min_cart_value
  • Skip if exclude_guest: true and customer_id == 0

Step 3 — Enrich with item summary

For each order, build a comma-separated item list: "Product A (x2), Product B (x1)"

Step 4 — Compute age

age_hours = (now - date_created) / 3600

Step 5 — Output and export

Emit summary counts and export CSV (see Output Format).

API Endpoints Used

GET  /​wp-json/​wc/​v3/​orders   — fetch pending orders with date range and status filter

Pagination Strategy

WooCommerce REST API uses page/​per_page pagination (not cursor-based).

Standard pattern:

page = 1
while True:
  response = GET /​endpoint?per_page=100&page=page
  process(response)
  if len(response) < 100: break
  page += 1

Maximum per_page is 100 for most endpoints. The X-WP-Total and X-WP-TotalPages response headers report totals. Always read X-WP-TotalPages on the first request to estimate job size.

Session Tracking

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

STARTUP:

╔══════════════════════════════════════════╗
║  SKILL: woo-abandoned-cart-recovery      ║
║  STORE: <store_url>                      ║
║  TIME:  <ISO-8601 UTC>                   ║
║  MODE:  READ-ONLY                        ║
╚══════════════════════════════════════════╝

PER-OPERATION (emit after each API call batch):

[N/​TOTAL] <METHOD> <endpoint> → <result_count> records | params: <key>=<val>

COMPLETION (human format):

╔══════════════════════════════════════════╗
║  COMPLETE: woo-abandoned-cart-recovery   ║
║  RECORDS PROCESSED: <n>                  ║
║  OUTPUT: <filename>                      ║
╚══════════════════════════════════════════╝

COMPLETION (json format):

{
  "skill": "woo-abandoned-cart-recovery",
  "store": "<store_url>",
  "completed_at": "<ISO-8601>",
  "records_processed": <n>,
  "output_file": "<path>",
  "dry_run": false
}

Output Format

Summary (human format):

ABANDONED CART RECOVERY — mystore.com
Window: 1h – 72h ago | Min value: $0 | 2025-04-14

  Total pending orders found:   83
  After filters (value/​guest):  71
  Total potential recovery:     $8,421.50
  Average cart value:           $118.61

  Age Distribution:
    1–12h:   42 orders   $4,810
    12–24h:  19 orders   $2,200
    24–72h:  10 orders   $1,411

  Top 5 by cart value:
    #5901  $542.00  [email protected]   2h 14m ago
    #5888  $398.50  [email protected]    5h 02m ago
    ...

  Exported: woo-abandoned-cart-recovery_2025-04-14.csv (71 rows)

CSV filename: woo-abandoned-cart-recovery_<YYYY-MM-DD>.csv Columns: order_id, order_number, date_created, age_hours, customer_id, first_name, last_name, email, phone, total, items_summary, is_guest

Error Handling

ErrorCauseResolution
401 UnauthorizedInvalid or missing credentialsVerify consumer_key and consumer_secret
403 ForbiddenConsumer Key lacks Read scopeRegenerate key with Read scope
429 Too Many RequestsRate limit hit during paginationWait 2 seconds and retry; reduce per_page to 50
Empty resultNo pending orders in windowAdjust min_age_hours / max_age_hours

Best Practices

  • Start with min_age_hours: 1 and max_age_hours: 24 to focus on the highest-intent window.
  • Import the CSV into your email platform (Klaviyo, Mailchimp, etc.) for automated cart recovery flows.
  • Run daily and deduplicate against already-contacted emails in your CRM.
  • For stores using WooCommerce Cart Abandonment Recovery plugin: that plugin has its own cart session data — this skill complements it with order-level data.
  • Segment by is_guest and total to prioritize high-value registered customers first.

More Marketing skills

copywriting logo
Marketing

copywriting

Marketing copy for homepages, landing pages, pricing pages, and other conversion-focused web pages.

53.3K 216.1K
View
flux-2-klein logo
Marketing

flux-2-klein

Fast image generation with Flux 2 Klein, optimized for sub-second iteration and multi-reference brand styling.

52 176.2K
View

Psychological principles and mental models for understanding customer behavior and influencing marketing decisions.

53.3K 153K
View

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
ai-seo logo
Marketing

ai-seo

Optimize content for discovery, citation, and visibility across AI search platforms and LLM assistants.

53.3K 136.7K
View
copy-editing logo
Marketing

copy-editing

Systematic improvement of existing marketing copy through seven focused editing passes.

53.3K 136.4K
View

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View
revops logo
Marketing

revops

Design and optimize systems connecting marketing, sales, and customer success into a unified revenue engine.

53.3K 104.9K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Convert websites into professional HyperFrames videos with guided storyboarding and brand-aligned composition.

57K 93.5K
View

Sales & marketing AI tools

KreadoAI logo
Sales & marketing

KreadoAI

Revolutionize Video Creation with AI-Generated Avatars and Voices

Paid
View
Followr logo
Sales & marketing

Followr

Social media on autopilot

Paid
View
Logodiffusion logo
Sales & marketing

Logodiffusion

Design custom logos instantly with AI.

Paid
View
I
Sales & marketing

Ideogram

Text-heavy marketing and design images

Freemium
View
Prompt Silo logo
Sales & marketing

Prompt Silo

Boost Your SEO with Content and SEO Silos

Free
View
Marketing Blocks logo
Sales & marketing

Marketing Blocks

Revolutionize Your Marketing with AI-Powered MarketingBlocks!

Paid
View
Scrip AI logo
Sales & marketing

Scrip AI

10X faster & free AI content creation for 100+ use cases

Free
View
Tribescaler logo
Sales & marketing

Tribescaler

Tribescaler | Make Your Tweets Go Viral

Paid
View