Mutation ProductVariant, update price & stock qty with one request

Highlighted
New Member
1 0 0

Hello,

I want to update the inventory and price of a product variant on one request.

This is my GraphQL mutation :

 

mutation{
            ProductVariant0: productVariantUpdate(input: {
              id: "VARIANT_ID",
              price: "500",
              inventoryQuantities : 
              {
                locationId: "gid://shopify/Location/111111",
                availableQuantity: 1
            },
            }){
              productVariant{ id, price }
            },
        }

The response status is 200 but the inventory level does not update.
Any solution ?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
463 93 80

Hey @Maaax 

Have you gone through the tutorial here? https://shopify.dev/tutorials/manage-product-inventory-with-admin-api this explains indepth how to get the inventory item ID and update inventory, as well as the relationship between inventory + variants 

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


0 Likes