checkoutUrl; the SDK tracks a checkout session over that cart so screens
can create, restore, open, poll and report the outcome.
Quick start
Create a fresh checkout
create builds a new cart for the given line items, persists its id, and
publishes the session. Use it for “Buy now” flows; for the cart the shopper
already built, open() (or restore()) reuses it.
Hook API
useCheckout restores the stored cart on mount, so returning to the checkout
screen after an app restart shows the same session without a manual step.
Session shape
CheckoutSession is a view over the cart — Storefront removed the old
checkout* API (verified against 2026-07), so there is no separate checkout
object:
toCheckoutSession(cart) is exported (pure) if you already hold a cart node.
Completion, cancellation and expiry
Storefront does not expose checkout status: there is noexpiresAt, no
completedAt and no cancel mutation. The SDK does not invent them.
useCart().clearCart().
The reference engine polls every 3s, matches success/cancel URL patterns,
listens to
AppState/Linking and persists a recovery record. All of that is
app-specific navigation policy. The SDK exposes the primitives (refresh,
markCompleted, markCancelled) and leaves timing to your app; Storefront
already persists the cart, so no recovery engine is needed.Legacy: getCheckoutUrl
cart.getCheckoutUrl(). Prefer open(), which keeps the session
state in sync.
The URL is also available from useCart() as cart.checkoutUrl once the cart
is loaded.
Flow
- Build the cart with
addLines/updateBuyerIdentity. const url = await open()(orcreate(lines)for a new cart).- Open the URL in an in-app browser or web view.
- Shopify handles address, shipping and payment.
- On return:
refresh()on foreground, plusmarkCompleted()/markCancelled()from your deep-link handler. - The order appears in
useOrders()/useOrderTracking().

