Some merchants use third-party inventory management services, and not all of them allow Shopify to track inventory.
In such cases, the inventory_policy is set to deny by default and inventory_quantity appears as 0, even though the third-party system may have sufficient stock. This makes it difficult to accurately determine the actual availability of a variant.
Additionally, the product/update webhook does not currently include the available_for_sale field at the variant level. Relying on a separate GraphQL query for every product update is resource-intensive and inefficient.
Would it be possible to include the available_for_sale field for variants in the product/update webhook? This would significantly improve our ability to track product availability accurately and reduce the need for costly API calls.
Hi,
Hope this will help
Set a cron job to pull variant data every few minutes/hours via GraphQL Admin API:
Code example
{
product(id: "gid://shopify/Product/123456789") {
variants(first: 10) {
edges {
node {
id
title
availableForSale
}
}
}
}
}
As mentioned earlier, relying on separate GraphQL queries is both resource-intensive and inefficient. This information is only required when a product is updated or an order is placed.
Including the available_for_sale field directly in the webhook payload would be a much more efficient and scalable solution.
It would indeed be beneficial for the product/update webhook to include the available_for_sale field at the variant level to streamline inventory tracking and reduce unnecessary API calls. Currently, this field is not included, and it can be resource-intensive to make separate queries to check product availability. You may want to submit a feature request to Shopify through their official support or development channels, as this would improve efficiency for merchants using third-party inventory systems