Updating with productVariantUpdate with inventoryQuantities has no effect bulkOperationRunMutation

Solved
fpablogeronimo
New Member
2 0 0

I am trying to update the quantity of a product variation in Bulk import data with the GraphQL Admin API (https://shopify.dev/api/usage/bulk-operations/imports)

I am supply only one of the supported GraphQL API mutations to the bulkOperationRunMutation at a time: productVariantUpdate.

 

mutation {
  bulkOperationRunMutation(
    mutation: "mutation productVariantUpdate($input: ProductVariantInput!) { productVariantUpdate(input: $input) { product { id } productVariant { id } userErrors { field message }}}",
    stagedUploadPath: "tmp/57428541610/bulk/06047023-7f7e-4c98-aca7-b2e033001ccd/bulk_op_vars") {
    bulkOperation {
      id
      url
      status
    }
    userErrors {
      message
      field
    }
  }
}

 

JSONL file in  tmp/57428541610/bulk/06047023-7f7e-4c98-aca7-b2e033001ccd/bulk_op_vars

 

{"input": {"id":"gid://shopify/ProductVariant/40953395314858","price":9536, "inventoryQuantities":{"availableQuantity":27,"locationId":"gid://shopify/Location/63249350826"}}}

 

Help!

Accepted Solution (1)

Accepted Solutions
csam
Shopify Staff
Shopify Staff
267 40 43

This is an accepted solution.

Hi @fpablogeronimo 

The endpoint that you're looking at is for importing bulk data only, not updating existing products. For updating your product variant inventory you'll want to use inventoryBulkAdjustQuantityAtLocation

You can read more about this here: 

https://shopify.dev/api/admin/graphql/reference/inventory/inventorybulkadjustquantityatlocation

 

CS | API Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 2 (2)
csam
Shopify Staff
Shopify Staff
267 40 43

This is an accepted solution.

Hi @fpablogeronimo 

The endpoint that you're looking at is for importing bulk data only, not updating existing products. For updating your product variant inventory you'll want to use inventoryBulkAdjustQuantityAtLocation

You can read more about this here: 

https://shopify.dev/api/admin/graphql/reference/inventory/inventorybulkadjustquantityatlocation

 

CS | API Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

lvorraro
Shopify Partner
4 0 1

Hi @fpablogeronimo @csam ,

 

I  have the same problem to update variant inventory quantity and i found inventoryBulkAdjustQuantityAtLocation.

The issue is:

If I need to update 50.000 inventory quantity (after a massive load of products), how can i use the service to update the inventory in bulk mode? How many items can I send into inventoryBulkAdjustQuantityAtLocation request? There is no limit described into API documentation.

The only limit that I have with bulk mutation is ONE BULK MUTATION AT TIME IN RUNNING, and with this limit I publish all products in one shot.

 

Thanks.