Skip to main content

routePlanningRepCustomers

Requires permission visits:journey-plan:manage.

Returns one rep's customers — everyone assigned to them, plus anyone they visited in the window (at most 92 days) — with the last completed visit, when the next visit is due, the next planned stop and the window's visit counts. The rep must be in the caller's team. Requires permission to manage journey plans.

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:

query RoutePlanningRepCustomers($from: DateTime!, $repId: ID!, $to: DateTime!) {
routePlanningRepCustomers(from: $from, repId: $repId, to: $to) {
salesRepName
from
salesRepId
to
today
customers {
name
status
assigned
completed
frequencyDays
lastCompletedOn
}
}
}

Variables:

{
"from": "2025-01-15T00:00:00Z",
"repId": "id",
"to": "2025-01-15T00:00:00Z"
}

Response:

{
"data": {
"routePlanningRepCustomers": {
"salesRepName": "string",
"from": "2025-01-15T00:00:00Z",
"salesRepId": "id",
"to": "2025-01-15T00:00:00Z",
"today": "2025-01-15T00:00:00Z",
"customers": [
{
"name": "string",
"status": "ACTIVE",
"assigned": true,
"completed": 0,
"frequencyDays": 0,
"lastCompletedOn": "2025-01-15T00:00:00Z"
}
]
}
}
}
routePlanningRepCustomers(
from: DateTime!
repId: ID!
to: DateTime!
): RoutePlanningRepCustomers!

Arguments​

routePlanningRepCustomers.from ● DateTime! non-null scalar​

The first day of the window.

routePlanningRepCustomers.repId ● ID! non-null scalar​

The ID of the sales rep.

routePlanningRepCustomers.to ● DateTime! non-null scalar​

The last day of the window.

Type​

RoutePlanningRepCustomers object​

A rep's customers with their visit dates.