Skip to main content

Orders

The useOrders hook fetches the order history for the currently logged-in customer.

Usage

Hook API

The hook only fetches when a customer access token is present. If the user is not logged in, orders remains an empty array.

Order Shape

Each order contains:
  • id, name, orderNumber
  • processedAt — ISO date string
  • financialStatus — PAID, PENDING, REFUNDED, etc.
  • fulfillmentStatus — FULFILLED, UNFULFILLED, etc.
  • totalPrice — { amount, currencyCode }
  • lineItems(first: 50) — product line items with title, quantity, variant (including id, title, image, price)

Service API

Throws 'Not authenticated' if no access token is set.