Update a route plan
PUT
Updates a route plan's name, code and coverage target. The store list you send replaces the existing one entirely, so always send the full ordered list.
How to use it
- Read the current plan with Get a route plan.
- Send planName, planCode, coverageTarget and the complete stores list in visit order; stores left out are removed from the plan.
- The assigned vehicle is kept. New visit lists use the updated stores when a salesperson next starts a day on this plan.
BearerAuthheader
AuthorizationBearer <JWT>templateId*stringID of the route plan, from List route plans.
Format
uuidapplication/json- body
planName*stringRequired. Display name of the route plan.
planCode*stringRequired. Short code of the route plan.
coverageTarget*integerRequired. Coverage goal for the route plan, as a whole number greater than zero.
Format
int32stores*array<>Required, at least one. The full ordered store list; on update it replaces the existing list.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when it worked, ERROR when it failed.
message*stringShort human-readable message describing the outcome, for example "Vendor created". Do not parse it.
data?The route plan with its ordered stores and any assigned vehicle.
Example Request
curl -X PUT 'https://beta.iotoms.com/api/v1/ops/route-plans/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{ "planName": "string", "planCode": "string", "coverageTarget": 0, "stores": [ { "storeId": "b8adcdc8-9238-4168-90f8-77b2d14c211c", "storeName": "string", "sequence": 0 } ]}'Example Response
{ "status": "string", "message": "string", "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "planName": "string", "planCode": "string", "coverageTarget": 0, "assignedVehicle": { "vehicleId": "c406adf4-e700-4483-ad7a-e7447a2941cb", "vehicleNumber": "string", "vehicleLabel": "string", "vehicleType": "VAN" }, "stores": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "storeId": "b8adcdc8-9238-4168-90f8-77b2d14c211c", "customerStoreId": 0, "storeCode": "string", "storeName": "string", "sequence": 0, "geoLat": 0, "geoLon": 0 } ], "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}