---
metadata:
  - name: generator
    content: Diplodoc Platform v5.19.6
alternate:
  - https://docs.routeq.com/doc/en/delivery/functions/visit-detection.md
---
> **Documentation Index:** Fetch the complete configuration index at https://docs.routeq.com/doc/en/llms.txt


# Detecting route point visits

Visits to route points (orders and depots) are detected automatically. This helps to log violations of the delivery sequence (if the [Delivery by order statuses](https://docs.routeq.com/doc/en/delivery/configurable-options/delivery-by-order-status.md) option is off) and to [automatically detect deliveries](https://docs.routeq.com/doc/en/delivery/functions/delivery-detection.md).

{% note info %}

Depot visits are detected only if you set up depot export to Track & Trace or if depots are added to routes as separate locations via the API (for such locations, `type` = `depot`). For more information, see [Courier visits to depots](https://docs.routeq.com/doc/en/delivery/functions/visiting-depot.md).

{% endnote %}

## Detection parameter settings {#detection-parameters}

**Detection radius, m**

: The detection radius for delivering the order can be adjusted:

    - For the entire company. The parameter applies to all company orders if there are no individual parameters set for them. The default is 500 m. To specify a different value in the [company settings](../interface/company.md), enable the [automatic delivery detection](delivery-detection.md) feature or contact support (if you don't want to enable automatic delivery detection). The maximum detection radius is 2000 m.

    - For a depot. The parameter applies to all orders on the route that starts at this depot. To set the detection radius for a depot, use the `mark_delivered_radius` parameter in the API method when [creating](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/addsADepot) a depot or editing [one](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/editsDepot) or [multiple](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/editsMultipleDepots) depots. The priority of this radius supercedes the company-level radius.

    - For an order. To set it, use the `mark_delivered_radius` parameter in the API method when [creating](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/addsAnOrder) an order or editing [one](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/editsOrder) or [multiple](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/editsMultipleOrders) orders. This radius takes priority over the company-level and depot-level radiuses.

  You can set the depot visit detection radius (different from the company-level setting) via the interface in the [depot settings](https://docs.routeq.com/doc/en/delivery/interface/depots.md) or using the API method when creating [one](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/addsADepot) or [multiple](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/editsMultipleDepots) depots in the parameter `mark_route_started_radius`.

**Detection coefficient**

: The default value is 0.5. You can specify a different value in the [company settings](https://docs.routeq.com/doc/en/delivery/interface/company.md) yourself (only if [automatic delivery detection](https://docs.routeq.com/doc/en/delivery/functions/delivery-detection.md) is enabled) or by contacting support (if you don't want to enable automatic delivery detection).

**Time to spend in the radius for detection, s**

: A visit is detected after the period of $N$, during which the courier must remain within the detection radius (in the delivery area).

    {% note info %}

    If you don't specify the time parameters, the visit will be detected when the courier enters the radius.

    {% endnote %}


    For the order, the time when the courier is in the delivery area is calculated using the formula:

    $N = coef_{detection} * \times(t_{order} + t_{address})$, where

    - $coef_{detection}$ is a detection coefficient.
    - $t_{order}$ is the handling time per order `service_duration_s`.
    - $t_{address}$ is the handling time per address `shared_service_duration_s`.

    The calculation for the depot uses the `service_duration_s` loading/unloading time. You can also set this value using the API method for creating [one](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/addsADepot) or [multiple](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/editsMultipleDepots) depots. You have to set this parameter if you use [depot detection](visiting-depot.md).

**ETA calculation influence**

: The moment when visit detection is triggered depends on the [ETA calculation method](https://docs.routeq.com/doc/en/extras/sms-setting.md#notification-eta):

    - For `arrival_time`: $N$ seconds after the courier enters the delivery area.
    - For `delivery_time`: $N$ seconds from the start of delivery, but not earlier than the delivery window.
  

**Detection of the next point in sequence** {#setup-point-next}

: You can enable the option **Detection is only allowed for the next point in sequence** in the [company settings](https://docs.routeq.com/doc/en/delivery/interface/company.md#auto-delivery). Use this option if you need to adhere to the [order delivery sequence](https://docs.routeq.com/doc/en/vrp/properties-of-orders.md#sequence-order) on the route.

  If the option is enabled:

  - Detection is allowed only for the point that's next in the sequence.
  - Detection doesn't trigger when the courier enters the radius of another point.
  
  There's an exception: you can fictitiously mark the visit of the starting depot along with the detection of the order that comes first in sequence after the depot.

  If the option is disabled:

  - The algorithm marks the completion of orders one by one.
  - Only the orders that follow one another and multi-orders can be marked as completed simultaneously at one location.
  - The algorithm takes into account the order handling time and matches it with the time spent within the radius.
  
**Example 1**

A courier delivers medical supplies with different temperature requirements. To do this, you set the order delivery sequence (`sequence_order`): Order 1 → Order 2 → Order 3 → Order 4 → Order 5 → Order 6 → Order 7. The option **Detection is only allowed for the next point in sequence** is enabled. 

Orders 1 and 3 are located at the same address but should be delivered in a different sequence. As a result, the detection of order 3 won't be triggered when completing order 1, even if the courier spends enough time in the delivery zone.

[API-request (JSON)](https://courier.yandex.ru/vrs/api/v1/log/request/161b5199-434eb94c-6ca0d4a9-7e58dd73) ⋅ [API-response](https://courier.yandex.ru/vrs/api/v1/result/161b5199-434eb94c-6ca0d4a9-7e58dd73) ⋅ [Open the map](https://yandex.com/courier/mvrp-map#161b5199-434eb94c-6ca0d4a9-7e58dd73)

**Example 2**

The same as in example 1, but the option **Automatic delivery detection** is enabled. The sequence for orders 1 and 3 (`sequence_order`) is not set. Handling time for each order is 20 minutes, with detection rate at 0.5.
  
Time to spend in the radius to trigger a visit is 10 minutes. Order 1 will be marked as completed 10 minutes after the courier enters its radius. The algorithm takes into account the order handling time, so order 3 won't be marked for another 10 minutes — while the courier is still handling order 1. For order 3 to be marked as completed, the courier needs to spend at least 30 minutes in the delivery zone. This includes the handling time for order 1 and the time spent within the radius for order 3.

[API-request (JSON)](https://courier.yandex.ru/vrs/api/v1/log/request/288c0cf6-ac54ee9-2f234a2d-8fecfbad) ⋅ [API-response](https://courier.yandex.ru/vrs/api/v1/result/288c0cf6-ac54ee9-2f234a2d-8fecfbad) ⋅ [Open the map](https://yandex.com/courier/mvrp-map#288c0cf6-ac54ee9-2f234a2d-8fecfbad)

## How visit time is recorded {#setup-details}

The point visit is detected using the time on the courier's device.

For example, the courier visited the order at 17:00, but the internet connection on their device was lost and only restored at 17:10. At 17:05, the Routing Workspace dashboard won't show that the order has been visited. The manager will receive information about the order visit only at 17:10 after the courier's internet connection was restored and the device sent data to the Track & Trace server. In this case, the order visit time will be recorded as 17:00.

{% include [warehouse-feedback](../_includes/feedback-7b71896f9bc3.md) %}

