Possibility to add a checkbox to cart and make api call?

Shopify Partner
1 0 0

I’m new to shopify and need to implement the following “plugin”:

1. Add a checkbox to the cart
2. When checkbox is checked, a predefined product gets added to the cart
3. If product was added to cart and payment was successful, send a custom request to an external API with some customer data (name, email).

Is it possible to build a app for this functionality so it can be added from the App Store?

Thanks in advance!
Shopify Staff
Shopify Staff
1041 140 167

Hey @trnc,


1. You can do this by modifying the cart page (either edit cart.liquid, or using scriptTags). Keep in mind all carts are different and some stores have a cart drawer (i.e. no cart page). So consistently placing the checkbox can be tricky.

2. The AJAX API can add products to cart. If the product doesn't exist, you'll need to create it first.

3. A webhook can notify you of new orders.

Notice; Out of office, replies will be delayed until my return. Thanks!