# Lookup Optimisation

Endpoint: GET /api/webhooks/ro/optimisation/v4/{id}/
Version: 1.0
Security: key

## Security:

  - `key` (unknown)
    apiKey in query key

## Path parameters:

  - `id` (string, required)

## Request fields (application/json):

  - `id` (integer)

  - `type` (string)

  - `day` (string)
    Date in ISO-8601 YYYY-MM-DD.

  - `merchant` (integer)

  - `options` (object)

  - `options.order_ids` (array)

  - `options.external_ids` (array)

  - `options.member_ids` (array)

  - `options.working_hours` (object)

  - `options.working_hours.lower` (string)

  - `options.working_hours.upper` (string)

  - `options.service_time` (integer)

  - `options.pickup_service_time` (integer)

  - `options.start_place` (string)

  - `options.start_hub` (integer)

  - `options.end_place` (string)

  - `options.end_hub` (integer)

  - `options.re_optimise_assigned` (boolean)

  - `options.use_vehicle_capacity` (boolean)

  - `options.use_all_not_assigned_jobs` (boolean)

  - `task_status` (string)
    Possible values are `created`, `in_progress`, `completed`. Here task means background task that performs optimisation. You should wait for status `completed` to work with optimisation results.

  - `routes` (array)

  - `routes.id` (integer)

  - `routes.driver` (integer)

  - `routes.total_time` (integer)

  - `routes.driving_time` (integer)

  - `routes.driving_distance` (integer)

  - `routes.start_time` (string)

  - `routes.end_time` (string)

  - `routes.orders_count` (string)

  - `routes.points` (array)

  - `routes.points.id` (integer)

  - `routes.points.number` (integer)

  - `routes.points.point_type` (string)

  - `routes.points.point_kind` (string)

  - `routes.points.point_object_id` (integer)

  - `routes.points.point_object` (object)

  - `routes.points.service_time` (integer)

  - `routes.points.driving_time` (integer)

  - `routes.points.distance` (integer)

  - `routes.points.start_time` (string)

  - `routes.points.end_time` (string)

  - `routes.points.planned_arrival_after` (string)

  - `routes.points.planned_arrival_before` (string)

  - `routes.points.path_polyline` (string)

  - `routes.color` (string)

  - `state` (string)
    State of this optimisation. Possible values are `CREATED`, `VALIDATION`, `OPTIMISING`, `COMPLETED`, `RUNNING`, `FINISHED`, `FAILED`. Status `COMPLETED` means that optimisation process has successfully completed, driver routes has created. `FINISHED` - when drivers completes all optimised jobs. `FAILED` - in case of some failure.

  - `group` (string)

  - `customers_notified` (boolean)

  - `log` (object)

  - `log.messages` (array)

  - `log.messages.text` (string)

  - `log.messages.time` (string)

  - `log.percent` (integer)

  - `log.steps` (array)

  - `log.steps.name` (string)

  - `log.steps.completed` (boolean)

## Response 200:

  - `200` (unknown)
    200

