Skip to content

Rest API get stock_items with low stock not behaving like other get methods #8211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NotAndD opened this issue Jan 20, 2017 · 7 comments
Closed
Labels
bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: done Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@NotAndD
Copy link

NotAndD commented Jan 20, 2017

Preconditions

  1. Install Magento 2.1.3 with sample data.
  2. Set up Rest integration.

Steps to reproduce

  1. Retrieve stock_item list of low stock items sending a Rest request to /V1/stockItems/lowStock/ with method GET, query parameters scope_id and qty as specified in the documentation. Rest request like this: rest/default/V1/stockItems/lowStock/?scopeId=0&qty=10.

Expected result

  1. As for all other Rest methods available that returns a list taking filter parameters and as the documentation specify, if no page_size is given, all results of the query should be returned.

Actual result

  1. Only one stock item is returned, in addition, search_criteria has a different structure from other methods, with a limit field that is automatically set like this:
"limit": [
      "1",
      "0"
    ]

Notes

Either changing the documentation (fast solution) or even better, uniforming this method with all the other available methods, making it accept a filter and not only page filter parameters (page_size and current_page).

Additional info

  • Reproducible on Magento 2.4-develop
  • The way it can be reproduced via Swagger
  1. In your web browser open http://{magento2 instanse}/swagger#/integrationAdminTokenServiceV1/integrationAdminTokenServiceV1CreateAdminAccessTokenPost click Try it out
    try_it_out
  2. Set admin User name and Passwod and click Execute
  3. Copy the token from the Response body
    token
    and Paste it into api_key field in the top right corner. Click Apply
    api_key
  4. Open catalogInventoryStockRegistryV1 - GET /V1/stockItemslowStock clcik Try in out
    low stock_catalog
  5. Set scopeId to 0 qty to 10. Click Execute
    scope_qty

Actual Result:
limit

@veloraven veloraven added 2.1.x bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog labels Jan 20, 2017
@pboisvert pboisvert assigned pboisvert and misha-kotov and unassigned pboisvert Jan 23, 2017
@magento-engcom-team magento-engcom-team added 2.1.x bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team
Copy link
Contributor

@ziliquas, thank you for your report.
We've created internal ticket(s) MAGETWO-81168 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 11, 2017
@timpea
Copy link

timpea commented Mar 14, 2018

Is there any update on this bug?

@atsareva
Copy link

Any updates here?

@Hexmage
Copy link

Hexmage commented May 29, 2018

A workaround is setting the page_size parameter to a very large number.

@engcom-Bravo engcom-Bravo self-assigned this Dec 24, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 24, 2019

Hi @engcom-Bravo. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@engcom-Bravo engcom-Bravo added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Dec 24, 2019
@ghost ghost unassigned engcom-Bravo Dec 24, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Bravo
Thank you for verifying the issue. Based on the provided information internal tickets MC-30059 were created

Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@sdzhepa sdzhepa added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Sep 23, 2020
@gabrieldagama
Copy link
Contributor

These API is deprecated, please have a look at the documentation below to get more details on the new APIs that should be used instead:
https://devdocs.magento.com/guides/v2.4/inventory/index.html
https://devdocs.magento.com/guides/v2.4/inventory/catalog-inventory-replacements.html

Thanks.

magento-devops-reposync-svc pushed a commit that referenced this issue Apr 22, 2023
B2B-2451: Implement GraphQL Resolver Cache for cmsPage query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: done Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Archived in project
Development

No branches or pull requests