With inventory tracking on, every item is placed at a warehouse before shipping is rated, and an item that cannot be placed stops the call before any rate is created. Creating shipping then answers 422 with code STOCK_UNPLACEABLE, a message that names the items, and unplaceable: one entry per item, with the quantity requested, the quantity available and a reason. Creating the checkout answers the same way when no warehouse holds enough of an item, or all of them together hold too little, and the cart warns about that item first: "Only 1 in stock", or "Only 1 can be sent from one location". A delivery that no single warehouse can send answers like this:
Answer
Commerce
Checkout says some items cannot be fulfilled
JSON
{
"result": "error",
"code": "STOCK_UNPLACEABLE",
"message": "Some items cannot be fulfilled from a single location: TSHIRT-M (requested 3, available 1)",
"unplaceable": [
{"productCode": "TSHIRT-M", "requested": 3, "available": 1, "itemId": 812, "reason": "stock"}
],
"canCollectFromMultipleWarehouses": false
}
Read the reason of each entry, then:
stock: no single warehouse holds enough. A delivery leaves from one warehouse that holds the whole order, so an item is listed when no one warehouse can send everything, even if the warehouses hold enough between them. In a shipping answer,availableis what one warehouse can send: the chosen warehouse for click and collect, or for a delivery the warehouse that comes closest to holding the whole order. Lower the quantity toavailable, remove the item, or move stock so that one warehouse holds the order. Under Transactions › Inventory › Stocks, units held for paid orders that have not shipped, and for checkouts being paid for, count as Reserved, not as available.no_eligible_warehouse: no shipping method can send it. The message reads "… cannot be shipped to this address with the available shipping methods", or for click and collect "… cannot be collected from this location". Check that an active method carries the product's shipping category (or the Default shipping category), that its group's Type serves the checkout's delivery or pickup, and that its warehouses include one that holds the stock. A method with no warehouses listed ships from any warehouse (With inventory tracking on).- Click and collect, and the chosen warehouse is short. When
canCollectFromMultipleWarehousesistrue, a shipping group allows collection from two warehouses and one other warehouse can supply the rest. Offer it to the shopper, and create pickup shipping again with"collectFromMultipleWarehouses": truebeside thewarehouse. It staysfalsewhile every group has Same warehouse on.
"The selected warehouse is not available for this order" is a different refusal: the pickup warehouse sent is not one this site allocates from. Offer only active warehouses that belong to this site or to no site in particular.
More in Commerce
Was this page helpful?
Your answer goes to the docs team.