CreateOrder
Description
Purpose | Create a restaurant order by objectId |
Request type | Asynchronous/synchronous |
Supported agent version | v1, v2 |
PluggetSystemType | RKMid |
Request format
Description of parameters
|
Parameter | Type | Mandatory | Description | Default value |
---|---|---|---|---|
async | - | Asynchronous method call (either synchronous or asynchronous) | ||
sync | - | Synchronous method call (either synchronous or asynchronous) | ||
timeout | int | - | Agent response time in seconds | 120 seconds |
objectId | int | yes | Restaurant code in the licensing system | |
systemName | string | нет | Specifying the particular connected system for which the request is being made | |
order | yes | |||
withRkId | GUID | - | If specified, the order is created in r_keeper with the specified guid value. Valid only for agent versions 2.5.4.10 and above | |
originalOrderId | string | - | External order number | |
sourceOrderId | string | - | Initial order identifier (for example, identifier in the Yandex system). Optional. Saved in r_keeper in the extended field of the same name | |
booking | object | - | Reservation of an order (table) for a specified time. If a connection to KDS PRO is configured, you need to make additional settings on the KDS PRO side - in the Operations on postponed dishes section, set When the cooking time arrives.
| |
|-time | dateTime | + | Booking start time in the format YYYY-MM-DDTHH:MM:SS | |
|-duration | object | + | Duration of the reservation | |
|-hours | number | + | Duration in hours | |
|-minutes | number | + | Duration in minutes | |
expectedStartTime | string | - | Planned start time of order preparation. Optional. Saved in r_keeper in the extended field of the same name | |
payment | object | - | ||
|- type | string | yes | Payment type: cash – payment in cash, card – payment by card, online – online payment. In case of online option we consider that the order is paid | |
|- nettingPayment | boolean | - | If True, then the order is for mutual settlement from Yandex | |
|- deliveryFee | decimal | - | Delivery Cost. Only for delivery multi-agent | |
customer | object | - | Guest | |
|- name | string | - | Guest name | |
|- phone | string | - | Guest phone | |
|- email3 | string | - | Guest Email | |
expeditionType | string | yes | Delivery type. Options: delivery, pickup. You can save the value via the order type and category. | |
pickup | object | - | Pickup if expeditionType = pickup | |
|- courier | object | - | Information about the courier | |
|- name | string | - | The name of the courier, if taker = courier | |
|- phone | string | - | Courier's phone number, if taker = courier | |
|- expectedTime | DateTime | yes | Time by which the order must be ready | |
|- taker | string | yes | Who will pick up the order from the restaurant. Options: courier, customer. The value can be saved via the order type and category | |
delivery | object | - | Delivery by restaurant courier if expeditionType = delivery | |
|- address | object | - | Address | |
|- fullAddress | string | - | Full address | |
|- subway | string | - | Subway | |
|- region | string | - | Region | |
|- city | object | - | ||
|- name | string | - | City | |
|- street | object | - | ||
|- name | string | - | Street | |
|- houseNumber | string | - | Building number | |
|- flatNumber | string | - | Apartment number | |
|- entrance1 | string | - | Entrance | |
|- intercom1 | string | - | Intercom | |
|- floor | string | - | Floor | |
|- coordinates | - | Coordinates | ||
|- latitude | string | - | Latitude | |
|- longitude | string | - | Longitude | |
|- comment | string | - | Comment to the address | |
|- courier | object | - | Information about the courier | |
|- name | string | - | Courier name | |
|- phone | string | - | Courier phone number | |
changeBackFrom | decimal | - | The amount for which change is needed | |
products | array | yes | Order content | |
|- id | int | yes | Dish ID | |
|- name | string | - | Name of the dish | |
|- price | money | - | Price for one dish. The separator between the whole and fractional parts of the amount must be a dot | |
|- quantity | money | yes | Number of dishes | |
|- discountIds | array | - | Array of cash discount identifiers for dishes | |
|- id | int | - | Discount ID | |
|- value | decimal | - | Discount value. Specify the amount or percentage. 0 is full application of the discount. Both positive and negative values can be specified. | |
|- yandexPromos | array | - | List of Yandex.Eda service promotions for a dish. Served only by a multi-agent delivery | |
|- type | string | + | Type of promo (GIFT/PERCENTAGE/FIXED/COFINANCE) | |
|- discount | number | + | The value of a promotional discount | |
|- partnerDiscount | number | - | The partnerDiscount and yandexDiscount fields appear if the discount type is COFINANCE | |
|- yandexDiscount | number | - | the partnerDiscount and yandexDiscount fields appear if the discount type is COFINANCE | |
|- comment | string | - | Commentary on the dish. Only for agent versions 2.6.7.1 and above | |
|- ingredients | array | - | Ingredients or content of a combo dish | |
|- id | int | yes | Ingredient ID | |
|- name | string | - | Name of modifier or combo component | |
|- quantity | money | - | Quantity | |
|- price | money | - | Price | |
|- ingredients | array | - | Array of modifiers for combo components. Only for agent versions 2.7.9.1 and above | |
|- id | int | yes | Modifier ID | |
|- name | string | - | Modifier name | |
|- quantity | money | - | Quantity | |
|- price | money | - | Price | |
tableCode3 | int | - | Table Code (Agent v2 only) | |
extraTableCodes3 | int[] | - | Additional tables for booking (Agent v2 only) | |
orderCategoryCode4 | int | - | Order category code (agent v2 only). If not specified, taken from default settings | |
orderTypeCode4 | int | - | Order type code (Agent v2 only). If not specified, taken from default settings | |
prePayments | array | - | Prepayment data array (optional). Available only from agent version 2.6.7.3 onwards.
| |
- amount | money | + | The value of the amount to be paid. The separator between the integer and fractional parts of the amount must be a dot | |
- currency | guid | + | currency guid | |
guestTypeId3 | int | - | Guest type ID. If not specified, taken from the Restaurant Order Creation Options settings | |
discountIds2,3 | int[]/ object[] | - | Array of cash discount identifiers. GetRefData(DISCOUNTS).Ident Only from agent versions 2.7.3.20 and above | |
- id | int | Discount ID | ||
- value | decimal | Discount value. Specify the amount or percentage. 0 is full application of the discount. Both positive and negative values can be specified. | ||
source | string | - | Extended Property Order Source GetRefData(ENUMSTYPESDATAS).EnumValue | |
platform | string | - | Only for orders from Yandex.Service. Platform type (YA, DC) where the order came from | |
yandexPromos | array | - | List of Yandex.Eda service promotions for the entire order. Served only by a multi-agent delivery | |
|- type | string | + | Type of promo (GIFT/PERCENTAGE/FIXED/COFINANCE) | |
|- discount | number | + | The value of a promotional discount | |
|- partnerDiscount | number | - | The partnerDiscount and yandexDiscount fields appear if the discount type is COFINANCE | |
|- yandexDiscount | number | - | The partnerDiscount and yandexDiscount fields appear if the discount type is COFINANCE | |
payMethod | string | - | Payment method. From WSA version 2.8.2.1 |
Notes | |
---|---|
1 | Currently WSA2 is ignored (typos in field names on the WSA side) |
2 | Currently DTO WS is ignored (no fields in DTO) |
3 | Field missing in multi-agent DTO (delivery service) |
4 | The field is present in the multi-agent DTO (delivery service), but is not used in the logic |
Response format
|
Parameter | Type | Description |
---|---|---|
taskGuid | guid | The unique code of this task is used when receiving the task through the queue. |
taskType | string enum | Task type |
objectId | int | Restaurant code in the licensing system |
error | Error container, see Error description |
Asynchronous response format
|
Description of parameters
Parameter | Parameter type | Mandatory | Description |
---|---|---|---|
orderGuid | guid | - | Obtained from r_keeper Guid of the created order |
tableCode | int | - | Table code |
status | object | - | |
|- value | string | - | Order status. Restaurant Cancelled will return if the order is cancelled at the restaurant |
|- isBillPrinted | bool | yes | Mark indicating whether the order guest bill has been printed |
rejectingReason | - | ||
|- code | string | - | Cancellation code at cash register |
| -message | string | - | Reason for order cancellation at cash register |
error | string enum | - | Error container, see Error Description |
queuePosition | string | - | The queue number generated by RK7. WSA 2.7.7.1, RK7 7.06.05.459. It is generated according to the rule: the cash register code is transmitted as a Latin letter + the last digits of the order number |
Example api json request from client
|