Can not update product variant price with GraphQL

Solved
Highlighted
Shopify Partner
13 1 0

Hi, I'm facing an issue when I want to update my product variant price. The price can't be updated when the price is greater than the compare price.

 

ref: (https://shopify.dev/docs/admin-api/graphql/reference/mutation/productvariantupdate)

 

example:

 

current state:

price: 100

compare price: 200

 

then let say I want to update the price to 300 (price > compare price). This will not work.

 

 

 

Any idea for this case?

Thank you

 

0 Likes
Highlighted
Shopify Partner
13 1 0

Hi @Visely-Team , any thought for this case?

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 124

Hi @aldoalprak ,

 

This is not possible in either the GraphQL Admin API or the REST Admin API.

 

The compare at price needs to be higher than the actual Price.

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
13 1 0

This is an accepted solution.

Hi @hassain , thank you for your response.

 

Actually, it works with API version 2020-01 but it does not work with version 2020-04. But, why I can't find the API changelog about this? can you please refer to the link? thank you

 

edit: just found the link https://shopify.dev/concepts/about-apis/versioning/release-notes/2020-04

 

thanks

 

0 Likes
Highlighted
Excursionist
25 1 7

For the record, setting the value to null in the item payload works. I found it strange that I could leave the compare at price value <= the price value in the store itself, but not when creating via the api. And I didn't want to just set compare at prices arbitrarily higher than the price just to avoid the error, so I tried null at it seems to work.

0 Likes