When you create an order through the Operator API, every item in the order must have enough stock for the order to succeed. If any item is out of stock, or has less stock than the quantity ordered, the whole order fails. This applies even when the other items are in stock with a different seller.
Note: This article covers orders created through the Operator API.
How stock is checked when an order is created
Marketplacer checks the stock level of every item in an order before creating it. All items must pass the check for the order to be created.
- Each item must have stock equal to or greater than the quantity ordered.
- Items with no stock can't be ordered, including as pre-orders.
A failed order isn't split or partially created. Marketplacer doesn't create invoices for sellers whose items are in stock, and doesn't automatically cancel the out-of-stock item.
Example: one seller's item is out of stock
A customer buys two items:
- Item A from Seller A, which is in stock
- Item B from Seller B, which is out of stock
The order fails. No order is created, and neither seller receives an invoice.
Options when an order fails
The Operator API returns a validation error when an order fails because of insufficient stock. To process the in-stock items, you can:
- Resubmit the order without the out-of-stock item.
- Create a separate order for each seller, so a stock issue with one seller doesn't block the others.
Note: Orders created through the Operator API are created after your storefront has taken payment. If an order fails, handle the customer's payment in your own system.
For technical details, see Creating orders on the Marketplacer developer portal.
Items that go out of stock after an order is placed
This article covers stock at the time an order is created. If an item was in stock when the order was placed but the seller can't fulfil it, the seller can cancel it before dispatch. You then approve the return to complete the refund.
Related articles
- Enable and use the returns module
- Approve a return
- Creating orders (Marketplacer developer portal)