Invalid Customer ID in admin Api

kevinLi
New Member
4 0 1

Hi,

 

I am trying to update Customer with the admin GraphQL API (https://shopify.dev/docs/admin-api/graphql/reference/customers/customerupdate)

it shows Error message of: userErrors":[{"field":["id"],"message":"Cannot specify ID on creation"}]}}

kevinLi_0-1619463939549.png

 

The id I am using is: gid://shopify/Customer/5041754013902

(I can access the customer with the ID through https://chenstoretest.myshopify.com/admin/customers/5041754013902).  

Full payload of the shopify customer object:

kevinLi_1-1619464027950.png

 

Can I get some help why it always throws an error with the given ID? 

Thanks!

Reply 1 (1)

_JCC_
Shopify Staff
200 27 55

Hey @kevinLi 

Happy to help you out with this.

It looks like from the error in the first screenshot, customerCreate is being executed instead of the customerUpdate mutation. Looks like you're using a 3rd party library or perhaps have created your own to assist with utilizing our admin api. If possible, I'd try and do the a customerUpdate from a tool like Insomnia or Postman just to verify the update mutation works. 

Let me know how you make out and if you have any other questions.

Regards,

John

John C | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog