hierarchyRepCustomers
Requires at least one of the permissions customers:customer:read or users:user:read.
Customers under one sales rep with per-customer order stats. Needs the customers read or users read permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query HierarchyRepCustomers($input: HierarchyCustomersInput!) {
hierarchyRepCustomers(input: $input) {
hasNextPage
page
pageSize
totalCount
items {
id
code
name
repName
status
createdAt
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query HierarchyRepCustomers($input: HierarchyCustomersInput!) {\n hierarchyRepCustomers(input: $input) {\n hasNextPage\n page\n pageSize\n totalCount\n items {\n id\n code\n name\n repName\n status\n createdAt\n }\n }\n}",
"variables": {
"input": {
"repId": "string"
}
}
}
EOF
Variables:
{
"input": {
"repId": "string"
}
}
Response:
{
"data": {
"hierarchyRepCustomers": {
"hasNextPage": true,
"page": 0,
"pageSize": 0,
"totalCount": 0,
"items": [
{
"id": "id",
"code": "string",
"name": "string",
"repName": "string",
"status": "string",
"createdAt": "2025-01-15T00:00:00Z"
}
]
}
}
}
hierarchyRepCustomers(
input: HierarchyCustomersInput!
): HierarchyCustomerPage!
Arguments
hierarchyRepCustomers.input ● HierarchyCustomersInput! non-null input
The details of the hierarchy customers request.
Type
HierarchyCustomerPage object
A page of customers.