I have tried using this query in order to get access to products cost prices through GraphQL but I am having no luck I have found one other post regarding this and they mentioned that in order to access “inventoryItem” field there is a scope which needs to be granted to the private app in which can’t be done through the manage private apps section is there any other way I can get cost price through 1 GraphQL call or will this require an elevated REST call to get this information?
Happy to have a look at this for you. You would need at a minimum read access for the Inventory permission. Is the Inventory permission not listed under the Admin API Permissions for your private app?
Hey @_JCC yes Inventory permission is listed under the API permissions with “Read” access as we don’t want to be writing to it. We have gotten around this by using REST and more than one call to pull cost price by calling the /rproducts endpoint and then inventory_items endpoint but would be much better if this could be achieved through 1 graphQL request
If you’d like I can investigate this a little further. If you could make the GraphQL request again and provide me with the x-request-id returned in the response headers I’ll check the logs on our end.
Sorry for my late reply. Yes I had a chance to take a look and it looks like this request is coming from the Shopify GraphiQL APP. I don’t believe based on the logs that the GraphiQL app was installed with the necessary permissions to query the inventory cost. The GraphiQL App permissions can be updated using the Install URL.
on that store and it is providing the results I want however I am trying to figure out a way of fixing the overselling functionality for products so it goes of multi inventory location rather than combined location on the store with the x request id I gave you returned the correct response however we don’t have multi inventory setup for it currently. I want to run tests on our dev store and I tried running the exact query and got this response:
"message": "The server responded with invalid JSON, this is probably a server-side error",
"response": "\n\n\n \n \n \n\n\n\n \n \n
\n # The change you wanted was rejected.\n
Maybe you tried to change something you didn't have access to.
\n
\n
If you are the application owner check the logs for more information.
\n
\n\n\n"
}