Adds an order
Adds order information to the database.
HTTP Request
POST https://courier.yandex.ru/api/v1/companies/{company_id}/orders
Path Parameters
company_id * | integer Company ID used in requests to the Track & Trace API. |
company_id * | integer Company ID used in requests to the Track & Trace API. |
* Required parameter
Request Body
{ "address": string, "amount": number, "comments": string, "customer_name": string, "customer_number": string, "description": string, "eta_type": string, "lat": number, "lon": number, "mark_delivered_radius": number, "notifications": [ { "type": string } ], "number": string, "payment_type": string, "phone": string, "refined_lat": number, "refined_lon": number, "route_id": integer, "route_number": string, "service_duration_s": integer, "shared_service_duration_s": integer, "shared_with_company_ids": [ number ], "shared_with_company_numbers": [ string ], "status": string, "time_interval": string, "type": string, "volume": number, "weight": number }
Copied to clipboard
Representation
Fields
address * | string Delivery address in text format. |
amount | number Order price in rubles. |
comments | string Order comments. |
customer_name | string Recipient's name. |
customer_number | string Customer's number in the delivery company database. |
description | string Order description. |
eta_type | string ETA type. Affects the time of notification and automatic delivery detection. |
lat * | number Latitude of the delivery point. |
lon * | number Longitude of the delivery point. |
mark_delivered_radius | number Radius in meters. If Minimum value: |
notifications[] | array List of push notification settings. |
notifications[]. | string Notification type. Allowed values
|
number * | string Order number. Used for syncing with the delivery company's system. |
payment_type | string Payment type. Possible values:
|
phone | string The recipient's phone number. |
refined_lat | number Latitude of the real (refined by courier) delivery point. |
refined_lon | number Logitude of the real (refined by courier) delivery point. |
route_id | integer Route ID used in requests to the Track & Trace API. |
route_number | string Route number. Used for syncing with the delivery company's system. You must specify |
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. |
shared_service_duration_s | integer Service duration at the location, which can be shared with other orders at the same location. |
shared_with_company_ids[] | array IDs of the companies that can access the order information. The following information is provided:
|
shared_with_company_numbers[] | array Numbers of the companies that can access the order information. The following information is provided:
|
status | string The current order status. Possible values:
|
time_interval * | string Desired delivery time interval. The following formats are supported:
|
type | string Type of order. Possible values |
volume | number Order volume. |
weight | number Order weight. |
address * | string Delivery address in text format. |
amount | number Order price in rubles. |
comments | string Order comments. |
customer_name | string Recipient's name. |
customer_number | string Customer's number in the delivery company database. |
description | string Order description. |
eta_type | string ETA type. Affects the time of notification and automatic delivery detection. |
lat * | number Latitude of the delivery point. |
lon * | number Longitude of the delivery point. |
mark_delivered_radius | number Radius in meters. If Minimum value: |
notifications[] | array List of push notification settings. |
notifications[]. | string Notification type. Allowed values
|
number * | string Order number. Used for syncing with the delivery company's system. |
payment_type | string Payment type. Possible values:
|
phone | string The recipient's phone number. |
refined_lat | number Latitude of the real (refined by courier) delivery point. |
refined_lon | number Logitude of the real (refined by courier) delivery point. |
route_id | integer Route ID used in requests to the Track & Trace API. |
route_number | string Route number. Used for syncing with the delivery company's system. You must specify |
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. |
shared_service_duration_s | integer Service duration at the location, which can be shared with other orders at the same location. |
shared_with_company_ids[] | array IDs of the companies that can access the order information. The following information is provided:
|
shared_with_company_numbers[] | array Numbers of the companies that can access the order information. The following information is provided:
|
status | string The current order status. Possible values:
|
time_interval * | string Desired delivery time interval. The following formats are supported:
|
type | string Type of order. Possible values |
volume | number Order volume. |
weight | number Order weight. |
* Required parameter
Responses
Code 200
Order information was registered in the database.
{ "address": string, "amount": number, "comments": string, "company_id": integer, "confirmed_at": string, "customer_name": string, "delivered_at": string, "description": string, "eta_type": string, "history": [ { "event": string, "position": { "lat": number, "lon": number, "time": string }, "source": { "initiator": string }, "time": string, "timestamp": number, "used_mark_delivered_radius": number } ], "id": integer, "lat": number, "lon": number, "mark_delivered_radius": number, "number": string, "order_status_comments": [ { "comment": string, "id": integer, "status": string } ], "payment_type": string, "phone": string, "refined_lat": number, "refined_lon": number, "route_id": integer, "service_duration_s": integer, "shared_service_duration_s": integer, "shared_with_companies": [ { "id": integer, "name": string, "number": string } ], "shared_with_company_ids": [ number ], "status": string, "status_log": [ { "point": { "lat": number, "lon": number }, "status": string, "timestamp": number } ], "time_interval": string, "time_interval_secs": [ number ], "time_window": { "end": string, "start": string }, "volume": number, "weight": number }
Copied to clipboard
Representation
Fields
address * | string Delivery address in text format. |
amount | number Order price in rubles. |
comments | string Order comments. |
company_id | integer Company ID used in requests to the Track & Trace API. |
confirmed_at | string Time when the order was agreed. |
customer_name | string Recipient's name. |
delivered_at | string The time when information about the order was recorded in Track & Trace API. |
description | string Order description. |
eta_type | string ETA type. Affects the time of notification and automatic delivery detection. |
history[] | array History of events that change the order status. |
history[]. | string Name of the event that occurred. Possible values: ORDER_CREATED, START, ORDER_BECAME_NEXT, STATUS_UPDATE, INTERVAL_UPDATE, ARRIVAL, ORDER_VISIT, DEPARTURE. |
history[]. | object Courier position. Appears only in events ARRIVAL, ORDER_VISIT, DEPARTURE. |
history[]. | number Courier position latitude. |
history[]. | number Courier position longitude. |
history[]. | string The client time of the event in ISO 8601 format. |
history[]. | object Source of the event. Appears only in event STATUS_UPDATE. |
history[]. | string Initiator of the event, possible values: yandex, app, user_api. |
history[]. | string Event time in ISO 8601 format. |
history[]. | number Event time (UNIX timestamp). |
history[]. | number The value of order.mark_delivered_radius or depot.mark_delivered_radius or company.mark_delivered_radius that was used to mark the order as visited. Appears only in events ARRIVAL, ORDER_VISIT, DEPARTURE. Minimum value: |
id | integer The ID of the order that is used in requests to the Track & Trace API. |
lat * | number Latitude of the delivery point. |
lon * | number Longitude of the delivery point. |
mark_delivered_radius | number Radius in meters. If Minimum value: |
number * | string Order number. Used for syncing with the delivery company's system. |
order_status_comments[] | array |
order_status_comments[]. | string Comment for order status update event. |
order_status_comments[]. | integer ID of the order status update event. |
order_status_comments[]. | string The current order status. Possible values:
|
payment_type | string Payment type. Possible values:
|
phone | string The recipient's phone number. |
refined_lat | number Latitude of the real (refined by courier) delivery point. |
refined_lon | number Logitude of the real (refined by courier) delivery point. |
route_id | integer Route ID used in requests to the Track & Trace API. |
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. |
shared_service_duration_s | integer Service duration at the location, which can be shared with other orders at the same location. |
shared_with_companies[] | array |
shared_with_companies[]. | string Company name. |
shared_with_companies[]. | string Company number. |
shared_with_companies[]. | integer Company ID used in requests to the Track & Trace API. |
shared_with_company_ids[] | array IDs of the companies that can access the order information. The following information is provided:
|
status | string The current order status. Possible values:
|
status_log[] | array |
status_log[]. | object |
status_log[]. | number Latitude of the point where changes were made. |
status_log[]. | number Longitude of the point where changes were made. |
status_log[]. | string The current order status. Possible values:
|
status_log[]. | number The time when changes were made (UNIX timestamp). |
time_interval * | string Desired delivery time interval. The following formats are supported:
|
time_interval_secs[] | array time_interval value converted into seconds from midnight. |
time_window | object Allowed time window to visit location, in ISO 8601 format. |
time_window. | string |
time_window. | string |
volume | number Order volume. |
weight | number Order weight. |
address * | string Delivery address in text format. |
amount | number Order price in rubles. |
comments | string Order comments. |
company_id | integer Company ID used in requests to the Track & Trace API. |
confirmed_at | string Time when the order was agreed. |
customer_name | string Recipient's name. |
delivered_at | string The time when information about the order was recorded in Track & Trace API. |
description | string Order description. |
eta_type | string ETA type. Affects the time of notification and automatic delivery detection. |
history[] | array History of events that change the order status. |
history[]. | string Name of the event that occurred. Possible values: ORDER_CREATED, START, ORDER_BECAME_NEXT, STATUS_UPDATE, INTERVAL_UPDATE, ARRIVAL, ORDER_VISIT, DEPARTURE. |
history[]. | object Courier position. Appears only in events ARRIVAL, ORDER_VISIT, DEPARTURE. |
history[]. | number Courier position latitude. |
history[]. | number Courier position longitude. |
history[]. | string The client time of the event in ISO 8601 format. |
history[]. | object Source of the event. Appears only in event STATUS_UPDATE. |
history[]. | string Initiator of the event, possible values: yandex, app, user_api. |
history[]. | string Event time in ISO 8601 format. |
history[]. | number Event time (UNIX timestamp). |
history[]. | number The value of order.mark_delivered_radius or depot.mark_delivered_radius or company.mark_delivered_radius that was used to mark the order as visited. Appears only in events ARRIVAL, ORDER_VISIT, DEPARTURE. Minimum value: |
id | integer The ID of the order that is used in requests to the Track & Trace API. |
lat * | number Latitude of the delivery point. |
lon * | number Longitude of the delivery point. |
mark_delivered_radius | number Radius in meters. If Minimum value: |
number * | string Order number. Used for syncing with the delivery company's system. |
order_status_comments[] | array |
order_status_comments[]. | string Comment for order status update event. |
order_status_comments[]. | integer ID of the order status update event. |
order_status_comments[]. | string The current order status. Possible values:
|
payment_type | string Payment type. Possible values:
|
phone | string The recipient's phone number. |
refined_lat | number Latitude of the real (refined by courier) delivery point. |
refined_lon | number Logitude of the real (refined by courier) delivery point. |
route_id | integer Route ID used in requests to the Track & Trace API. |
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. |
shared_service_duration_s | integer Service duration at the location, which can be shared with other orders at the same location. |
shared_with_companies[] | array |
shared_with_companies[]. | string Company name. |
shared_with_companies[]. | string Company number. |
shared_with_companies[]. | integer Company ID used in requests to the Track & Trace API. |
shared_with_company_ids[] | array IDs of the companies that can access the order information. The following information is provided:
|
status | string The current order status. Possible values:
|
status_log[] | array |
status_log[]. | object |
status_log[]. | number Latitude of the point where changes were made. |
status_log[]. | number Longitude of the point where changes were made. |
status_log[]. | string The current order status. Possible values:
|
status_log[]. | number The time when changes were made (UNIX timestamp). |
time_interval * | string Desired delivery time interval. The following formats are supported:
|
time_interval_secs[] | array time_interval value converted into seconds from midnight. |
time_window | object Allowed time window to visit location, in ISO 8601 format. |
time_window. | string |
time_window. | string |
volume | number Order volume. |
weight | number Order weight. |
* Required parameter
Code 401
Authorization error. Make sure that the request header contains the correct OAuth token.
Code 422
Incorrect input. The operation can't be performed.
Code 504
Error working with the API. Repeat the request.
Example
Responses:
{ "history": [ { "time": "2019-05-27T17:18:52+03:00" } ], "time_window": { "end": "2019-03-06T17:16:30+03:00", "start": "2019-03-06T17:15:00+03:00" } }
Copied to clipboard