Development discussions around Shopify APIs
Greetings,
We have an interesting issue that we are facing with the AJAX Cart API.
We have several systems working together and we would like shopify to play the main Cart and point of transaction.
Ideally we are attempting to figure out a way to use the Shopify API to programmatically manage the users cart so they can checkout, vs having to build our own cart service.
We have a waitlist service for a product that is out of stock, once the product becomes available we want to programmatically add to a users cart and send them a notice that they can checkout. On the flip side, we want to also remove an item from the cart if their window to purchase expires.
However we are having issues keeping the cart in sync with the user, so this leads us to believe we need build our own cart management service and bypass Shopify's.
Any thoughts, greatly appreciate the assistance in advance.
--Chris-Heady
Solved! Go to the solution
This is an accepted solution.
@chris-heady wrote:The only drawback to this is, if a user has items in their cart on the website, they will not be included. There really is no mechanism to keep the carts in sync and still manage inventory with the waitlist and checkout timer.
That's right there's no native way to sync carts , aka persistent cart, even for signed in accounts.
The cart however is in json format shop.com/cart.json so just fetch and push, use cart attributes to store sync state timing information if need be.
persistent carts are a hairy business, goodluck nntr.
Hottake is you would be using cart permalinks, or generating draft orders.
Thanks @PaulNewton Not sure what you mean, are you asking if we are using permalinks or draft orders?
Not asking if your using those feature, but stating you may have to use those features to get the outcome your looking for from the info you've provided.
Can't edit posts after 3 hours or i'd fix the initial to clarify /sigh.
Thanks @PaulNewton , Appreciate you response, we are looking into creating a set of middleware endpoints that can manage the cart, waitlist and timing of the experience, then using a permalink to checkout via Shopify.
The only drawback to this is, if a user has items in their cart on the website, they will not be included. There really is no mechanism to keep the carts in sync and still manage inventory with the waitlist and checkout timer.
Thanks for your advice.
This is an accepted solution.
@chris-heady wrote:The only drawback to this is, if a user has items in their cart on the website, they will not be included. There really is no mechanism to keep the carts in sync and still manage inventory with the waitlist and checkout timer.
That's right there's no native way to sync carts , aka persistent cart, even for signed in accounts.
The cart however is in json format shop.com/cart.json so just fetch and push, use cart attributes to store sync state timing information if need be.
persistent carts are a hairy business, goodluck nntr.
User | RANK |
---|---|
10 | |
4 | |
3 | |
3 | |
3 |
We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023