Hi,
I’m trying to use the wonderful new field in the Brew product api named: quantity_in_stock_in_format_by_site
My issue is that if I sum all the stock in format in the different sites as reported by this API call, I get a different total from the api field named:
quantity_in_stock_in_format
It seems that quantity_in_stock_in_format_by_site is subtracting ordered quantities (and so sometimes gives me negative stock) but quantity_in_stock_in_format is giving me all stock, including ordered stock.
Is this inconsistency intentional?
Hi Alastair,
Thanks for letting us know. No, this wasn’t intentional.
A fix for this is going live today.
Apologies for any inconvenience caused here.
Matt
Thanks - is there any way in the API to pull available vs total stock explicitly?
The quantity_available_theoretical_max_by_site field will explicitly pull available stock (including stock made available by disassembling other related products). The quantity_in_stock_in_format_by_site will be the current stock in that specific format, conversely not taking into account any undelivered orders placed for those items. Is this what you mean?
Kind of - I think I can make that work. So available_theoretical_max does take into account unavailable stock explicitly (including unfulfilled orders) but stock_in_format does not - is that a true statement?
That is true, yes. It follows the same design as the product page in the UI:
The theoretical max figure differs from the “Available” figure by 12, as there will be a 12-pack of this product that can be disassembled.