listOrders
Topics: Commerce
List orders with pagination. Requires order:list permission.
Returns
OrderConnection!Arguments
Number of items from the start
Cursor to start after
Filter criteria
Sort order
Examples
Browse Commerce Orders
query BrowseCommerceOrders($customerId: ID!, $after: String) {
listOrders(first: 20, after: $after, filter: {customerId: {eq: $customerId}, status: {eq: CONFIRMED}}, sort: [{field: ORDER_DATE, direction: DESC}]) {
edges { cursor node { id orderNumber status totalAmount currency } }
pageInfo { endCursor hasNextPage }
}
}Variables
{
"customerId": "cus_01h455vb4pex5vsknk084sn02q",
"after": null
}Exact field SDL
"""List orders with pagination. Requires order:list permission."""
listOrders(
"""Number of items from the start"""
first: Int
"""Cursor to start after"""
after: String
"""Filter criteria"""
filter: OrderFilterInput
"""Sort order"""
sort: [OrderSortInput!]
): OrderConnection! @topic(names: ["commerce"]) @topic_example(names: ["commerce.browse-orders"])Declared on Query. Access is checked by the platform for each operation.