Problems with setting backorder via REST API
-
We are reworking how our shop will function. And we are reimplementing the stock syncing mechanism.
Rules to it are simple:
- If there is stock in our CRM system, we sync the amount in stock. This part works fine, it syncs correctly.
- If there is no stock in our CRM but there is some stock at our b2b seller, we set the stock to 0, “stock_status” to “onbackorder” and “backorders” to “notify”.
- If there is no stock in our CRM and there is no stock at our b2b seller, we set the stock to 0, “stock_status” to “outofstock” and “backorders” to “no”.
The products in question all have “manage_stock” as True. I also made sure the data we are sending is correct, so variables are correctly named and the value is also correct.
Here are few examples of Python dictionaries, that are formated from the top rules:
{'stock_quantity': 25, 'stock_status': 'instock'}
{'stock_quantity': 0, 'stock_status': 'onbackorder', 'backorders': 'notify'}
{'stock_quantity': 0, 'stock_status': 'outofstock', 'backorders': 'no'}
For all of these the “stock_quantity” gets set correctly, but when it comes to backorder, the two extra variables don’t change. Also, all of the products are of simple type. Is my understanding of the API wrong?
- The topic ‘Problems with setting backorder via REST API’ is closed to new replies.