Sets route nodes and their sequence in the route
Method sets a sequence of route nodes for the route.
- Orders, depots and garages presented in the request body are created if they are not in the route yet. In this case fields
number
,address
,lat
,lon
are required for orders and garages. Additionally fieldtime_interval
is required for orders. - Orders, depots and garages already existing in the route are deleted if they are not presented in the request body. Deletion of visited nodes is forbidden.
- Orders and garages presented both in the route and in the request body are updated if they have additional fields, except for
number
.
Garages are only allowed to appear at the beginning and at the end of the route.
There can be at most one garage at the beginning of the route. If both depot and garage are present at the beginning of the route, then the garage must be before the first depot.
There can be at most one garage at the end of the route. If both depot and garage are present at the end of the route, then the garage must be after the last depot.
HTTP Request
POST https://courier.yandex.ru/api/v1/companies/{company_id}/routes/{route_id}/nodes\
?mode={string}
Path Parameters
company_id * | integer Company ID used in requests to the Track & Trace API. |
route_id * | integer Route ID used in requests to the Track & Trace API. |
* Required parameter
Query Parameters
mode | string Defines mode of handling nodes import. Valid values are: - default - default behavior presented in description. - using_ids - you can provide ids for orders: - if only number is provided, the system creates new order; - if id is provided, the system patches existing order; - this mode supports not unique drop-off order numbers. Any other POST/PATCH methods support only unique order numbers, so they return unprocessible entity error (code 422) if there are any duplicated numbers in the request or in the system (presented in request) Default value: |
mode | string Defines mode of handling nodes import. Valid values are: - default - default behavior presented in description. - using_ids - you can provide ids for orders: - if only number is provided, the system creates new order; - if id is provided, the system patches existing order; - this mode supports not unique drop-off order numbers. Any other POST/PATCH methods support only unique order numbers, so they return unprocessible entity error (code 422) if there are any duplicated numbers in the request or in the system (presented in request) Default value: |
* Required parameter
Request Body
{ "type": string, "value": { "address": string, "lat": number, "lon": number, "number": string } }
Copied to clipboard
Representation
Fields
type * | string |
value * | object |
value. | string Delivery address in text format. |
value. | number Order price in rubles. |
value. | string Order comments. |
value. | string Recipient's name. |
value. | string Order description. |
value. | string ETA type. Affects the time of notification and automatic delivery detection. |
value. | string The ID of the order that is used in requests to the Track & Trace API. |
value. | number Latitude of the delivery point. |
value. | number Longitude of the delivery point. |
value. | number Radius in meters. If Minimum value: |
value. | array List of push notification settings. |
value. | string Notification type. Allowed values
|
value. | string Order number. Used for syncing with the delivery company's system. |
value. | string Payment method. Possible values:
|
value. | string The recipient's phone number. |
value. | array |
value. | string The action performed on the order: *
|
value. | string Order number. |
value. | integer Route ID used in requests to the Track & Trace API. |
value. | integer Expected time the courier will need to pass the order to the recipient, including going up to the floor and receiving payment. |
value. | integer Service duration at the location, which can be shared with other orders at the same location. |
value. | array IDs of the companies that can access the order information. The following information is provided:
|
value. | string The current order status. Possible values:
|
value. | string Desired delivery time interval. The following formats are supported:
|
value. | string Type of order service. Allowed values
|
value. | number Order volume. |
value. | number Order weight. |
type * | string |
value * | object |
value. | string Depot number. |
value. | array |
value. | string The action performed on the order: *
|
value. | string Order number. |
value. | string The current depot visit status. Possible values:
|
type * | string |
value * | object |
value. | string Garage address in text format. |
value. | number Latitude of garage location. |
value. | number Longitude of garage location. |
value. | string Garage number. |
type * | string |
value * | object |
value. | string Delivery address in text format. |
value. | number Order price in rubles. |
value. | string Order comments. |
value. | string Recipient's name. |
value. | string Order description. |
value. | string ETA type. Affects the time of notification and automatic delivery detection. |
value. | string The ID of the order that is used in requests to the Track & Trace API. |
value. | number Latitude of the delivery point. |
value. | number Longitude of the delivery point. |
value. | number Radius in meters. If Minimum value: |
value. | array List of push notification settings. |
value. | string Notification type. Allowed values
|
value. | string Order number. Used for syncing with the delivery company's system. |
value. | string Payment method. Possible values:
|
value. | string The recipient's phone number. |
value. | array |
value. | string The action performed on the order: *
|
value. | string Order number. |
value. | integer Route ID used in requests to the Track & Trace API. |
value. | integer Expected time the courier will need to pass the order to the recipient, including going up to the floor and receiving payment. |
value. | integer Service duration at the location, which can be shared with other orders at the same location. |
value. | array IDs of the companies that can access the order information. The following information is provided:
|
value. | string The current order status. Possible values:
|
value. | string Desired delivery time interval. The following formats are supported:
|
value. | string Type of order service. Allowed values
|
value. | number Order volume. |
value. | number Order weight. |
type * | string |
value * | object |
value. | string Depot number. |
value. | array |
value. | string The action performed on the order: *
|
value. | string Order number. |
value. | string The current depot visit status. Possible values:
|
type * | string |
value * | object |
value. | string Garage address in text format. |
value. | number Latitude of garage location. |
value. | number Longitude of garage location. |
value. | string Garage number. |
* Required parameter
Responses
Code 200
Operation succeeded.
Code 400
Invalid JSON in the post body.
Code 404
Route not found.
Code 422
Incorrect input.