Is it possible programatically to add a product to a customer's cart from a Shopify App?

Is it possible programatically to add a product to a customer's cart from a Shopify App?

BrunoSS
Shopify Partner
4 0 2

Hello!

 

I have a Shopify App that other merchants can install to integrate with my software. I also have a theme-extension as part of this app, that renders my own web application embedded on Shopify (as an iframe).

 

This theme-extension checks for an authenticated customer before rendering my iframe, since my app is for logged customers only. I already have the customer ID from the theme-extension, but I am wondering if it's possible to programmatically add a product to their cart from my theme-extension or from my app.

 

To better illustrate, here's what's happening:

- The merchant installs my app and creates an account on my software.

- On my software, he can create extra content for his store (like a tutorial page).

- From the embedded app, he can connect his store product to a tutorial, so when a customer buys that product, he will be able to see the connected tutorial (from my software) under his "My Account" page (using a theme-extension)

 

Now, I would like to add the possibility for the customer to add more products to his cart from this tutorial (theme-extension). Is that possible?

I was reading about custom storefronts and Hydrogen, but looks like that only works for a specific store (since I need shop url and api keys), and I need something generic for any merchant.

 

Thanks!

Replies 0 (0)