shopify-admin-exchange-vs-refund-ratio
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "shopify-admin-exchange-vs-refund-ratio" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-5fba019c688421f21cc7f34cd49aa567045859ef6f35adb9825011421bab3a1b. Verify the upstream source and version against https://github.com/40RTY-ai/shopify-admin-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Read-only: track the percentage breakdown of exchanges, refunds, and store credit within returns to measure the composition of revenue recovery.
Introduction source: third_party · 40RTY-ai · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Read-only: tracks what percentage of returns become exchanges vs. refunds vs. store credit — measures revenue recovery rate.
- Inputs and outputs
- CSV file `exchange_refund_ratio_<YYYY-MM-DD>.csv` with columns: `return_id`, `order_name`, `resolution_type`, `exchange_sku`, `refund_amount`, `currency`, `created_at`
- Software, accounts and paid services
- Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_orders,read_returns` API scopes: `read_orders`, `read_returns`
- Testing
- Not tested
Browse files
Frontmatter
name: shopify-admin-exchange-vs-refund-ratio
role: returns
description: "Read-only: tracks what percentage of returns become exchanges vs. refunds vs. store credit — measures revenue recovery rate."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
- returns:query
- orders:query
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLIPurpose
Analyzes return resolutions to calculate the split between exchanges (revenue retained), store credit (revenue deferred), and refunds (revenue lost). Tracks this as a revenue recovery metric over time. Read-only — no mutations.
Prerequisites
- Authenticated Shopify CLI session:
shopify store auth --store <domain> --scopes read_orders,read_returns - API scopes:
read_orders,read_returns
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| days_back | integer | no | 30 | Lookback window for return resolutions |
| compare_days_back | integer | no | 0 | Optional prior period for comparison (0 = no comparison) |
| format | string | no | human | Output format: human or json |
Safety
ℹ️ Read-only skill — no mutations are executed. Safe to run at any time.
Workflow Steps
-
OPERATION:
returns— query Inputs:query: "created_at:>='<NOW - days_back days>'",first: 250, pagination cursor Expected output: Returns withrefunds { totalRefundedSet },exchangeLineItems, and resolution status -
Categorize each return resolution:
- Exchange: return has
exchangeLineItemswith quantity > 0 - Store credit: return has
refundswith gift card or store credit payment - Refund: return has cash/card refund with no exchange
- Exchange: return has
-
OPERATION:
orders— query (ifcompare_days_back > 0) Inputs: Same logic for prior period to compute trend
GraphQL Operations
# returns:query — validated against api_version 2025-01
query ReturnResolutions($query: String!, $after: String) {
returns(first: 250, after: $after, query: $query) {
edges {
node {
id
status
createdAt
totalQuantity
order {
id
name
}
exchangeLineItems(first: 10) {
edges {
node {
id
quantity
lineItem {
variant {
id
title
}
}
}
}
}
refunds(first: 5) {
id
totalRefundedSet {
shopMoney {
amount
currencyCode
}
}
}
returnLineItems(first: 20) {
edges {
node {
refundableQuantity
returnReason
}
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
# orders:query — validated against api_version 2025-01
query OrdersInPeriod($query: String!, $after: String) {
orders(first: 250, after: $after, query: $query) {
edges {
node {
id
name
totalPriceSet {
shopMoney {
amount
currencyCode
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
Session Tracking
Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║ SKILL: Exchange vs Refund Ratio ║
║ 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):
══════════════════════════════════════════════
EXCHANGE vs REFUND RATIO (<days_back> days)
Total returns resolved: <n>
Resolution breakdown:
Exchange (revenue kept): <n> (<pct>%)
Store credit (deferred): <n> (<pct>%)
Refund (revenue lost): <n> (<pct>%)
Revenue recovery rate: <pct>%
(exchanges + store credit as % of all returns)
Output: exchange_refund_ratio_<date>.csv
══════════════════════════════════════════════
For format: json, emit:
{
"skill": "exchange-vs-refund-ratio",
"store": "<domain>",
"period_days": 30,
"total_returns": 0,
"exchanges": { "count": 0, "pct": 0 },
"store_credit": { "count": 0, "pct": 0 },
"refunds": { "count": 0, "pct": 0 },
"revenue_recovery_rate_pct": 0,
"output_file": "exchange_refund_ratio_<date>.csv"
}
Output Format
CSV file exchange_refund_ratio_<YYYY-MM-DD>.csv with columns:
return_id, order_name, resolution_type, exchange_sku, refund_amount, currency, created_at
Error Handling
| Error | Cause | Recovery |
|---|---|---|
THROTTLED |
API rate limit exceeded | Wait 2 seconds, retry up to 3 times |
| No resolved returns in window | No completed returns in period | Exit with summary: 0 returns |
| Exchange line items empty but status indicates exchange | In-progress exchange | Count as pending, exclude from ratio |
Best Practices
- A revenue recovery rate above 30% (exchanges + store credit) is generally a strong signal for fashion/apparel; set your own benchmark based on category.
- Use
compare_days_backto track whether returns policy changes (e.g., "exchange only" periods) improved the recovery rate. - Pair with
return-reason-analysis— high "wrong size" return reasons paired with low exchange rates may indicate size guidance issues in product listings. - Run before and after launching an exchange incentive (e.g., bonus store credit for exchanging instead of refunding) to measure impact.
Version history
-
v1.1.0
GitHub ↗
Original release notes
## 🤖 New category: Agentic Commerce Readiness The fix-it side of the [**agentiq.report**](https://agentiq.report) audit. The audit tells operators *where* AI shopping agents (ChatGPT, Gemini, Perplexity, agentic checkout) can't find, read, or recommend their store. This release adds **10 skills that remediate those findings** via the native Shopify Admin GraphQL toolkit — closing the loop: **audit finds the gap → run the matching skill → re-audit confirms.** Every skill declares the audit **signals** it fixes (`audit_signals` frontmatter), so a finding in the report maps directly to the skill that resolves it. ### Skills - **`agentic-readiness-audit`** — flagship, read-only store-side scorecard that routes each gap to its fix skill - **`agentic-product-jsonld-backfill`** — barcode/GTIN, vendor, product type for complete Product JSON-LD - **`agentic-image-alt-text`** — descriptive alt text on product media - **`agentic-description-enrichment`** — fact-rich descriptions for AI quoting - **`agentic-metafields-setup`** — define + populate agentic metafields for filtering - **`agentic-product-taxonomy`** — Shopify Standard Product Taxonomy categories - **`agentic-crawler-access`** — allow GPTBot/ClaudeBot/PerplexityBot… in `robots.txt.liquid` - **`agentic-llms-txt`** — publish a curated `/llms.txt` for AI assistants - **`agentic-organization-schema`** — Organization JSON-LD (sameAs, contactPoint) into the theme - **`agentic-policy-readability`** — machine-readable shipping/returns policies Plus a weekly **`agentic-readiness-monitor`** routine that re-audits and alerts on regressions. ### Stats **116 skills across 11 categories** (was 106/10), **21 routines** (was 20). All GraphQL validated against the live Admin 2025-01 schema; `pnpm validate:index` passes (116 skills, 64 operations). ### Notes Theme-editing and policy skills default to `dry_run`/`audit` mode, write inside managed `# BEGIN/END` blocks, and recommend duplicating the theme first.
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决电商运营中高频刚需的收入挽回率分析问题
- 具有明确的业务价值和广泛受众
Highlights
- description 清晰描述功能边界
- frontmatter role 字段与功能匹配
Highlights
- 文档结构完整,章节齐全
- 有清晰的步骤划分和端到端示例
- frontmatter 完整且单文件长度适中
Highlights
- GraphQL 操作已验证 API 版本
- 覆盖了主要异常情况和恢复机制
- 输出格式明确且无不可逆操作
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_orders,read_returns` API scopes: `read_orders`, `read_returns`
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.