---
metadata:
  - name: generator
    content: Diplodoc Platform v5.19.6
alternate:
  - https://yandex.ru/dev/sdg-robot/en/use-cases.md
  - https://yandex.ru/dev/sdg-robot/ru/use-cases.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/sdg-robot/en/llms.txt

# Popular use cases

## No robots are available to fulfill the order {#no-free-courier}

If the service receives more orders than there are available robots, it assigns the `performer_not_found` status to the order when evaluating it.

In this case, there are two options:

Option 1 (default)

: The order is immediately and automatically canceled and gets a `cancelled` status.

Option 2

: You can leave the order in `performer_not_found` status and keep trying to find an available robot for a while. To do this, specify the time until which the search should continue when [creating an order](https://yandex.ru/dev/sdg-robot/en/ref/claims/create_handler_claims_create_post). You need to pass this parameter in the `search_until` field of the `conditions` section in the request body. This field should contain a datetime value indicating when the search should stop.

  If no robot is found before the specified time, the order is automatically canceled and gets a `cancelled` status.

You can view the current order status when requesting the [order information](https://yandex.ru/dev/sdg-robot/en/ref/claims/info_handler_claims_info_post).

## Selecting a robot for the order {#select-performer}

[The service usually finds and assigns](https://yandex.ru/dev/sdg-robot/en/quick-start.md) a robot to the order, but you can also do this manually.

1. Request a [list of available robots](https://yandex.ru/dev/sdg-robot/en/ref/couriers/search_handler_couriers_search_post): specify `free` in the `shift_status_in` request field. You can specify [other statuses](https://yandex.ru/dev/sdg-robot/en/ref/couriers/search_handler_couriers_search_post#couriershiftstatus) as well.

    {% cut "Request" %}

    ```bash
    POST /couriers/search
    ```

    ```json
    {
        "filters": {
            "shift_status_in": "free"
        }
    }
    ```

    {% endcut %}

    The response returns a list of robots, their statuses and coordinates. Select a robot and remember its VIN.

1. [Create an order](https://yandex.ru/dev/sdg-robot/en/ref/claims/create_handler_claims_create_post), specifying the VIN of the selected robot in the `vin` parameter of the `conditions` section.

    {% cut "Request" %}

    ```bash
    POST /claims/create?idempotency_key=<your_idempotency_key>
    ```

    ```json
    {
        "route_points": [
            {
            "address": {
                "coordinates": [
                    55.733989,
                    37.588116
                ]
            },
            "point_id": "0",
            "type": "source",
            "visit_order": 0
            },
            {
            "address": {
                "coordinates": [
                    55.735120,
                    37.642817
                ]
            },
            "point_id": "1",
            "type": "destination",
            "visit_order": 1
            }
        ],
        "external_order_id": "Order #1",
        "conditions": {
            "vin": "<your_selected_vin>"
        }
    }
    ```

    {% endcut %}

## A partner or customer canceled the order {#cancelled}

You can [cancel the order](https://yandex.ru/dev/sdg-robot/en/ref/claims/cancel_handler_claims_cancel_post) until the customer confirms that they received the cargo.

If the cargo isn't yet in the robot, the order status immediately changes to `cancelled`.

If the cargo is already in the robot, but delivery hasn't been [confirmed](https://yandex.ru/dev/sdg-robot/en/ref/claims/confirm_exchange_handler_claims_confirm_exchange_post), order cancellation triggers the cargo return to the loading point:

1. [Cancel the order](https://yandex.ru/dev/sdg-robot/en/ref/claims/cancel_handler_claims_cancel_post).

1. Check the [order status](https://yandex.ru/dev/sdg-robot/en/ref/claims/info_handler_claims_info_post):

    While the robot is delivering the cargo to the loading point, the order is in `returning` status.

    When the robot arrives at the loading point, the order status changes to `return_arrived`.

1. [Open the lid](https://yandex.ru/dev/sdg-robot/en/ref/claims/open_hatch_handler_claims_open_hatch_post) to pick up the cargo, and the order status will change to `ready_for_return_confirmation`.

1. [Confirm](https://yandex.ru/dev/sdg-robot/en/ref/claims/confirm_exchange_handler_claims_confirm_exchange_post) that you collected the cargo, and the order status will change to `returned`.

1. After that, the order status automatically changes to `cancelled`.

## The customer returned the order {#returned}

If the robot delivered the cargo to the customer and the customer refused to pick it up, return the cargo to the loading point:

1. If the customer has already closed the robot lid, they should [open it](https://yandex.ru/dev/sdg-robot/en/ref/claims/open_hatch_handler_claims_open_hatch_post) again.

1. The customer should put the cargo in and [close the lid](https://yandex.ru/dev/sdg-robot/en/ref/claims/close_hatch_handler_claims_close_hatch_post).

1. Instead of confirming that the cargo was picked up, initiate [order cancellation](https://yandex.ru/dev/sdg-robot/en/ref/claims/cancel_handler_claims_cancel_post).

1. Check the [order status](https://yandex.ru/dev/sdg-robot/en/ref/claims/info_handler_claims_info_post):

    While the robot is delivering the cargo to the loading point, the order is in `returning` status.

    When the robot arrives at the loading point, the order status changes to `return_arrived`.

1. [Open the lid](https://yandex.ru/dev/sdg-robot/en/ref/claims/open_hatch_handler_claims_open_hatch_post) to pick up the cargo, and the order status will change to `ready_for_return_confirmation`.

1. [Confirm](https://yandex.ru/dev/sdg-robot/en/ref/claims/confirm_exchange_handler_claims_confirm_exchange_post) that you collected the cargo, and the order status will change to `returned`. When confirmed, the robot lid closes automatically: you don't have to send a request.

1. After that, the order status automatically changes to `cancelled`.

## The customer didn't pick up the order {#missed}

When the robot arrives at the delivery point, it waits for the customer to pick up the order. By default, the waiting time isn't limited.

If you want to limit the waiting time, specify it for a specific point in the `waiting_time` parameter (in seconds) when [creating an order](https://yandex.ru/dev/sdg-robot/en/ref/claims/create_handler_claims_create_post). If the customer doesn't pick up the order within the specified time, the order is automatically canceled and [order return](#returned) is initiated.

## Delivery delay {#delayed}

The order delivery time may increase due to the current traffic conditions or a robot malfunction. While the order is being fulfilled, the service continuously recalculates the estimated tome of arrival (ETA). The [order information](https://yandex.ru/dev/sdg-robot/en/ref/claims/info_handler_claims_info_post) request returns the actual time in the `eta` field.

## The order can't be delivered {#incident}

If a robot malfunction occurs and the order can't be delivered, the order is automatically canceled. The [order information](https://yandex.ru/dev/sdg-robot/en/ref/claims/info_handler_claims_info_post) request returns a `cancelled` status in the response.

After that, you need to [contact support](https://yandex.ru/dev/sdg-robot/en/support.md) and discuss possible solutions to the issue.

## List of frequently used points {#geo-points}

If you have a set of geopoints that are frequently used as loading or delivery points, you can add their coordinates to the [list of available points](https://yandex.ru/dev/sdg-robot/en/ref/claims/list_points_geo_points_list_post).

You can provide this list to customers in the interface of your online service or mobile app to simplify and speed up order placement.

To add points to the list, please [contact support](https://yandex.ru/dev/sdg-robot/en/support.md).

<!-- ## В одном заказе несколько точек погрузки и доставки {#multi-order}

При [создании заказа](https://yandex.ru/dev/sdg-robot/en/ref/claims/create_handler_claims_create_post) в массиве `route_points` можно указать несколько точек погрузки `type` = `source` и несколько точек доставки `type` = `destination`. Порядок посещения указывается для каждой точки в поле `visit_order`, нумерация начинается с 0. -->


{% include notitle [feedback](_includes/feedback-091b0be5d947.md) %}
