Sets route nodes and their sequence in the route

  1. HTTP Request
  2. Path Parameters
  3. Query Parameters
  4. Request Body
    1. Representation
    2. Fields
  5. Responses
    1. Code 200
    2. Code 400
    3. Code 404
    4. Code 422

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 field time_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.

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.

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: default.

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: default.

Request Body

{
  "type": string,
  "value": {
    "address": string,
    "lat": number,
    "lon": number,
    "number": string
  }
}
Copied to clipboard

Representation

Collapse all
Expand all

Fields

type *

string

value *

object

value.address

string

Delivery address in text format.

value.amount

number

Order price in rubles.

value.comments

string

Order comments.

value.customer_name

string

Recipient's name.

value.description

string

Order description.

value.eta_type

string

ETA type. Affects the time of notification and automatic delivery detection. arrival_time: countdown starts from the moment the courier arrives at the point; delivery_time: countdown does not start until the start of the delivery window.

value.id

string

The ID of the order that is used in requests to the Track & Trace API.

value.lat

number

Latitude of the delivery point.

value.lon

number

Longitude of the delivery point.

value.mark_delivered_radius

number

Radius in meters. If null, depot.mark_delivered_radius or company.mark_delivered_radius is used instead. Order is marked as delivered automatically if mark_delivered_enabled is true and vehicle spent at least mark_delivered_service_time_coefficient * (order.service_duration_s + order.shared_service_duration_s) seconds within mark_delivered_radius meters from the order's location.

Minimum value: 0.
Maximum value: 2000.

value.notifications[]

array

List of push notification settings.

value.notifications[].type

string

Notification type.

Allowed values
  1. before_arrival

value.number

string

Order number. Used for syncing with the delivery company's system.

value.payment_type

string

Payment method. Possible values:

  • cash — Payment to the courier in cash.
  • card — Payment to the courier by bank card.
  • prepaid — Prepayment (paid in advance).
  • yandex_pay — Payment via Yandex Pay. Can only be set internally.
Allowed values
  1. cash
  2. card
  3. prepaid
  4. yandex_pay

value.phone

string

The recipient's phone number.

value.related_orders[]

array

value.related_orders[].action

string

The action performed on the order: * pickup — load for delivery to another destination (it can be loaded from the depot and pickup order);

  • delivery — deliver to this destination (can be a depot and drop-off order).
Allowed values
  1. pickup
  2. delivery

value.related_orders[].number

string

Order number.

value.route_id

integer

Route ID used in requests to the Track & Trace API.

value.service_duration_s

integer

Expected time the courier will need to pass the order to the recipient, including going up to the floor and receiving payment.
Default value: 600 seconds.

value.shared_service_duration_s

integer

Service duration at the location, which can be shared with other orders at the same location.
Shared service duration can include operations as parking a car, delivering documents, etc.
Default value: 0 seconds.

value.shared_with_company_ids[]

array

IDs of the companies that can access the order information. The following information is provided:

  • Full information about the order.
  • General description of the route this order is a part of.
  • General description of the depot used in this order.
  • General information about the delivery company (name and logo).
    If both shared_with_company_numbers and shared_with_company_ids are specified shared_with_company_numbers is used.

value.status

string

The current order status. Possible values:

  • new — The order was created.
  • confirmed — The order delivery time was set (confirmed with recipient).
  • finished — The order was delivered.
  • partially_finished — The order was delivered only partially. Order status can be set to partially_finished
    only for companies with company.partially_finished_status_enabled flag equals true.
  • cancelled — The order was canceled.
  • postponed — The order is postponed or the courier couldn't contact the customer.

value.time_interval

string

Desired delivery time interval. The following formats are supported:

  • "T - T" or "T-T", where T is the time in HH, HH:MM, or HH:MM:SS format.
  • ISO 8601, for example, 2018-09-06T10:15:00+03:00/2018-09-06T12:45:00+03:00.

value.type

string

Type of order service.

Allowed values
  1. pickup
  2. drop_off
  3. delivery

value.volume

number

Order volume.

value.weight

number

Order weight.

type *

string

value *

object

value.number *

string

Depot number.

value.related_orders[]

array

value.related_orders[].action

string

The action performed on the order: * pickup — load for delivery to another destination (it can be loaded from the depot and pickup order);

  • delivery — deliver to this destination (can be a depot and drop-off order).
Allowed values
  1. pickup
  2. delivery

value.related_orders[].number

string

Order number.

value.status

string

The current depot visit status. Possible values:

  • unvisited
  • visited

