Skip to content

[Shopify-Connector-Bug]: Customers with similar email addresses will not be synced from BC to Shopify. #6459

@Kilian-Haar

Description

@Kilian-Haar

Describe the issue

We have found the problem that customers with a similar email address, who are synchronized from BC to Shopify, are not being created in Shopify.

Expected behavior

I've investigated the behavior you're experiencing, and I've identified the cause. The email field in the Shopify Admin API customer search is a tokenized field. This means that when you search without quoting the email address, the search performs partial matching on individual parts of the email (like "mail", "test", and "ch") rather than matching the exact email address.

In your case, the query email:mail@test.ch was matching the customer with email claro-murten@bluewin.ch because both emails share common tokens. This is expected behavior based on how the search syntax works.

The Solution:

To perform an exact email match, you need to wrap the email address in quotes. Here's the corrected syntax:

GraphQL Query:
{
customers(first: 1, query: "email:"mail@test.ch"") {
edges {
node {
id
email
}
}
}
}
JSON Payload:
{"query": "{ customers(first: 1, query: "email:\"mail@test.ch\"") { edges { node { id email } } } }"}

The key change is adding escaped quotes (\") around the email address in your JSON payload. This ensures the API performs an exact phrase match rather than a tokenized search.

Steps to reproduce

Synchronize new customers from BC to Shopify, where several customers with a similar email address already exist.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Contribution-BugSomething isn't working in the contribution process

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions