I have checked the Shopify GraphQL API, and I have tried to update the product inventory on Shopify but when I execute the graphql API it says "
Inventory quantities cannot be updated with variants API
The mutation I am trying to run:
mutation productVariantsBulkUpdate(
$productId: ID!,
$variants [ProductVariantsBulkInput!]!
) {
productVariantsBulkUpdate(
productId: $productId,
variants: $variants
) {
product {
id
}
productVariants {
id
}
userErrors {
field
message
}
}
}
And the variable of this request
{"variants": {"inventoryQuantities": {"availableQuantity": 10,"locationId":"gid://shopify/Location/66027421902" },"id":"gid://shopify/ProductVariant/40747448828110" },"productId": "gid://shopify/Product/6899888488654"}
I have checked with the bulk update inventory but it is not what I need, how do I set (not adjust) the inventory level using the Shopify API?