Single courier routing

  1. Step 1. Send a request to build a route
  2. Step 2. Get the processing result

Request to this resource builds a route for the courier, accounting for traffic and delivery periods.

Step 1. Send a request to build a route

Request:

curl -X POST "https://courier.yandex.ru/vrs/api/v1/add/svrp?apikey=<your API key>" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"depot\": {\"time_window\": \"07:00:00-23:59:59\",\" point\": {\"lat\": 55.751245,\"lon\": 37.618424}},\"locations\":[{\"id\":1,\"time_window\": \"07:00:00-23:59:59\",\" point\": {\"lat\": 55.751245,\"lon\": 37.618424}}],\" vehicle\": {\"id\": 0}, \"options\":{\"time_zone\": 3}}"
Copied to clipboard

The request must contain the API key you obtained. If you don't have a key, submit a connection request.

Response:

The server response contains information about the request processing status.

{
  "id": "4073f13e-ee1e-4f76-a990-725ace27f951",
  "status": {
    "queued": 1533895665.9222
  },
  "message": "Task queued"
}
Copied to clipboard

Save the resulting ID to use it in the next step.

Information about the request body is available on the service page.

Step 2. Get the processing result

You can obtain the built route by sending a GET request to the service.

Request:

curl -X GET "https://courier.yandex.ru/vrs/api/v1/result/svrp/41231f83e-ee1e-4f76-a990-725dce27f951"
Copied to clipboard

Response:

If the route was built, the response will contain information about the route. Otherwise, the response will contain information about the request processing status.

Contact support