Skip to main content

generateMyRoutePlan

Requires permission visits:journey-plan:generate-own.

Generates a route plan for the signed-in rep's own cycle, in the same way as generateRoutePlan. 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:

mutation GenerateMyRoutePlan($cycleLengthDays: Int!, $cycleStartDate: DateTime!) {
generateMyRoutePlan(
cycleLengthDays: $cycleLengthDays
cycleStartDate: $cycleStartDate
) {
deferred {
id
name
customerTierName
customerTier
lastVisitedAt
}
}
}

Variables:

{
"cycleLengthDays": 0,
"cycleStartDate": "2025-01-15T00:00:00Z"
}

Response:

{
"data": {
"generateMyRoutePlan": {
"deferred": [
{
"id": "id",
"name": "string",
"customerTierName": "string",
"customerTier": "string",
"lastVisitedAt": "2025-01-15T00:00:00Z"
}
]
}
}
}
generateMyRoutePlan(
cycleLengthDays: Int!
cycleStartDate: DateTime!
): GenerateRoutePlanResult!

Arguments​

generateMyRoutePlan.cycleLengthDays ● Int! non-null scalar​

How many days the cycle lasts.

generateMyRoutePlan.cycleStartDate ● DateTime! non-null scalar​

The first day of the cycle.

Type​

GenerateRoutePlanResult object​

The route plans created or updated, and the customers who did not fit.