-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Preconditions and environment
- Magento version 2.3.1, probably all newer versions affected as well 2.4-development
Steps to reproduce
Call /rest/V1/products?searchCriteria API, look for extension_attributes and compare the output with the API documentation
Expected result
stock_item should be part of extension_attributes in product listing
Actual result
stock_item is available only on the product detail
Additional information
I'd like to reopen the discussion around already existing but closed issues:
#24418
#22737
The official API documentation for /rest/V1/products endpoint contains stock_item record in the extension_attributes. The stock_item is indeed part of the /rest/V1/products/{productSku} extension_attributes.
From the comment and code on one of the issues, it seems like the stock_item field will be removed in the future and /stockItems/{productSku} endpoint should be used instead.
Since it took us hours to find out that the documentation is invalid, I'd propose one of following:
- Fix the API docs to reflect that the
stock_itemis missing fromextension_attributes(although not ideal, the intent would be clear) - Add
stock_items(already tried in Fixed rest API products stockitem /V1/products?searchCriteria #22737 #28435, closed for inactivity)
Correct me please if the issue was fixed as I see #24418 in "status:done" (and I don't have a testing environment with the latest release) but I did not find any finished PR with the fix.
We'd highly prefer the option to get the stock_item information during product listing as we're integrating Magento with our ERP and right now we have to execute thousands of additional queries (I don't know of any bulk endpoint to retrieve the stock details for all products) but we can work with the workaround, fixing the docs would be enough if that's the agreed direction.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.