We have an application trying to order as much as possible (up to a given threshold) of a certain product using APIv2.
When 1475 pieces have been shown as available an order for that qty was submitted and an order number with status "PROCESSING" returned. However, the inventory interface continued to return 1475 available items (without a limit), so another order was created and so on. If I try to GET /store/orders/Txxxxxxxx
return status is 404.
This is unsatisfying for two reasons:
a) in another thread (Data Actualization TI API Inventory stock & Order API) I read this:
If you are using the /store/products/{tiPartNumber} API, yes, the inventory that is returned back is accurate, at the time that the API call executes.
Now this is exactly what we were doing before each order, but still the 1475 pieces have been returned every time.
b) if an order is created but not successfully completed I'd expect the API call to return order information with orderStatus: cancelled
instead of treating this order as if it never existed; codes 404 triggers error handlers on our end (invalid product/order number), whereas we would like to track the status once we have a valid order number.
What is the expected way to handle this task (order a given qty of a product with a smaller qty showing up as available)?