Duplicate customers guide
How to merge duplicate Shopify customers in bulk
What you’ll need
Your customers export CSV
How to get this: Your customers export CSV
- Customers › Export › All customers (keep Customer tags ticked) › Export customers.
- More than 50 customers arrive by email.
Shopify’s free GraphiQL app (with read_customers, read_customer_merge, write_customer_merge access)
How to get this: Shopify’s free GraphiQL app
- Install it once from shopify-graphiql-app.shopifycloud.com: enter your store address, tick the access listed here, click Install and approve.
- Then open it any time from Apps › Shopify GraphiQL App in your admin.
Before anything
- Export all customers with tags as a backup.
- Try one merge on a development store first.
Preview (read-only)
customerMergePreview returns which profile would be kept, the fields that block the merge (notes over 5,000 characters, tags over 250) and errors such as subscriptions, store credit or a saved card. It needs read_customer_merge.
Merge
customerMerge needs write_customer_merge. It runs as a background job, so wait for it to finish before merging the same customer again. Setting overrideFields.customerIdOfEmailToKeep keeps the profile you chose.
mutation MergeCustomers {
g1_111_222: customerMerge(customerOneId: "gid://shopify/Customer/222", customerTwoId: "gid://shopify/Customer/111", overrideFields: { customerIdOfEmailToKeep: "gid://shopify/Customer/111" }) {
resultingCustomerId
job { id done }
userErrors { code field message }
}
}Things to know
- Orders, addresses, notes, tags and timeline move to the kept profile.
- If one profile is subscribed to marketing, the merged one is subscribed.
- Customers aren’t notified.
- Merges can’t be reversed.