What's your biggest current challenge? Have your say in Community Polls along the right column.
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.

Re: Is there any way to add new access scope to checkout UI extension?

Solved

Is there any way to add new access scope to checkout UI extension?

remy727
Shopify Partner
44 2 26
Hi everyone!
When I try to retrieve quantityAvailable via Storefront API, I got this error.
Access denied for quantityAvailable field. Required access: `unauthenticated_read_product_inventory` access scope.
I know unauthenticated_read_product_inventory is not the access scope that extensions initially have.
Is there any way to add new access scope to checkout UI extension?
Looking for a Shopify App developer? Please contact me at remy.wang727@gmail.com
Accepted Solution (1)

lizk
Shopify Staff
246 58 78

This is an accepted solution.

Hi there 👋

At this time this scope is unavailable for the Storefront API via Checkout UI extensions. I have brought this to the attention of the team. You can also create a Github Issue requesting this scope be added. 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 6 (6)

lizk
Shopify Staff
246 58 78

This is an accepted solution.

Hi there 👋

At this time this scope is unavailable for the Storefront API via Checkout UI extensions. I have brought this to the attention of the team. You can also create a Github Issue requesting this scope be added. 

To learn more visit the Shopify Help Center or the Community Blog.

remy727
Shopify Partner
44 2 26

Got it. Thank you @lizk 

Looking for a Shopify App developer? Please contact me at remy.wang727@gmail.com
marcg500
Shopify Partner
3 0 1

Hi Lizk - any update on this? I would also like to be able to access this scope from Checkout UI extensions.

ginacostanzo
Shopify Partner
13 2 7

@lizk is there any update to this yet or are we still unable to access quantityAvailable in checkout UI extensions? 

frede-1994
Shopify Partner
8 0 5

Edit: found the docs stating what scopes are available in UI extensions: https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/configuration#api-access still seems weird not all of them are available. And the error message is just plain wrong then.

 

How do you figure out a scope is unavaliable for Checkout UI extensions? This is really confusing and I wasted a lot of time debugging this behaviour. Looking at the documention from my error messages ("Access denied for quantityAvailable field. Required access: `unauthenticated_read_product_inventory` access scope.") it seems like it should work if you add the access scope to the TOML file following https://shopify.dev/api/usage/access-scopes

And why are there some scopes unavailable or the Storefront API via Checkout UI extensions???

marcg500
Shopify Partner
3 0 1

@frede-1994 I opened an issue on github about this 7 months ago, maybe if you added a comment there it might help bump it up in priority:

https://github.com/Shopify/ui-extensions/issues/1594