Cart checkoutUrl directs to checkout instead of cart page

Hello everyone,

I’m working on a store that uses the Shopify Storefront API.

Currently we render the cart page in our own application and direct the user to the Shopify Checkout. Now I’m evaluating if we might use the Shopify Cart page instead of our own.

What I’ve achieved so far is that I can create a new cart via the API and also add items to the cart. In the API response I get a cart ID and also a checkoutUrl that looks like [https://shopdomain/cart/c/somestring](https://shopdomain/cart/c/somestring`) . When I go to that url I get directed into the checkout instead to the cart page.

So my question is:

Is it possible to use the Storefront API to handle the cart but also render the Shopif Cart page?

Currently we render the cart page in our own application and direct the user to the Shopify Checkout. Now I’m evaluating if we might use the Shopify Cart page instead of our own.

You did not tell us why you’re considering that but I’d rather keep the two implementations co-located in the same repository. What does Shopify Cart page give you that you can’t implement yourself?

When I go to that url I get directed into the checkout instead to the cart page.

Check out the documentation as that’s totally expected. Headless builds typically provide the custom storefront experience while leveraging the checkout feature of Shopify. Also, if you want to direct people to the cart page, there’s a neat trick I’ve been using:

Most Shopify pages support return_to query parameter that you can use to handle redirects. Now it is possible to clear the cart, add items to the cart and redirect to a certain page afterwards as a chained sequence of redirects. I’m including a list of redirects for the above mentioned sequence below:

Now, all you need to do is chain them with the return_to and let Shopify handle the request. As you might have guessed, landing on the cart page would be as easy as replacing the last hop with Please contact Shopify support at support.shopify.com – Opening Soon

So all together, you might use something like:

Hope it helps

Thanks for your input so far! I’ll try it out asap.

The reason why we want to switch back to the Shopify Cart is, that we want to use the Paypal Express Button within the Cart. As far as I know this is supported from Shopify by default and I don’t want to build a custom implementation of the Paypal Express Button within our App.