type *

string

value *

object

value.address

string

Garage address in text format.

value.lat

number

Latitude of garage location.

value.lon

number

Longitude of garage location.

value.number *

string

Garage number.

type *

string

value *

object

value.address

string

Delivery address in text format.

value.amount

number

Order price in rubles.

value.comments

string

Order comments.

value.customer_name

string

Recipient's name.

value.description

string

Order description.

value.eta_type

string

ETA type. Affects the time of notification and automatic delivery detection. arrival_time: countdown starts from the moment the courier arrives at the point; delivery_time: countdown does not start until the start of the delivery window.

value.id

string

The ID of the order that is used in requests to the Track & Trace API.

value.lat

number

Latitude of the delivery point.

value.lon

number

Longitude of the delivery point.

value.mark_delivered_radius

number

Radius in meters. If null, depot.mark_delivered_radius or company.mark_delivered_radius is used instead. Order is marked as delivered automatically if mark_delivered_enabled is true and vehicle spent at least mark_delivered_service_time_coefficient * (order.service_duration_s + order.shared_service_duration_s) seconds within mark_delivered_radius meters from the order's location.

Minimum value: 0.
Maximum value: 2000.

value.notifications[]

array

List of push notification settings.

value.notifications[].type

string

Notification type.

Allowed values
  1. before_arrival

value.number

string

Order number. Used for syncing with the delivery company's system.

value.payment_type

string

Payment method. Possible values:

  • cash — Payment to the courier in cash.
  • card — Payment to the courier by bank card.
  • prepaid — Prepayment (paid in advance).
  • yandex_pay — Payment via Yandex Pay. Can only be set internally.
Allowed values
  1. cash
  2. card
  3. prepaid
  4. yandex_pay

value.phone

string

The recipient's phone number.

value.related_orders[]

array

value.related_orders[].action

string

The action performed on the order: * pickup — load for delivery to another destination (it can be loaded from the depot and pickup order);

  • delivery — deliver to this destination (can be a depot and drop-off order).
Allowed values
  1. pickup
  2. delivery

value.related_orders[].number

string

Order number.

value.route_id

integer

Route ID used in requests to the Track & Trace API.

value.service_duration_s

integer

Expected time the courier will need to pass the order to the recipient, including going up to the floor and receiving payment.
Default value: 600 seconds.

value.shared_service_duration_s

integer

Service duration at the location, which can be shared with other orders at the same location.
Shared service duration can include operations as parking a car, delivering documents, etc.
Default value: 0 seconds.

value.shared_with_company_ids[]

array

IDs of the companies that can access the order information. The following information is provided:

  • Full information about the order.
  • General description of the route this order is a part of.
  • General description of the depot used in this order.
  • General information about the delivery company (name and logo).
    If both shared_with_company_numbers and shared_with_company_ids are specified shared_with_company_numbers is used.

value.status

string

The current order status. Possible values:

  • new — The order was created.
  • confirmed — The order delivery time was set (confirmed with recipient).
  • finished — The order was delivered.
  • partially_finished — The order was delivered only partially. Order status can be set to partially_finished
    only for companies with company.partially_finished_status_enabled flag equals true.
  • cancelled — The order was canceled.
  • postponed — The order is postponed or the courier couldn't contact the customer.

value.time_interval

string

Desired delivery time interval. The following formats are supported:

  • "T - T" or "T-T", where T is the time in HH, HH:MM, or HH:MM:SS format.
  • ISO 8601, for example, 2018-09-06T10:15:00+03:00/2018-09-06T12:45:00+03:00.

value.type

string

Type of order service.

Allowed values
  1. pickup
  2. drop_off
  3. delivery

value.volume

number

Order volume.

value.weight

number

Order weight.

type *

string

value *

object

value.number *

string

Depot number.

value.related_orders[]

array

value.related_orders[].action

string

The action performed on the order: * pickup — load for delivery to another destination (it can be loaded from the depot and pickup order);

  • delivery — deliver to this destination (can be a depot and drop-off order).
Allowed values
  1. pickup
  2. delivery

value.related_orders[].number

string

Order number.

value.status

string

The current depot visit status. Possible values:

  • unvisited
  • visited

type *

string

value *

object

value.address

string

Garage address in text format.

value.lat

number

Latitude of garage location.

value.lon

number

Longitude of garage location.

value.number *

string

Garage number.

Responses

Code 200

Operation succeeded.

Code 400

Invalid JSON in the post body.

Code 404

Route not found.

Code 422

Incorrect input.