orders
QueryRetrieves a paged list of orders with optional filtering, sorting, and search.
Arguments
- String
after Returns the elements in the list that come after the specified cursor.
- String
before Returns the elements in the list that come before the specified cursor.
- Int
first Returns the first n elements from the list.
- Int
last Returns the last n elements from the list.
- String
query - A filter expression made up of terms, boolean operators, modifiers, and comparators. Combine one or more filters in a single query.
Available filters13
defaultstringSearches indexed order text such as references, customer details, and state values. Every term must match.
Examplesbuyer@example.comERP-1042idIDMatches an order by its unique identifier.
Exampleid:order_...external_referencestringMatches the external reference stored on the order.
Exampleexternal_reference:ERP-1042created_atdateCompares the order creation date using an ISO 8601 date or timestamp.
Examplescreated_at:>="2026-01-01"created_at:<"2026-02-01T00:00:00Z"customer_idIDMatches orders belonging to the specified customer.
Examplecustomer_id:cus_...customer_emailstringMatches the customer email stored on the order.
Examplecustomer_email:buyer@example.comstore_idIDMatches orders placed through the specified store.
Examplestore_id:store_...order_statestringMatches the order processing state.
Exampleorder_state:confirmedpayment_statestringMatches the order payment state.
Examplepayment_state:paidshipment_statestringMatches the order shipment state.
Exampleshipment_state:fulfilledcurrency_codestringMatches the order currency code.
Examplecurrency_code:EURdiscount_codestringMatches an applied discount code. The value is case-sensitive.
Examplediscount_code:WELCOME10cart_discount_idIDMatches an order that used the specified cart discount.
Examplecart_discount_id:cart_discount_...
- SortDirection
sortDirection Sort direction (ascending or descending).
Possible enum valuesASCOrders values from lowest to highest or alphabetically from A to Z.
DESCOrders values from highest to lowest or alphabetically from Z to A.
- OrderSortKeys
sortKey Field key to sort by.
Possible enum valuesCREATED_ATSorts by the date and time the order was created.
IDSort by customer `ID`.
ORDER_NUMBERSorts by the order number.
Payload
- [OrderEdge!]
edges A list of edges.
- [Order!]
nodes A flattened list of the nodes
- PageInfo!
pageInfo Information to aid in pagination.
- Int!
totalCount Identifies the total count of items in the connection.