# List Optimisations

Endpoint: GET /api/webhooks/ro/optimisation/v3/
Version: 1.0
Security: key

## Security:

  - `key` (unknown)
    apiKey in query key

## Query parameters:

  - `day_after` (string)
    If set, returns optimisations with `date` greater than or equal to the passed value. Example: `"2020-01-12"`. (ISO-8601). (ISO-8601)

  - `day_before` (string)
    If set, returns optimisations with `date` less than or equal to the passed value. Example: `"2020-01-13"`. (ISO-8601). (ISO-8601)

## 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: 1754

  - `day` (string)
    Example: 2021-07-30

  - `merchant` (integer)
    Example: 180

  - `log` (object)

  - `log.steps` (array)

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

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

  - `log.messages` (array)

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

  - `log.messages.time` (string)
    Example: 2021-07-29T16:47:01.446065+10:00

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

  - `type` (string)
    Example: ADVANCED

  - `group` (string)
    Example: scheduled

  - `state` (string)
    Example: COMPLETED

  - `routes` (array)

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

  - `routes.color` (string)
    Example: #F79F79

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

  - `routes.driver` (object)

  - `routes.driver.car` (object)

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

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

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

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

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

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

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

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

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

  - `routes.driver.last_location` (object)

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

  - `routes.driver.thumb_avatar_100x100` (string)
    Example: https://example.com/path/to/file

  - `routes.points` (array)

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

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

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

  - `routes.points.end_time` (string)
    Example: 2021-07-30T16:00:00+10:00

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

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

  - `routes.points.start_time` (string)
    Example: 2021-07-30T16:00:00+10:00

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

  - `routes.points.point_object` (object)

  - `routes.points.point_object.id` (integer)
    Example: 379

  - `routes.points.point_object.name` (string)
    Example: Hub

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

  - `routes.points.point_object.location` (object)

  - `routes.points.point_object.location.id` (integer)
    Example: 330

  - `routes.points.point_object.location.address` (string)
    Example: 1 Example St, Melbourne VIC 3000, Australia

  - `routes.points.point_object.location.location` (object)

  - `routes.points.point_object.location.location.lat` (number)
    Example: -37.8136

  - `routes.points.point_object.location.location.lng` (number)
    Example: 144.9631

  - `routes.points.point_object.location.description` (string)

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

  - `routes.points.planned_arrival` (string)
    Example: 2021-07-30T16:00:00+10:00

  - `routes.points.point_object_id` (integer)
    Example: 379

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

  - `routes.points.planned_arrival_after` (string)
    Example: 2021-07-30T15:00:00+10:00

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

  - `routes.options` (object)

  - `routes.end_time` (string)
    Example: 2021-07-30T22:08:34+10:00

  - `routes.start_time` (string)
    Example: 2021-07-30T16:00:00+10:00

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

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

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

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

  - `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: 30

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

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

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

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

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

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

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

  - `task_status` (string)
    Example: completed

  - `customers_notified` (boolean)
    Example: false

## 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)

