migration from Checkout API to Cart API

Topic summary

A developer is struggling to migrate from Shopify’s deprecated Checkout REST API to the GraphQL Cart API within a checkout UI extension setup.

Core Problem:

  • The Cart API requires a Cart ID, which cannot be located in either checkout UI extension React hooks or backend APIs
  • The deprecated Checkout API allowed easy retrieval using checkout tokens, but this approach is no longer viable

Technical Constraints Identified:

  • useCart hook exists only in the storefront API, not in checkout-ui-extensions
  • Available checkout UI extension hooks don’t provide stable cart IDs
  • useCartLines hook doesn’t return stable identifiers
  • Sending cart line data from frontend to backend is considered insecure

Current Status:
The issue remains unresolved with no clear path forward for securely retrieving cart/checkout data in the new API architecture.

Summarized with AI on October 26. AI used: claude-sonnet-4-5-20250929.

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.