App reviews, troubleshooting, and recommendations
Hello, 👋
GET `/products/handle.json` return an JSON:
{ product: { id: 1, title: "title", body_html: 'body', vendor: "vendor", ... variants: [ { id: 1, product_id: 2, title: "variant title", ... }, ], ... }, }
JSON does not contain information about the variant's inventory quantity. How can I retrieve this data? I need it on the home page. I'm looking a solution for the Shopify theme app extension (I need this data in the app extension), so modifying the store's theme Liquid files is not an option.
Hi @Dzonotonas
You can refer to this video
https://www.youtube.com/watch?v=WMdYdvrFQ1s
The following GraphQL query retrieves inventory details for a specific product variant:
query GetVariantInventory {
productVariant(id: "gid://shopify/ProductVariant/43729076") {
id
title
inventoryQuantity
availableForSale
}
}
Make sure your app has the read_inventory access scope enabled to retrieve inventory data.
and also refer to here https://shopify.dev/docs/api/admin-graphql/2024-10/queries/productVariants
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025