Edits multiple orders

Adds information about new orders to the database or updates information about existing ones if their numbers match.

Request

POST

https://courier.yandex.ru/api/v1/companies/{company_id}/orders-batch

Path parameters

Name

Description

company_id*

Type: integer

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

Body

application/json
[
    {
        "address": "string",
        "amount": 0,
        "comments": "string",
        "customer_name": "string",
        "description": "string",
        "lat": 0,
        "lon": 0,
        "number": "string",
        "customer_number": "string",
        "payment_type": "cash",
        "payment_status": "paid",
        "phone": "string",
        "route_id": 0,
        "service_duration_s": 0,
        "shared_service_duration_s": 0,
        "status": "string",
        "volume": 0,
        "weight": 0,
        "shared_with_company_ids": [
            0
        ],
        "mark_delivered_radius": null,
        "eta_type": null,
        "time_interval": "string",
        "route_number": "string",
        "shared_with_company_numbers": [
            "string"
        ],
        "type": "string",
        "show_yandex_pay_button": false,
        "refined_lat": 0,
        "refined_lon": 0,
        "notifications": [
            {
                "type": "before_arrival"
            }
        ]
    }
]

OrdersBatch[]

OrdersBatch

Order for batch operations. For an existing order you should specify 'number'. For a new order you should specify 'number', 'time_interval', 'address', 'lat', 'lon', and also 'route_number' or 'route_id'.

Name

Description

address

Type: string

Delivery address in text format.

amount

Type: number<float>

Order price in rubles.

Min value: 0

comments

Type: string

Order comments.

customer_name

Type: string

Recipient's name.

Max length: 1023

customer_number

Type: string

Customer's number in the delivery company database.

Max length: 128

description

Type: string

Order description.

Max length: 1023

eta_type

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.

Default: null

lat

Type: number<float>

Latitude of the delivery point.

lon

Type: number<float>

Longitude of the delivery point.

mark_delivered_radius

Type: number<float>

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.

Default: null

Min value: 0

Max value: 10000

notifications

Type: RouteOrderNotification[]

List of push notification settings.

number

Type: string

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

Max length: 80

payment_status

Type: string

Payment status. Possible values:

  • paid — The order is already paid.
  • unpaid — The order is not paid yet.

Enum: paid, unpaid, null

payment_type

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.

Enum: cash, card, prepaid, yandex_pay, null

phone

Type: string

The recipient's phone number.

refined_lat

Type: number<float>

Latitude of the real (refined by courier) delivery point.

refined_lon

Type: number<float>

Logitude of the real (refined by courier) delivery point.

route_id

Type: integer

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

route_number

Type: string

Route number. Used for syncing with the delivery company's system. You must specify route_id or route_number in the request to create a new order. If both route_id or route_number are specified route_number is used.

service_duration_s

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

shared_service_duration_s

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

shared_with_company_ids

Type: number[]

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.

shared_with_company_numbers

Type: string[]

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

show_yandex_pay_button

Type: boolean

Show Yandex Pay button.

status

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

time_interval

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

type

Type: string

Type of order. Possible values delivery, pickup, drop_off.

volume

Type: number<float>

Order volume.

weight

Type: number<float>

Order weight.

RouteOrderNotification

Name

Description

type

Type: string

Notification type.

Enum: before_arrival

Responses

200 OK

Deprecated

Information about orders was registered or updated in the database.

401 Unauthorized

Deprecated

Authorization error. Make sure that the request header contains the correct OAuth token.

403 Forbidden

Deprecated

Error accessing the object. The user doesn't have the rights to access the object.

404 Not Found

Deprecated

Object search error. Object not found.

422 Unprocessable Entity

Deprecated

Incorrect input. The operation can't be performed.

504 Gateway Timeout

Deprecated

Error working with the API. Repeat the request.