Adds a route
Adds route information to the database.
Request
POST
https://courier.yandex.ru/api/v1/companies/{company_id}/routes
Path parameters
Name |
Description |
company_id* |
Type: integer Company ID used in requests to the Track & Trace API. |
Body
application/json
{
"custom_fields": [
{
"key": "string",
"value": "string"
}
],
"date": "string",
"id": 0,
"imei": 0,
"rented_courier_id": "string",
"imei_str": "string",
"number": "string",
"route_start": "string",
"route_finish": "string",
"routing_mode": "string",
"tracking_start_h": 0,
"courier_id": 0,
"courier_number": "string",
"depot_id": 0,
"depot_number": "string"
}
Name |
Description |
date* |
Type: string<date> The date of the route in YYYY-MM-DD format. Cannot be changed if there are orders on route. |
number* |
Type: string Route number. Used for syncing with the delivery company's system. |
courier_id |
Type: integer ID of the courier who delivers items on the route. The request must specify the |
courier_number |
Type: string Mobile employee number. Used for syncing with the delivery company's system. The request must specify the |
custom_fields |
Type: CustomField[] List of route custom fields. Max number of custom fields is 10. Max items: Min items: |
depot_id |
Type: integer ID of the depot where the route starts. The request must specify the |
depot_number |
Type: string Depot number. Used for syncing with the delivery company's system. The request must specify the |
id |
Type: integer Route ID used in requests to the Track & Trace API. |
imei |
Type: integer The number of the GPS tracker installed on the vehicle on the route. |
imei_str |
Type: string String representation of numeric number of a GPS tracker. Should be used in case integer overflow of numeric number of a GPS tracker value in the programming language used. If defined in request, this takes precedence over the value of integer number of a GPS tracker field. |
rented_courier_id |
Type: string Rented courier ID used in requests to the Track & Trace API. |
route_finish |
Type: string Route finish time relative to the |
route_start |
Type: string Route start time relative to the
|
routing_mode |
Type: string Transportation method. Possible values:
|
tracking_start_h |
Type: integer Route tracking will start Min value: Max value: |
CustomField
Name |
Description |
key |
Type: string Key of custom field. Must correspond to one of route custom fields in company settings. Max length: |
value |
Type: string Value of custom field. Max length: |
Responses
200 OK
The route information was registered in the database.
Body
application/json
{
"custom_fields": [
{
"key": "string",
"value": "string"
}
],
"date": "string",
"id": 0,
"imei": 0,
"rented_courier_id": "string",
"imei_str": "string",
"number": "string",
"route_start": "string",
"route_finish": "string",
"routing_mode": "string",
"tracking_start_h": 0,
"courier_violated_route": false,
"company_id": 0,
"courier_id": 0,
"depot_id": 0
}
Name |
Description |
company_id |
Type: integer Company ID used in requests to the Track & Trace API. |
courier_id |
Type: integer ID of the courier who delivers items on the route. |
courier_violated_route |
Type: boolean Indicates if a courier visits orders' locations in the order that is different from the predefined order sequence. |
custom_fields |
Type: CustomField[] List of route custom fields. Max number of custom fields is 10. Max items: Min items: |
date |
Type: string<date> The date of the route in YYYY-MM-DD format. Cannot be changed if there are orders on route. |
depot_id |
Type: integer ID of the depot where the route starts. |
id |
Type: integer Route ID used in requests to the Track & Trace API. |
imei |
Type: integer The number of the GPS tracker installed on the vehicle on the route. |
imei_str |
Type: string String representation of numeric number of a GPS tracker. Should be used in case integer overflow of numeric number of a GPS tracker value in the programming language used. If defined in request, this takes precedence over the value of integer number of a GPS tracker field. |
number |
Type: string Route number. Used for syncing with the delivery company's system. |
rented_courier_id |
Type: string Rented courier ID used in requests to the Track & Trace API. |
route_finish |
Type: string Route finish time relative to the |
route_start |
Type: string Route start time relative to the
|
routing_mode |
Type: string Transportation method. Possible values:
|
tracking_start_h |
Type: integer Route tracking will start Min value: Max value: |
401 Unauthorized
Authorization error. Make sure that the request header contains the correct OAuth token.
403 Forbidden
Error accessing the object. The user doesn't have the rights to access the object.
422 Unprocessable Entity
Incorrect input. The operation can't be performed.
504 Gateway Timeout
Error working with the API. Repeat the request.
No longer supported, please use an alternative and newer version.