Storefront API - Create Cart with LineItem, then take user to /cart

Storefront API - Create Cart with LineItem, then take user to /cart

Coldy
Shopify Partner
1 0 0

I'm following this guide to create a cart and add a line item via Storefront API: https://shopify.dev/docs/custom-storefronts/building-with-the-storefront-api/cart/manage

 

All is working fine, and we receive a cart ID back from the response like this: 

gid://shopify/Cart/Z2NwLXV...
Next we want to send the user to their /cart, not the checkout flow. 
I can only find documentation to send the user into their checkout flow using this method
 
I assumed that with the Cart ID we could somehow use Cart Permalinks to achieve this, however this feature is focused on actions like adding products to the cart, applying discounts etc. None of the options allows you to take user to /cart via the Cart ID. 
 
Thanks in advance 😁
 
 
Reply 1 (1)

Joe
Visitor
2 0 2

I think it just depends on your theme or app for how the `/cart` route is handled. You probably want to create that route in your app, or create that page in your website, and then on that page you can output the response from you cart queries.