Sets route nodes and their sequence in the route

  1. HTTP Request
  2. Path Parameters
  3. Request Body
    1. Representation
    2. Fields
  4. 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.
    Depots and garages are only allowed to appear at the beginning and at the end of the route.
    There can be at most one garage and one depot 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 depot.
    There can be at most one garage and one depot 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 depot.

HTTP Request

POST https://courier.yandex.ru/api/v1/companies/{company_id}/routes/{route_id}/nodes

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.

Request Body

[
  {
    "type": string
  }
]
Copied to clipboard

Representation

Collapse all
Expand all

Fields

type

string

Route node type. Possible values:

  • depot
  • garage
  • order

value

object

value.address

string

Delivery address in text format.

value.amount

number

Order price in rubles.

value.comments

string

Order comments.

value.customer_id

integer

Deprecated field which is always equal to null.

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.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, 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: 500.

value.number

string

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

value.partner_id

integer

Deprecated field which is always equal to null.

value.payment_type

string

Payment type. Possible values:

  • cash — The order will be paid in cash.
  • card — The order will be paid using bank card.
  • prepaid — The order is paid and no additional payment is needed.

value.phone

string

The recipient's phone 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_id

integer

Deprecated field. Use shared_with_company_ids instead.
ID of the company 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).

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.volume

number

Order volume.

value.weight

number

Order weight.

value.number

string

Depot number.

value.status

string

The current depot visit status. Possible values:

  • unvisited
  • visited

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

Route node type. Possible values:

  • depot
  • garage
  • order

value

object

value.address

string

Delivery address in text format.

value.amount

number

Order price in rubles.

value.comments

string

Order comments.

value.customer_id

integer

Deprecated field which is always equal to null.

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.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, 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: 500.

value.number

string

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

value.partner_id

integer

Deprecated field which is always equal to null.

value.payment_type

string

Payment type. Possible values:

  • cash — The order will be paid in cash.
  • card — The order will be paid using bank card.
  • prepaid — The order is paid and no additional payment is needed.

value.phone

string

The recipient's phone 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_id

integer

Deprecated field. Use shared_with_company_ids instead.
ID of the company 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).

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.volume

number

Order volume.

value.weight

number

Order weight.

value.number

string

Depot number.

value.status

string

The current depot visit status. Possible values:

  • unvisited
  • visited

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.