Display quantity of items in stock via storefront API?

dnirns
Visitor
1 0 0

Hi,

I'm building a React storefront for a client using the Storefront API and am having trouble finding a value for the current stock quantity in the checkout from the product object gets returned from the API request. I can see the 'avaliable for sale' boolean, but I need to build a selection dropdown for quantities, limited to the amount of items in stock.

I might be missing something completely obvious, in which case - apologies, but it seems to be either missing from the response object, or I'm being completely blind?

attached is an example of a product:

Screenshot 2021-01-30 at 16.23.11.png

 

Thank you!

 

 

Replies 3 (3)

Not applicable

aaaa021-01-31 113907.png

Maybe you don't have that permission enabled.

nayelyr-idem
Tourist
6 0 1

Hi, I'm having the same problem. Did you manage to solve it? Thank you! 

sorin_12
Visitor
3 0 0

I have set the permissions and still getting the error. It seems to be a bug, maybe?