Changing inventory quantities by product API

Changing inventory quantities by product API

moazshorbagy
Visitor
1 0 1

I'm a developer and I'm trying to update stock quantity for a variant. It does not update the stock quantity and the request returns status code 200 with the old variant data (without updating it).

 

I'm sending a PUT request to url: https://{shopify_key}:{shopify_secret}@{shopify_url}/admin/api/2021-01/products/{product_id}.json

Request body:

{
    "product": {
        "id": "{product_id}",
        "variants": [
            {
                "id": "{variant_id}",
                "inventory_quantity": 10
            }
        ]
    }
}
Reply 1 (1)

georgebrejedev
Shopify Partner
1 0 0

So many questions on this topic and none of them are answered. Shopify can you stop ignoring this problem that persists until today?