Unprocessable Entity When I Try To Update Variant's Price

Solved
mirzaloglu
New Member
2 1 1

I am doing PUT request to this url:

https://username:password@shopName.myshopify.com/admin/api/2020-07/variants/5117002383495.json

For update a price. This is what i sent to this URL:

{"variant":{"id":5117002383495,"price":"161.00","inventory_management":"shopify"}}

 

But i get (422) Unprocessable Entity. Help me please.

0 Likes
BStubbs
Shopify Partner
124 14 45

Hi @mirzaloglu ! Welcome to the Shopify Community forums.

422 Error is a pain with Shopify. Its a bit of a catch all error, especially when dealing with Products.

I can't seem to replicate the issue with my own dev store, so it could be in the way you are constructing your PUT call? Can you do the operation with something like Postman to check that the actual call works? If it does, then there is an issue with your code.

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
mirzaloglu
New Member
2 1 1

This is an accepted solution.

I finally solved it!

 

Price can't be higher than compare at price! That was the problem.

 

Thank you.

BStubbs
Shopify Partner
124 14 45

Ah ha!

Good one!

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!