customers
QueryRetrieves a paged list of customers with optional filtering, sorting, and full-text 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 filters6
defaultstringSearches indexed customer names and email addresses. Every term must match.
ExamplesAlex Jensenbuyer@example.comidIDMatches a customer by their unique identifier.
Exampleid:cus_...first_namestringMatches the customer's first name.
Examplefirst_name:Alexlast_namestringMatches the customer's last name.
Examplelast_name:JensenemailstringMatches the customer's email address.
Exampleemail:buyer@example.comcreated_atdateCompares the customer creation date using an ISO 8601 date or timestamp.
Examplecreated_at:>="2026-01-01"
- 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.
- CustomerSortKeys
sortKey Field key to sort by.
Possible enum valuesCREATED_ATSort by the date and time the customer was created.
IDSort by customer `ID`.
NAMESort by the `name` value.
ORDERS_COUNTSort by the number of orders associated with the customer.
Payload
- [CustomerEdge!]
edges A list of edges.
- [Customer!]
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.