Query a list of orders with optional filtering and pagination.
query GetOrders( $where: OrderWhereInput $take: Int $skip: Int $orderBy: [OrderOrderByInput!]) { orders(where: $where, take: $take, skip: $skip, orderBy: $orderBy) { id displayId status email total subtotal createdAt user { id name email } lineItems { id title quantity sku thumbnail formattedUnitPrice formattedTotal } } ordersCount(where: $where)}
Retrieve detailed information for a specific order.
query GetOrder($id: ID!) { order(where: { id: $id }) { id displayId status email total subtotal shipping tax discount createdAt updatedAt canceledAt fulfillmentStatus paymentDetails totalPaid formattedTotalPaid user { id name email phone } shippingAddress { firstName lastName company address1 address2 city province postalCode phone country { name iso2 } } billingAddress { firstName lastName company address1 address2 city province postalCode phone country { name iso2 } } lineItems { id title quantity sku thumbnail variantTitle formattedUnitPrice formattedTotal productData variantData } fulfillments { id createdAt canceledAt fulfillmentItems { id quantity lineItem { id title sku } } shippingLabels { id trackingNumber trackingUrl carrier labelUrl } } unfulfilled fulfillmentDetails payments { id amount status createdAt capturedAt } events { id type data time user { name email } } }}
Special query for customers to access their orders using a secret key (for guest orders).
query GetCustomerOrder($orderId: ID!, $secretKey: String) { getCustomerOrder(orderId: $orderId, secretKey: $secretKey) { id displayId status total subtotal shipping tax createdAt email lineItems { id title quantity thumbnail variantTitle formattedUnitPrice formattedTotal } shippingAddress { firstName lastName address1 city province postalCode country { name } } fulfillments { id createdAt shippingLabels { trackingNumber trackingUrl carrier } } fulfillmentStatus }}
The getCustomerOrder query allows authenticated users to access their orders, or guest users to access orders using the secret key provided at checkout.