FROM CACHE - en_header

Add variant to cart using API/custom app?

pellsoft
New Member
1 0 0

Is it possible to add a variant to a cart (using cart ID?) through a custom app? Or does this have to be done with the AJAX api through the theme?

 

I'm trying to develop a middleware that receives webhooks when a cart is created, and automatically adds a warranty variant to the cart. There's a lot of conflicting information regarding what's possible on this. Thanks!

Reply 1 (1)
PaulNewton
Shopify Partner
4765 390 1021

No. There is no backend api to communicate what's in a cart only frontend javascript pinging your app.

Use scripttags to add the item to the cart using the fronted ajax api

 

To create a custom order with specific items on the backend use draft orders.

 

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com