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

OrderConnection - A connection object containing a list of orders for the authenticated customer with pagination support.

Example

{ orders(first: 10, sortKey: CREATED_AT, reverse: true) { edges { node { id orderNumber createdAt totalPrice { amount currencyCode } statusUrl } } pageInfo { hasNextPage hasPreviousPage } } }