Provide API to Adjust Stock Qty Only, Let Magento set Stock Status flag (Comply with .
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 357
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
### Description (*)
The [Backorders ](https://github.com/magento/inventory/wiki/Configure-MSI-backorders) functionality doesn't work ideally when using a third party ERP, etc to manage inventory. Magento has logic that allows you to have a 0 Qty, a negative Out of Stock Threshold, which then allows you to take backorders up to the Out of Stock threshold and then sets the Stock Status flag to Out of Stock once the qty goes below the Out of Stock Threshold.
But if you are using the [API](https://devdocs.magento.com/redoc/2.3/admin-rest-api.html#operation/inventoryApiSourceItemsSaveV1ExecutePost) to update stock qty, that api also requires setting the Stock Status, which then bypasses the Out of Stock Threshold functionality as it is supposed to make that determination.
### Expected behavior (*)
Make passing the Stock Status not required in the [API](https://devdocs.magento.com/redoc/2.3/admin-rest-api.html#operation/inventoryApiSourceItemsSaveV1ExecutePost) and have the API perform the Out of Stock Threshold logic after updating the stock qty value.
### Benefits
The Magento team already determined that negative Out of Stock Thresholds were valuable. It would just be nice to be able to take advantage of it when also publishing stock updates via the API.
### Additional information
I did see this [similar post](https://github.com/magento/inventory/issues/2745) from a couple of months ago. What I find interesting, is that people acknowledge he is updating the inventory via the API, and no one mentions that the API forces you to pass the Stock Status value (which is one of the main issues here....if Magento was going to determine the Stock Status, why would you have to pass it, and if you did, it would be weird if it was ignored.
Also the remarks in that thread seem to imply that this should work as they state it is not reproducible.
So either I'm missing an API that you can update stock qty without updating Stock Status or everyone is missing the point (which I'd doubt)...or I'm missing something else????
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked SourceItemsSaveV1ExecutePost inventory API documentation and compare its stock quantity and stock status inputs with the out-of-stock threshold behavior described here. Done means the API can update quantity without requiring a stock status, while the resulting status follows the threshold logic; the issue names no files or tests to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100