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

# Main flow

{% note info "" %}

This section describes the simplest flow: the service automatically selects a robot, the robot picks up the cargo at the loading point and takes it to the delivery point. For more information about other options, see [Popular use cases](https://yandex.ru/dev/sdg-robot/en/use-cases.md).

{% endnote %}

#|
|| **Step** | **Who performs** | **Action** ||
|| 1 | Partner | [Creates an order](https://yandex.ru/dev/sdg-robot/en/ref/claims/create_handler_claims_create_post) for cargo delivery to the customer.

In the `route_points` array within the request body, specify the loading point `type` = `source` and the delivery point `type` = `destination`. You need to specify the visit order for each point in the `visit_order` field, starting with 0.

In the `conditions` section, you can specify the `maximum_first_point_eta` parameter: then only those robots that can arrive at the loading point before the specified time will be considered.

The service expects date and time with timezone specification. Example formats:
- 2026-01-11 17:26:27.704301+00:00
- 2026-01-11T19:18:43Z

If timezone is not specified, the service assumes UTC+0 timezone.

{% 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": {}
}
```

{% endcut %}

The response returns the `id` of the created order.

{% cut "Response" %}

```json
{
    "created_at": "2025-01-29T18:02:01Z",
    "updated_at": "2025-01-29T18:02:01Z",
    "id": "5555",
    "route_points": [
        {
            "address": {
                "coordinates": [
                    55.733989,
                    37.588116
                ]
            },
            "id": "0",
            "visit_order": 0
        },
        {
            "address": {
                "coordinates": [
                    55.735120,
                    37.642817
                ]
            },
            "id": "1",
            "visit_order": 0
        }
    ],
    "status": "new",
    "eta": 100,
    "user_request_revision": "0"
}
```

{% endcut %}

<!-- Дополнительный сценарий:

- В заказе [несколько точек погрузки и доставки](https://yandex.ru/dev/sdg-robot/en/use-cases.md#multi-order). -->

||
|| 2 | Service | Evaluates the order, which takes about 1 second. The order is automatically approved, and the estimated time of arrival (ETA) to the customer is calculated. A robot is chosen for the order, the order is sent for delivery, and the order status to `performer_found`.

Additional flows:

- [No robots are available](https://yandex.ru/dev/sdg-robot/en/use-cases.md#no-free-courier) to fulfill the order.

- You manually choose a [robot](https://yandex.ru/dev/sdg-robot/en/use-cases.md#select-performer) for the order.

||
|| 3 | Partner | [Requests the order status](https://yandex.ru/dev/sdg-robot/en/ref/claims/info_handler_claims_info_post) using the order `id` obtained at step 1. This request is also used throughout the route to monitor the current order status and ETA. See [Statuses](https://yandex.ru/dev/sdg-robot/en/statuses.md).

{% cut "Request" %}

```bash
POST /claims/info?claim_id=<your_claim_id>
```

{% endcut %}

For the approved order, `status` = `accepted`. The `eta` field returns the estimated time of arrival.

{% cut "Response" %}

```json
{
    "created_at": "2025-01-29T18:02:01Z",
    "updated_at": "2025-01-29T18:02:01Z",
    "id": "5555",
    "route_points": [
        {
            "address": {
                "coordinates": [
                    55.733989,
                    37.588116
                ]
            },
            "id": "0",
            "visit_order": 0
        },
        {
            "address": {
                "coordinates": [
                    55.735120,
                    37.642817
                ]
            },
            "id": "1",
            "visit_order": 0
        }
    ],
    "status": "new",
    "eta": 100,
    "user_request_revision": "0"
}
```

{% endcut %}

||
|| 4 | Robot | Arrives at the cargo pickup point. The order status is `pickup_arrived`.
||
|| 5 | Partner | [Opens the lid](https://yandex.ru/dev/sdg-robot/en/ref/claims/open_hatch_handler_claims_open_hatch_post) to put the cargo.

{% cut "Request" %}

```bash
POST /claims/open_hatch?claim_id=<your_claim_id>&idempotency_key=<your_idempotency_key>
```

{% endcut %}

||
|| 6 | Partner | After the cargo is loaded, [confirms](https://yandex.ru/dev/sdg-robot/en/ref/claims/confirm_exchange_handler_claims_confirm_exchange_post) it.  When confirmed, the robot lid closes automatically: you don't have to send a request.

{% cut "Request" %}

```bash
POST /claims/confirm_exchange?claim_id=<your_claim_id>&idempotency_key=<your_idempotency_key>
```

{% endcut %}

||
|| 7 | Robot | Transports the cargo to the delivery point. The order status is `delivery_arrived`.  
||
|| 8 | [Customer](*app) | [Opens the lid](https://yandex.ru/dev/sdg-robot/en/ref/claims/open_hatch_handler_claims_open_hatch_post) to pick up the cargo.

{% cut "Request" %}

```bash
POST /claims/open_hatch?claim_id=<your_claim_id>&idempotency_key=<your_idempotency_key>
```

{% endcut %}

Additional flow:

- The customer [didn't pick up the order](https://yandex.ru/dev/sdg-robot/en/use-cases.md#missed).

||
|| 9 | [Customer](*app) | After receiving the cargo, the customer [confirms](https://yandex.ru/dev/sdg-robot/en/ref/claims/confirm_exchange_handler_claims_confirm_exchange_post) the delivery. When confirmed, the robot lid closes automatically: you don't have to send a request.

{% cut "Request" %}

```bash
POST /claims/confirm_exchange?claim_id=<your_claim_id>&idempotency_key=<your_idempotency_key>
```

{% endcut %}

Additional flow:

- The customer [returned the order](https://yandex.ru/dev/sdg-robot/en/use-cases.md#returned).

||
|#

{#a}

The order status changed to `delivered`. The order is complete.

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


[*app]: The customer uses the partner's mobile app.