## Response 200 fields (application/json):

  - `id` (integer)
    Example: 6758

  - `type` (string)
    Example: ADVANCED

  - `day` (string)
    Example: 2023-07-14

  - `merchant` (integer)
    Example: 59

  - `options` (object)

  - `options.order_ids` (array)

  - `options.external_ids` (array)

  - `options.member_ids` (array)

  - `options.working_hours` (object)

  - `options.working_hours.lower` (string)
    Example: 08:00

  - `options.working_hours.upper` (string)
    Example: 17:00

  - `options.service_time` (integer)
    Example: 5

  - `options.pickup_service_time` (integer)
    Example: 5

  - `options.start_place` (string)
    Example: hub_location

  - `options.start_hub` (integer)
    Example: 315

  - `options.start_location` (object)

  - `options.start_location.location` (object)

  - `options.start_location.location.lat` (number)
    Example: -37.8136

  - `options.start_location.location.lng` (number)
    Example: 144.9631

  - `options.end_place` (string)
    Example: hub_location

  - `options.end_hub` (integer)
    Example: 314

  - `options.end_location` (any)

  - `options.re_optimise_assigned` (boolean)
    Example: false

  - `options.use_vehicle_capacity` (boolean)
    Example: false

  - `routes` (array)

  - `routes.id` (integer)
    Example: 9589

  - `routes.driver` (object)

  - `routes.driver.member_id` (integer)
    Example: 98113174

  - `routes.driver.full_name` (string)
    Example: Jhon Doe

  - `routes.driver.car` (object)

  - `routes.driver.car.car_type` (integer)
    Example: 2

  - `routes.driver.car.car_type_name` (string)
    Example: Ute

  - `routes.driver.car.capacity` (integer)
    Example: 20

  - `routes.driver.is_online` (boolean)
    Example: false

  - `routes.driver.work_status` (string)
    Example: not_working

  - `routes.driver.phone` (string)
    Example: +61400000000

  - `routes.driver.thumb_avatar_100x100` (string)
    Example: https://radaro-api-staging.s3.us-west-2.amazonaws.com:443/media/thumbnails/Member/29d9632b-5b0b-40e9-8e65-43d47d1cd5ff_100x100.jpg

  - `routes.driver.status` (string)
    Example: pickup

  - `routes.driver.last_location` (object)

  - `routes.driver.last_location.location` (string)
    Example: -37.813600,144.963100

  - `routes.options` (object)

  - `routes.total_time` (integer)
    Example: 2267

  - `routes.driving_time` (integer)
    Example: 1967

  - `routes.driving_distance` (integer)
    Example: 16349

  - `routes.start_time` (string)
    Example: 2023-07-14T17:20:00+10:00

  - `routes.end_time` (string)
    Example: 2023-07-14T17:57:47+10:00

  - `routes.orders_count` (integer)
    Example: 1

  - `routes.points` (array)

  - `routes.points.id` (integer)
    Example: 146055

  - `routes.points.number` (integer)
    Example: 1

  - `routes.points.point_kind` (string)
    Example: hub

  - `routes.points.service_time` (integer)
    Example: 0

  - `routes.points.driving_time` (integer)
    Example: 0

  - `routes.points.distance` (integer)
    Example: 0

  - `routes.points.start_time` (string)
    Example: 2023-07-14T17:20:00+10:00

  - `routes.points.end_time` (string)
    Example: 2023-07-14T17:20:00+10:00

  - `routes.points.planned_arrival_after` (string)
    Example: 2023-07-14T16:30:00+10:00

  - `routes.points.planned_arrival_before` (string)
    Example: 2023-07-14T18:30:00+10:00

  - `routes.points.planned_arrival` (string)
    Example: 2023-07-14T17:20:00+10:00

  - `routes.points.utilized_capacity` (integer)
    Example: 0

  - `routes.color` (string)
    Example: #40BF40

  - `routes.state` (string)
    Example: FINISHED

  - `routes.approved` (boolean)
    Example: true

  - `state` (string)
    Example: FINISHED

  - `task_status` (string)
    Example: completed

  - `group` (string)
    Example: failed

  - `customers_notified` (boolean)
    Example: false

  - `log` (object)

  - `log.messages` (array)

  - `log.messages.text` (string)
    Example: Optimisation started

  - `log.messages.time` (string)
    Example: 2023-07-10T18:22:25.136642+10:00

  - `log.progress` (integer)
    Example: 100

  - `log.steps` (array)

  - `log.steps.name` (string)
    Example: Composing the distance matrix

  - `log.steps.completed` (boolean)
    Example: true

## Response 403:

  - `403` (unknown)
    403

## Response 403 fields (application/json):

  - `detail` (string)
    Example: Route optimisation is not active for you

  - `errors` (any)

## Response 200 examples:

  - `Result` (unknown)

