inventoryLevels Query Not Working - access_denied

Hello, I am using a simple webhook to query inventory levels:

x-request-id: 7bc860c8-7812-4b69-a70d-4ebecf20a762-1761257304

`mutation {
	bulkOperationRunQuery(
	 query: """
		{
		     products {
				edges {
				  node {
					id
					variants(first: 2) {
					  edges {
						node {
						  id
						  sku
						  price
						  compareAtPrice
						  title
						  inventoryPolicy
						  inventoryQuantity
						  inventoryItem {
							id
							inventoryLevels(first: 15) {
							  edges {
								node {
								  id
								  location {
									id
									name
								  }
								  quantities(names: ["available"]) {
									name
									quantity
								  }
								}
							  }
							}
						  }
						}
					  }
					}
				  }
				}
			  }
		}
		"""
	  ) {
		bulkOperation {
		  id
		  status
		}
		userErrors {
		  field
		  message
		}
	  }

}`

Keep getting “error_code”:“access_denied”,“status”:“failed”,“type”:“query”after it hits my webhook.

I have the following scopes enabled though:

  • write_inventory
  • read_inventory
  • read_inevntory_shipments
  • read_inventory_shipments_received_items
  • read_inventory_transfers

Everything works fine if I remove the inventoryLevels from the query

1 Like

Hey @Stats_Marketing,

The issue here is the location.name field. This field specifically requires additional scopes:

Hey @Stats_Marketing, did the above help clear this up?