Bypass Server Side Stock Validations in Cart and Checkout

Hi!

We’re building an online shop where the customer will be able to purchase a membership and therefore receive a monthly reservation of one item as a result of that. This item will be reserved for him which means that no other customer will be able to purchase it by any way. How we’re currently doing this is by reducing the stock of that item by one. So, let’s say that a new member just joined our shop. A person from our staff will select and reserve an item (through a third-party app that connects to our Shopify inventory) for that member by reducing its stock by one. Once his reservation is done, the member will receive an email indicating that he’s now able to purchase this item.

Now, the issue comes when the member tries to do the purchase. Since we reduced the stock of that item by one (to simulate the reservation), there might be the chance that that item is now in stock zero. If that’s the case, Shopify won’t allow the member to purchase it. In this scenario, we were able to bypass the stock validation that happens when you try to add an item to the cart by adding some custom logic to our theme (basically removing the http request sent to /cart/add.js). However, Shopify has some additional validations that take place when you click the Checkout button in the cart page as well as in the Checkout page when you try to finalize the purchase.

So, after this long story, my question is, is there a way that we could bypass Shopify’s stock validation both in the Cart and Checkout page so that our member could proceed with the purchase of his reservation? I know that we can enable the Continue selling when out of stock option for that product’s variant. However, this might end up allowing other members to also purchase that product variant as well, defeating the sole purpose of reserving that variant.

Do you have any idea of how we could proceed with this or maybe some alternatives that you can think of?

Thanks in advance!