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:
- GraphQL
- cURL
mutation GenerateMyRoutePlan($cycleLengthDays: Int!, $cycleStartDate: DateTime!) {
generateMyRoutePlan(
cycleLengthDays: $cycleLengthDays
cycleStartDate: $cycleStartDate
) {
deferred {
id
name
customerTierName
customerTier
lastVisitedAt
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation GenerateMyRoutePlan($cycleLengthDays: Int!, $cycleStartDate: DateTime!) {\n generateMyRoutePlan(\n cycleLengthDays: $cycleLengthDays\n cycleStartDate: $cycleStartDate\n ) {\n deferred {\n id\n name\n customerTierName\n customerTier\n lastVisitedAt\n }\n }\n}",
"variables": {
"cycleLengthDays": 0,
"cycleStartDate": "2025-01-15T00:00:00Z"
}
}
EOF
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.