shopify-admin-customer-merge
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-customer-merge" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-eda57fbd813746a35e760ac50bbf9cff2e9e63fa23875f68da0f26771598fa14. 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
Merge duplicate customer records: invoke Shopify's native customer merge API when supported; otherwise, consolidate tags and notes from failed merge records into the winning record via customerUpdate.
Introduction source: third_party · 40RTY-ai · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Merges duplicate customer records: invokes Shopify's native customer merge API where supported, otherwise consolidates the loser record's tags and notes into the winner via customerUpdate.
- Inputs and outputs
- No CSV output. The session summary reports the merge job ID, the resulting customer GID, and which path was taken. For batch merges, run this skill once per pair and capture the JSON output.
- Software, accounts and paid services
- Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_customers,write_customers` API scopes: `read_customers`, `write_customers`
- Testing
- Not tested
Browse files
Frontmatter
name: shopify-admin-customer-merge
role: customer-support
description: "Merges duplicate customer records: invokes Shopify's native customer merge API where supported, otherwise consolidates the loser record's tags and notes into the winner via customerUpdate."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
- customer:query
- customerMerge:mutation
- customerUpdate:mutation
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLIPurpose
Resolves duplicate customer records identified by duplicate-customer-finder. Where the Shopify Admin API exposes customerMerge (a native merge that moves orders, addresses, subscriptions, and metafields onto a winner record), this skill calls it directly. When customerMerge is unavailable or fails for the given account pair, the skill falls back to consolidating searchable metadata — tags, notes, marketing consent — onto the winner via customerUpdate, then writes a clear annotation to the loser record so staff can complete the merge manually in Shopify Admin.
Prerequisites
- Authenticated Shopify CLI session:
shopify store auth --store <domain> --scopes read_customers,write_customers - API scopes:
read_customers,write_customers
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| format | string | no | human | Output format: human or json |
| dry_run | bool | no | true | Preview merge plan without executing mutations |
| customer_winner_id | string | yes | — | GID of the customer record to keep (e.g., gid://shopify/Customer/12345) |
| customer_loser_id | string | yes | — | GID of the customer record to merge into the winner |
| use_native_merge | bool | no | true | Try customerMerge first; if it fails or is unavailable, fall back to consolidation via customerUpdate |
| merge_tags | bool | no | true | Union the loser's tags onto the winner |
| merge_note | bool | no | true | Append the loser's note to the winner (with timestamp prefix) |
| annotate_loser | bool | no | true | Write a note on the loser record pointing to the winner GID for manual cleanup |
Safety
⚠️ Steps 2–4 execute mutations that modify customer records.
customerMergeis irreversible — once orders and addresses are moved to the winner, the loser record is closed and cannot be split back. Run withdry_run: truefirst to confirm winner/loser GIDs and the merge plan. The default isdry_run: true. Always verify both records belong to the same human (matching email, phone, name) usingduplicate-customer-finderoutput before committing. Do not merge a customer with active subscriptions or unfulfilled orders without confirming downstream systems will follow the new owner GID.
Workflow Steps
-
OPERATION:
customer— query (called twice: winner and loser) Inputs:id: <customer_id>, selectid,displayName,firstName,lastName,defaultEmailAddress { emailAddress },phone,tags,note,numberOfOrders,amountSpent,emailMarketingConsent { marketingState },smsMarketingConsent { marketingState },addresses(first: 25) { id },createdAtExpected output: Both records' full identity payload — abort if either GID does not resolve -
OPERATION:
customerMerge— mutation (only ifuse_native_merge: trueand notdry_run) Inputs:customerOneId: <customer_winner_id>,customerTwoId: <customer_loser_id>,overrideFields: prefer winner's name/email/phone/locale/marketing-consent Expected output:job.id(merge runs asynchronously),userErrors. IfuserErrorsindicates merge is not supported for this pair (B2B, gift card holder, subscriber, etc.), proceed to step 3 fallback. -
OPERATION:
customerUpdate— mutation (winner) — fallback path or whenuse_native_merge: falseInputs:input.id: <customer_winner_id>,input.tags: <union of winner.tags and loser.tags>(only ifmerge_tags),input.note: <winner.note + "\n[YYYY-MM-DD] Merged from <loser_email>:\n" + loser.note>(only ifmerge_note) Expected output:customer.id,customer.tags,customer.note,userErrors -
OPERATION:
customerUpdate— mutation (loser) — only ifannotate_loser: trueInputs:input.id: <customer_loser_id>,input.note: "<existing note>\n[YYYY-MM-DD] DUPLICATE — merge target: <customer_winner_id>. Manually close in Shopify Admin once orders are reviewed.",input.tags: <existing + ["duplicate", "merged-loser"]>Expected output:customer.id,customer.tags,customer.note,userErrors
GraphQL Operations
# customer:query — validated against api_version 2025-01
query CustomerForMerge($id: ID!) {
customer(id: $id) {
id
displayName
firstName
lastName
defaultEmailAddress { emailAddress }
phone
tags
note
numberOfOrders
amountSpent { amount currencyCode }
emailMarketingConsent { marketingState marketingOptInLevel consentUpdatedAt }
smsMarketingConsent { marketingState marketingOptInLevel consentUpdatedAt }
addresses(first: 25) { id address1 city provinceCode countryCodeV2 zip }
createdAt
}
}
# customerMerge:mutation — validated against api_version 2025-01
mutation CustomerMerge(
$customerOneId: ID!
$customerTwoId: ID!
$overrideFields: CustomerMergeOverrideFields
) {
customerMerge(
customerOneId: $customerOneId
customerTwoId: $customerTwoId
overrideFields: $overrideFields
) {
job { id done }
resultingCustomerId
userErrors { field message code }
}
}
# customerUpdate:mutation — validated against api_version 2025-01
mutation CustomerConsolidate($input: CustomerInput!) {
customerUpdate(input: $input) {
customer { id displayName tags note }
userErrors { field message }
}
}
Session Tracking
Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║ SKILL: Customer Merge ║
║ 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):
══════════════════════════════════════════════
CUSTOMER MERGE OUTCOME
Winner: <name> (<email>) Orders: <n> Spent: $<n>
Loser: <name> (<email>) Orders: <n> Spent: $<n>
Path used: <native|fallback|skipped>
Merge job: <id or "n/a">
Tags consolidated: <n>
Note appended: <yes/no>
Loser annotated: <yes/no>
Errors: <n>
Output: none
══════════════════════════════════════════════
For format: json, emit:
{
"skill": "customer-merge",
"store": "<domain>",
"started_at": "<ISO8601>",
"completed_at": "<ISO8601>",
"dry_run": true,
"winner_id": "<gid>",
"loser_id": "<gid>",
"outcome": {
"path": "native|fallback",
"merge_job_id": "<id or null>",
"resulting_customer_id": "<gid or null>",
"tags_consolidated": 0,
"note_appended": false,
"loser_annotated": false,
"errors": 0,
"output_file": null
}
}
Output Format
No CSV output. The session summary reports the merge job ID, the resulting customer GID, and which path was taken. For batch merges, run this skill once per pair and capture the JSON output.
Error Handling
| Error | Cause | Recovery |
|---|---|---|
THROTTLED |
API rate limit exceeded | Wait 2 seconds, retry up to 3 times |
customerMerge userError: customer has subscriptions |
Active subscription on loser | Cancel subscription before merge or use fallback path |
customerMerge userError: B2B customer |
Company-affiliated record | Use fallback path; manual merge in Shopify Admin |
customerMerge userError: gift card holder |
Loser owns gift card balance | Transfer gift card or use fallback path |
| Either GID not found | Wrong ID or deleted customer | Re-run duplicate-customer-finder |
| Merge job pending | Async merge not yet complete | Re-query Job(id) to confirm done: true |
Best Practices
- Always run
duplicate-customer-finderfirst to confirm the pair is genuinely duplicate. Manual misclassifications are unrecoverable. - Pick the winner deliberately: typically the record with more orders, the verified email, or the older
createdAt. Avoid making the marketing-consenting record the loser. - Run
dry_run: truefirst; the preview shows both records' order counts and spend so you can sanity-check before committing. - For large dedup runs, write a wrapper script that calls this skill once per pair and feeds it from
duplicate-customer-finder's CSV output — never batch merges in a single call. - After native merge, the
job.done: falseresponse is normal — Shopify processes merges asynchronously. Re-query the job ID until completion before assuming the loser is closed. - The fallback path (
customerUpdateconsolidation only) does not move orders. It preserves searchability via tags/notes so a human can finish the merge in Shopify Admin (Customers → Merge).
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
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Areas to improve
-
description重复 Reported severity: Minor
顶层 frontmatter 和 skill_body 内部均包含 description,存在冗余
Recommendation: 建议保留一处即可,避免维护不一致
Highlights
- 解决电商平台重复客户记录的实际业务痛点
- 支持原生 customerMerge API 和降级 customerUpdate 双路径
- 适用于客服、数据清洗等高频场景
Highlights
- 触发词精准完整,覆盖多种参数组合和边界情况
- description 清晰说明适用场景和限制条件
Areas to improve
-
缺少显式When to Use章节 Reported severity: Minor
文档未设置独立的 When to Use 章节
Recommendation: 建议在 Purpose 后增加显式 When to Use 章节提升可读性
-
文档较长 Reported severity: Minor
skill_body 约450行,虽结构清晰但仍偏长
Recommendation: 可考虑将部分 GraphQL 示例移至单独文件并通过引用方式引入
Highlights
- Phase/步骤清晰(4个主要操作),有明确的出口条件
- 包含端到端示例(GraphQL操作、输出格式)
- frontmatter完整,参数表格详尽
Highlights
- 工具来源明确(Shopify Admin API),参数正确
- 覆盖主要异常场景(THROTTLED、订阅冲突、B2B、礼品卡等)
- 不可逆操作有确认机制(dry_run默认true)
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_customers,write_customers` API scopes: `read_customers`, `write_customers`
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.