'Required parameter missing or invalid' on variant update

Shopify Partner
1 0 2


[removed original post since it was the product way while I'm going the variant one now, but the solution is the same; so, just to alleviate the thread:]

I'm trying to associate an image and a variant. For this, I'm going through the product API using the PUT method sending this JSON string:

    "variant": {
        "id": 27468625799,
        "image_id": 18410371463

But the Shopify response is: {"errors":{"product":"Required parameter missing or invalid"}}. So, I'm wondering what's the mandatory fields? Where is the place to read this kind of detail in the documentation. My data seems to comply what I read at https://help.shopify.com/api/reference/product_variant#update

EDIT: Solved! My "Content-Type: application/json; charset=utf-8" header was overriden at a point of my code! So, it was not a matter of JSON field, but a matter of HTTP request. Hoping it will help someone else a day...

Shopify Partner
3 0 0

Thanks, this was useful for me!