Skip to Content

orders

Get the authenticated customer’s orders. Requires a valid customer access token via the @storeContext directive.

Authentication

Authentication Required: Secret API key with scope order:read

Query Structure

{ orders( first: Int after: String last: Int before: String sortKey: OrderSortKey reverse: Boolean ) { # OrderConnection fields } }

Arguments

ArgumentTypeRequiredDescription
firstIntNoReturns the first n elements.
afterStringNoReturns elements after cursor.
lastIntNoReturns the last n elements.
beforeStringNoReturns elements before cursor.
sortKeyOrderSortKeyNoThe key to sort orders by.
reverseBooleanNoReverse the order of the underlying list.

Return Type

Returns OrderConnection - A connection object containing a collection of orders with pagination support.

Example

query { orders(first: 10, sortKey: PROCESSED_AT, reverse: true) { edges { cursor node { id orderNumber processedAt totalPrice financialStatus fulfillmentStatus } } pageInfo { hasNextPage hasPreviousPage } } }