hierarchyCustomerOrders
Requires at least one of the permissions sales:sales_order:read or users:user:read.
Orders of one customer under one rep (chain-validated). Needs the sales order 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 HierarchyCustomerOrders($input: HierarchyOrdersInput!) {
hierarchyCustomerOrders(input: $input) {
hasNextPage
page
pageSize
totalCount
items {
id
orderNumber
status
itemCount
orderCurrency
orderDate
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query HierarchyCustomerOrders($input: HierarchyOrdersInput!) {\n hierarchyCustomerOrders(input: $input) {\n hasNextPage\n page\n pageSize\n totalCount\n items {\n id\n orderNumber\n status\n itemCount\n orderCurrency\n orderDate\n }\n }\n}",
"variables": {
"input": {
"customerId": "string",
"repId": "string"
}
}
}
EOF
Variables:
{
"input": {
"customerId": "string",
"repId": "string"
}
}
Response:
{
"data": {
"hierarchyCustomerOrders": {
"hasNextPage": true,
"page": 0,
"pageSize": 0,
"totalCount": 0,
"items": [
{
"id": "id",
"orderNumber": "string",
"status": "string",
"itemCount": 0,
"orderCurrency": "string",
"orderDate": "2025-01-15T00:00:00Z"
}
]
}
}
}
hierarchyCustomerOrders(
input: HierarchyOrdersInput!
): HierarchyOrderPage!
Arguments
hierarchyCustomerOrders.input ● HierarchyOrdersInput! non-null input
The details of the hierarchy orders request.
Type
HierarchyOrderPage object
A page of orders.