Variant api updates and grams

Highlighted
New Member
2 0 0

We are having an issue where updating a variant through the api is causing the weight of the variant to be zeroed out.

 

We are not passing the grams field in our variant messages on the assumption that not supplying that field would leave it unaltered by the update. Looking at the update section in the variant api documentation that assumption would seem to be correct.

 

Is there some way we should handle this differently? Ideally the field wouldn't be altered by our update.

0 Likes
Highlighted
Shopify Partner
85 0 4

We are not passing the grams field in our variant messages

Are you 100% certain of this? If you're using a library that's abstracting away the XML, you might want to double-check by dumping the raw XML you're passing.

Also, what fields are you passing?

http://digitalcraftworks.com
0 Likes
Highlighted
New Member
2 0 0

We are not passing the grams field, but it turns out how we were updating the items was what was causing the problem.

 

We were sending the item and it's first variant and then sending all of the other variants later. This caused all of the existing variant records to be deleted and then recreated with the default values for everything we didn't set.

0 Likes
Highlighted
New Member
1 0 0

While updating the Variants, grams is not getting update. Could you please help to sort out this. Below is the sample request. Every fields are getting updated except grams using below request.

{"variant":{"weight":10,"sku":"00AA99-Platinum1","price":"30","option1":"Double Bandeaux-Platinum","metafields":[],"inventory_policy":"continue","id":"35375985918113","HS_code":"(9615.90) - Hair Accessories","grams":123.0}}

0 Likes