Skip to main content
Anchor to customerMergePreview

customerMergePreview

query

Requires read_customer_merge access scope.

Returns a preview of a customer merge request.

The customerOneId and customerTwoId arguments don't guarantee which customer is kept. Shopify selects the resulting customer in this order:

  1. If overrideFields.customerIdOfEmailToKeep is provided and valid, then the selected customer is kept.
  2. If exactly one customer has an email address, then that customer is kept.
  3. If both customers have email addresses, then account state and email marketing consent determine the customer that's kept: an enabled account wins over other account states; otherwise, an invited account can win when consent doesn't already prefer subscribed or pending; otherwise the consent result is used. If those rules don't prefer either customer, then customerTwoId is kept.
  4. If neither customer has an email address, then customerTwoId is kept.
•ID!
required

The ID of one customer to merge. This customer isn't guaranteed to be kept.

•ID!
required

The ID of another customer to merge. This customer is kept when neither customer has an email address.

•CustomerMergeOverrideFields

The field-specific overrides for default customer merge rules.


Was this section helpful?

Anchor to CustomerMergePreviewCustomerMergePreview
•CustomerMergePreview!

A preview of the results of a customer merge request. Use resultingCustomerId to check which customer would be kept before running customerMerge.

•CustomerMergePreviewAlternateFields

The fields that can be used to override the default fields.

•CustomerMergePreviewBlockingFields

The fields that will block the merge if the two customers are merged.

•[CustomerMergeError!]

The errors blocking the customer merge.

•CustomerMergePreviewDefaultFields

The fields that will be kept if the two customers are merged.

•ID

The ID of the customer that would be kept if the two customers were merged.


Was this section helpful?