Skip to main content
POST
/
reorder-visits
Reorder visits
curl --request POST \
  --url https://apiweb.mile.app/api/v3/reorder-visits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "currentCoordinate": "-7.76287840866215,113.24105028153643",
  "visits": [
    {
      "id": "taskId-6865263cdbb431345b0b0a04",
      "name": "Order 2",
      "address": "Bangil",
      "coordinate": "-7.5976243,112.7845343",
      "timeWindow": {
        "startTime": "07:00",
        "endTime": "23:00"
      },
      "visitTime": "30"
    },
    {
      "id": "taskId-6865263cdbb431345b0b0a02",
      "name": "Order 1",
      "address": "Probolinggo",
      "coordinate": "-7.86316,113.30510534699638",
      "timeWindow": {
        "startTime": "07:00",
        "endTime": "23:00"
      },
      "visitTime": "30"
    }
  ]
}
'
{
  "status": true,
  "statusCode": 200,
  "data": [
    {
      "status": true,
      "message": "Success.",
      "_id": "6865263cdbb431345b0b0a02",
      "orderIndex": 17515144251
    },
    {
      "status": true,
      "message": "Success.",
      "_id": "6865263cdbb431345b0b0a04",
      "orderIndex": 17515144252
    }
  ]
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Body

application/json
currentCoordinate
string
required

The current latitude and longitude to calculate the order from.

Example:

"-7.76287840866215,113.24105028153643"

visits
object[]
required

List of visits to be reordered.

Response

Success

status
boolean

Status of response.

statusCode
integer

Status code of response.

data
object[]