Updating customer email is duplicating account

New Member
2 0 0

Hi all,

 

We are experiencing a problem whereby if someone changes their email address on their account via a mobile app (that we have built), it is creating a new account rather than just updating their existing account. Could anyone help with this?

 

Thanks

0 Likes
Community Manager
Community Manager
495 21 53

Hi @Cheesegeek,

 

Are you using the following endpoint documented here?

 

https://help.shopify.com/en/api/reference/customers/customer#update

 

If a new account is being created, it sounds like you're making a POST request. 

 

If possible, can you provide more information?

 

Cheers,

0 Likes
New Member
1 0 0

Hello, and what about the graphql API? We are using the customerUpdate mutation here.

 

0 Likes
New Member
2 0 0

Thanks Busfox,

 

I'm actually working on this issue with Bartosz below - do you have any idea on the graphql API?We are using the customerUpdate mutation here.

 

0 Likes
Highlighted
Community Manager
Community Manager
495 21 53

Hi again,

 

Here's the mutation that worked for me.

 

mutation customerUpdate($input: CustomerInput!) {
  customerUpdate(input: $input) {
    customer {
      id
      email
    }
    userErrors {
      field
      message
    }
  }
}

{
  "input": {
    "id": "gid://shopify/Customer/123",
    "email": "email@gmail.com"
  }
}
0 Likes