iotoms Docs

Create a route plan

POST
/api/v1/ops/route-plans

Creates a route plan template with its ordered list of customer stores. Each day's visit list is built from this template when the salesperson starts the day.

How to use it

  1. Get the stores to visit from List customer stores.
  2. Send planName, planCode, coverageTarget and stores, each with a sequence (1 = first), storeName, a UUID storeId and the customerStoreId.
  3. Optionally pair a vehicle with Assign a vehicle to a route plan. The plan is then used to build the visit list when a salesperson starts a day cycle.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

Request Body

application/json
  1. body
planName*string

Required. Display name of the route plan.

planCode*string

Required. Short code of the route plan.

coverageTarget*integer

Required. Coverage goal for the route plan, as a whole number greater than zero.

Formatint32
stores*array<>

Required, at least one. The full ordered store list; on update it replaces the existing list.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when it worked, ERROR when it failed.

message*string

Short 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 POST 'https://beta.iotoms.com/api/v1/ops/route-plans' \  -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"  }}