remove cart item after check its stock through cart webhook

APALACE
New Member
7 0 0

Hi, my shopify stock is handle for a 3rd party, so before checkout I must be sure that products are available on the 3rd party stock. I've created a few webhook for cart and checkout to check stock but I don't know how remove from cart just in case stock will be 0 in my 3rd party supplier.

I thought about hide the product but cart is not refreshed automactically and still show the product, even if I navigate on my website.

Any suggestion?

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 198

Hey there, 

This sounds like a good use-case for using our Ajax API - that can add/remove items from a shopping cart. 

It may be a simpler solution however to build a direct integration with your third-party provider via an app. Then you could have them automatically update inventory quantities of your products with the Product API and stay synchonized with them, instead of having to make calls to both us and them on the fly every time someone creates a cart.

Josh Wheeler
 

0 Likes
DavideDev
New Member
5 0 0

Josh 3rd party it means a different domain, you can't call a different domain by a js call, is a cross-site request, I'm facing the same issue.

Am i wrong?

0 Likes