Anchor to customerMergecustomer
mutationcustomer Merge
Requires access scope.
Merges two customers.
The and arguments don't guarantee which customer is kept. Shopify
selects the resulting customer in this order:
- If
is provided and valid, then the selected customer is kept. - If exactly one customer has an email address, then that customer is kept.
- If both customers have email addresses, then account state and email marketing consent determine
the customer that's kept: an
enabledaccount wins over other account states; otherwise, aninvitedaccount can win when consent doesn't already prefersubscribedorpending; otherwise the consent result is used. If those rules don't prefer either customer, thenis kept. - If neither customer has an email address, then
is kept.
Use and to check which customer will be kept before merging.
Anchor to Arguments
Arguments
- customerOneId (ID!)
- customerTwoId (ID!)
- overrideFields (CustomerMergeOverrideFields)
- Anchor to customerOneIdcustomer•ID!
One Id required The ID of one customer to merge. This customer isn't guaranteed to be kept.
- Anchor to customerTwoIdcustomer•ID!
Two Id required The ID of another customer to merge. This customer is kept when neither customer has an email address.
- Anchor to overrideFieldsoverride•Customer
Fields Merge Override Fields The field-specific overrides for default customer merge rules.
Was this section helpful?
- job (Job)
- resultingCustomerId (ID)
- userErrors ([CustomerMergeUserError!]!)
- •Job
The asynchronous job for merging the customers.
- Anchor to resultingCustomerIdresulting•ID
Customer Id The ID of the customer that's kept after the merge. Treat this ID as authoritative.
- Anchor to userErrorsuser•[Customer
Errors Merge User Error!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?