Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Send Data From Web App To Shopify Theme Cart And Checkout

markushrvst
Shopify Partner
3 0 1

Hi all,

 

Curious, is there a way to connect and send data from a web app built with React (using the Storefront API), to the store's theme cart page and then checkout?

 

We were requested to build a product customizer web app experience with some high level functionality, but also have a theme so the client can use the OS2.0 functionality for inner pages.

 

Essentially, a customer starts on the theme, customizes the product in the web app, and then finishes their purchasing experience back on the theme.

 

Thanks!

Reply 1 (1)

Liam
Shopify Staff
2602 281 716

Hi Markushrvst,

 

The flow you've described should be possible with the the Storefront API so you can use a react based web app alongside a native Shopify cart (and other pages). The general process would be to make an API call to the Storefront API to add the customized product to the cart, when the customer completes the customization process in the web app,. You can use the `checkoutLineItemsAdd` mutation to add the product with the desired customization options to the cart. Then you'd redirect the customer to the theme's cart page by providing a link or use a programmatic navigation method to ensure the customer lands on the correct page within the theme.

 

Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog