With inventory tracking on, the purchase call holds the stock of every item before it takes the payment, and refuses the purchase before anything is charged when it cannot. Two answers come from this step:
- 422,
codeSTOCK_RESELECT_SHIPPING: "Stock for your order has changed. Please choose your shipping option again." The fulfilments were planned when shipping was created, and they no longer hold: another order has taken the stock since, or the checkout's items have changed. Create shipping again, show the new rates, and let the shopper choose before paying. Reading the checkout gives notice of this first: itsmessagescarry the warning "Some items are no longer in stock at the chosen location, or the cart has changed. Choose shipping again before paying." - 503 with a
Retry-Afterheader: "Many orders are being placed right now. Please try again in a moment." Other checkouts were holding the stock of the same products at that moment. The checkout is unchanged. Wait the secondsRetry-Aftergives, 2, and send the purchase again; show the message if it comes back.
Each purchase attempt uses its captcha token, so reset the widget before sending the purchase again (Guest checkout and the captcha).
The stock held for a checkout lasts for the Checkouts setting Checkout Lifetime, 30 minutes by default. A declined payment keeps it for the shopper's next try. A payment that does not finish within that time lets it go, and the next attempt holds it again if it is still there, or answers 422 as above.