Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Access denied for inventoryItem field. Required access: `read_inventory` access scope.

Access denied for inventoryItem field. Required access: `read_inventory` access scope.

Navdeep1
Shopify Partner
8 0 0

Though I have provided permissions of "read_inventory" then on still calling this query getting this error

{
  products(first: 5) {
    edges {
      node {        
        id
        legacyResourceId
        hasOutOfStockVariants
        handle
        tracksInventory
        totalInventory
        productType        
        variants(first: 5) {
          edges {
            node {
              inventoryQuantity
              sku
              id
              availableForSale
              title
              displayName 
              inventoryPolicy
              inventoryItem {
              	  id
              }
            }
          }
        }
      }
    }
    pageInfo {
      hasNextPage
    }
  }
}
Reply 1 (1)

Liam
Community Manager
3108 344 899

Hi Navdeep1,

 

Hi Navdeep1,

 

This does seem unusual - just a few questions to confirm: 

 

  • Which API version are you using?
  • Did you try refreshing your access token
  • Are you using a tool like Insomnia to make API calls - if so there could be some configuration settings you need to change.
  • Can you test making the same query in the GraphiQL app, or making queries to different objects with this app? 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog