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
    1. Customers › Export › All customers (keep Customer tags ticked) › Export customers.
    2. More than 50 customers arrive by email.

    Step-by-step guide (opens in a new tab)

  • Shopify’s free GraphiQL app (with read_customers, read_customer_merge, write_customer_merge access)

    How to get this: Shopify’s free GraphiQL app
    1. Install it once from shopify-graphiql-app.shopifycloud.com: enter your store address, tick the access listed here, click Install and approve.
    2. Then open it any time from Apps › Shopify GraphiQL App in your admin.

    Step-by-step guide (opens in a new tab)

Preview and merge pairs

Before anything

  1. Export all customers with tags as a backup.
  2. 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.

One merge
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.

More guides