migration from Checkout API to Cart API

Hi,

I’m trying to retrieve checkout or cart using checkout ui extension + appProxy + backend

using REST API is very clear and straight forward, we can use the checkout token and retrieve it. but it’s already deprecated and should move to GraphQL API and forced to use the Cart API.

Cart API needs the Cart ID. I can’t find the cartID anywhere on both checkout frontend react hooks or backend API!!

How can achieve such that?

There’s no useCart in checkout-ui-extensions hooks, it exists on store-front API which a different.

here’s all hooks available:
https://shopify.dev/docs/api/checkout-ui-extensions/2023-07/react-hooks

for the cartLines

https://shopify.dev/docs/api/checkout-ui-extensions/2023-07/react-hooks/cart/usecartlines

it doesn’t even give a stable ids.

getting cartLines from the frontend and send it to the backend is not safe at all.