Access denied for quantityAvailable field. Required access:unauthenticated_read_product_inventory

Access denied for quantityAvailable field. Required access:unauthenticated_read_product_inventory

Sanchari
Shopify Partner
6 0 2

I am developing an app with checkout UI extensibility, where I am calling a graphQL API to fetch the the product and it variants. I need the field "quantityAvailable" for the variant. 

Here I am sharing the query:

query {
        product(id: "${lineProductID}") {
          id
          title
          totalInventory
          variants(first: 10) {
            edges {
              node {
                id
                title
                quantityAvailable
                availableForSale
                requiresShipping
                sku
              }
            }
          }
        }
      }
 
It is throwing the error in response:
message
: 
"Access denied for quantityAvailable field. Required access: `unauthenticated_read_product_inventory` access scope."
Here I am sharing my apps access scope which I have in the shopify.app.toml file:
# This file stores configurations for your Shopify app.

scopes = "read_orders,write_orders,write_products,read_products,read_inventory,read_product_listings,unauthenticated_read_product_inventory,unauthenticated_read_product_listings,unauthenticated_read_collection_publications,unauthenticated_read_product_publications,unauthenticated_read_product_tags,unauthenticated_read_selling_plans,unauthenticated_read_collection_listings"
Please help me to resolve the issue. It is urgently needed.
 
Replies 5 (5)

jejo
Shopify Partner
5 1 2

Did you find a solution to this?

dviedma
Shopify Partner
2 0 0

@Sanchari  I got the same exact error trying to access "quantityAvailable": it complains about missing "unauthenticated_read_product_inventory" access, yet I can see it there in the apps' scopes. Did you figure out the solution? Thanks. 

jejo
Shopify Partner
5 1 2

Hey!


I solved this. You have to check this field in your headless plugin settings.

dviedma
Shopify Partner
2 0 0

Sorry which field?

Sanchari
Shopify Partner
6 0 2

I am not using any headless plugin