Skip to content

List Customers (Datagrid)

Returns the paginated, filterable customer list that backs the admin Customers datagrid. The customer's group comes back as a nested group object.

The three counters — totalOrders, totalAddresses, and totalAmountSpentdo resolve on this listing, with real per-customer values, so there is no need to call the detail query per row just to show them. They arrive as strings ("13", "689.98"), so cast before doing arithmetic. Over REST the same three are omitted from listing rows entirely and appear only on the detail endpoint, which is the one place the two transports genuinely differ here.

The nested group node carries a routeless id (/api/admin_customer_group_refs/<id>) — not a queryable path. Read group { _id code name }, and use Customer Groups to work with the group itself.

Arguments

All arguments are optional and combine in a single query — filter, sort and paginate together.

Pagination

ArgumentDescription
firstNumber of records to return.
afterCursor to fetch the page after (from pageInfo.endCursor).

Filters

Each filter narrows the result; supplying more than one combines with logical AND. They mirror the admin Customers datagrid filters.

ArgumentTypeMatch
nameStringPartial first/last name.
emailStringPartial email.
phoneStringPartial phone.
customer_group_idIntExact group id.
statusInt0 or 1.
channel_idIntExact channel id.
date_of_birth_fromStringDate of birth ≥ (e.g. "1980-01-01").
date_of_birth_toStringDate of birth ≤.
created_at_fromStringRegistered on ≥.
created_at_toStringRegistered on ≤.

Sorting

ArgumentTypeValues
sortStringid (default), email, first_name
orderStringasc, desc (default desc)

See the Customers overview for how the menu works.

Released under the MIT License.