Import
Return Value
For the shape of
CheckoutOrder, FulfillmentOrder and the types they contain, see the Checkout Order Types reference.Where it works
The order is only loaded on the order confirmation route, so this hook only returns data for components placed in the slots of that page (see the Slots Catalog, “Order confirmation”). The page fetches the order while it renders, and the hook suspends the component until the order arrives: the page’s own loading state covers that moment, so you do not need a loading branch. Anywhere else,order is an empty object and reading order.fulfillmentOrders[0] throws. Keep order components in the confirmation slots.
Usage
Example
Display an order summary on a custom order page.- index.tsx
- styles.module.css
Notes
- A store configured to use the platform’s own success page redirects before the order page renders, so this hook never runs there.
rawis platform-specific and not covered by the SDK types; preferorderand fall back torawonly for data the normalized order does not carry.- See Checkout Order Types for complete type definitions.