Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
As per the Storefront API documentation (2022-10), only "unauthenticated_read_product_listings" is required to access quantityAvailable via the following request:
product(handle: $productH) {
variants(first: 100) {
edges {
node {
quantityAvailable
}
}
}
}
}
However, initial requests were rejected with an error informing me I need "unauthenticated_read_product_inventory" access scopes. When I added that exact access scope it worked, but I'm confused because the API docs didn't mention it and the complete list of Shopify access scopes doesn't list it.
Seems like this has been deprecated in the documentation but not on the backend? Just looking for clarification for myself and the community. Thank you.
hey, i just ran into this same problem.
i can use `availableForSale` to determine if a variant is out of stock -- but this bums me out because i was excited to do "only 2 left in stock!", but it looks like that's not possible due to this bug 😞
in addition to "quantityAvailable" throwing that error,
i am also getting an error for "totalInventory" on a products(query)
Access denied for totalInventory field. Required access: `unauthenticated_read_product_inventory` access scope.
I have the same problem, I don`t understand why is this now working. My permissions are set to access_product_inventory in my storefront api permissions.
FYI to anyone else coming across this problem... a Shopify staff developer mentioned here that this "unauthenticated_read_product_inventory" scope is not available to checkout UI extensions. Its annoying that Shopify wont update the community about this issue or mention this in the documentation.