Unable to update product using shopify api

Solved
Shopify Partner
6 0 0

I am updating a product using shopify api, getting error "Unprocessable Entity", I had spent a lot of time for finding the reason for it, all data seems to be correct. Can anybody please check logs and let me know what is the issue. My request id (found in headers) : a3ab65ba-39a2-4a72-8536-e3c7e2fca149

0 Likes
Highlighted

Success.

Shopify Staff
Shopify Staff
469 36 92

Hi there @codechefkk,

 

It looks like your variant ID's are not exactly matched up with the existing options on the product.  For example you are passing:

 

Variant ID: 29890067693665 for "Style 002", but "Style 002" actually belongs to ID 29890067726433, which your API call has listed as "Style 003".  For the most part it seems like each style is off by one of their actual IDs.

 

The 422 root cause is that the "Style 002" already exists etc, since the IDs you are providing don't line up with the names the API is trying to create new variants, which already exist.

 

Hope that helps,

Ryan

Developer Experience @ Shopify
0 Likes
Shopify Partner
6 0 0

Thankyou @Ryan, That was a quick and genuine response. That completely makes sense, will check the reason for the mismatching of Shopify variant ids.

0 Likes