Adding depots
Before getting started, the company should set up a list of depots that deliveries are made from. The depot marks the starting point for a route.
Note
Use your company ID to access the Track & Trace API. If you don't have an ID, contact us.
In Routing Workspace
-
Open Routing Workspace.
- In the menu on the left, go to Settings → Depots.
- Click Create a depot.
- Enter the depot's information and click Create.
- Via the API
-
Send a request to the depots-batch resource. The request must contain information about the depots.
To send API requests, you can use the Routing API collection. To learn how to import the collection into Postman or Bruno, see Working with an existing request collection.
Alert
The specification contains required fields for existing objects, but there are more fields for new objects. When you add new objects by sending a request to the
depots-batchresource, fill in all of the fields that are required for the depots resource.Request:
WindowsMacOS/LinuxcURL
curl -H "Content-Type: application/json" -H "Authorization: OAuth <your-token>" -X POST -d @<File_path_in_UTF-8_encoding> https://courier.yandex.ru/api/v1/companies/<your-company-id>/depots-batchFile
[ { "number":"111", "name":"Depot 1", "address":"476 5th Avenue", "lat": 73.9823, "lon": 40.7532, "time_interval":"10-22" }, { "number":"112", "name":"Depot 2", "address":"477 5th Avenue", "lat": 73.9824, "lon": 40.7533, "time_interval":"11:00 - 23:00" } ]cURL
curl -H "Content-Type: application/json" -H "Authorization: OAuth <your-OAuth-token>" -X POST -d '[{"number":"111", "name":"Depot 1", "address":"476 5th Avenue", "lat": 73.9823, "lon": 40.7532, "time_interval":"10-22"}, {"number":"112", "name":"Depot 2", "address":"477 5th Avenue", "lat": 73.9824, "lon": 40.7533, "time_interval":"11:00 - 23:00"}]' https://courier.yandex.ru/api/v1/companies/<your-company-id>/depots-batchResult:
{ "inserted": 2, "updated": 0 }