Creating an order with a dish by weight
Introduction
In r_k Delivery it is possible to create an order with dishes sold by weight.
To enable the functionality of weighted dishes in the interface of the establishment and call center, you need White Server Agent version 2.7.1.7 or higher.
To create a delivery order with a weighed dish:
- Create a dish in the manager station
- In the r_k Delivery admin panel, add a dish to the menu view
- Create an order with a dish sold by weight.
This article will look at an example of creating and selling a weighed dish 'cake'.
Presets
Create a dish at the Manager Station.
- Create a weighed dish, such as Medovik Cake (Russian Honey Cake)
- Set the price and activate the dish
- In the Servings section, specify:
- Add to order - Merge
- Unit type - Kilogram
- Turn off the setting 1 Weight change. If it is turned on, the weight of all weighed items will have to be confirmed at the cash register
- Turn on the Don't pack setting
- Portion weight — the weight of a cake portion in the example establishment is 250 grams. In the field, enter 0.25, since the unit of measurement selected is kilograms
- Price mode — Portion per Standard Portion. In this case, the specified price will be applied specifically to the portion, that is, 250 grams of cake will cost 350 rubles.
- Save the changes.
In the same way, create a dish sold by weight, for example, Candies by weight. Only in the dish settings, in the Price mode field, select Portion by weight.
Then add the dish to the menu view in the r_k Delivery admin panel.
- Go to the r_k Delivery admin panel
- Go to Menu > Restaurant Menu View
- Select a group and add a weighed dish to it
- Click on the Publish menu for establishments button.
Done, the weighed dish has been added to the view. Now it can be sold.
Creating an order
Request
To create an order, use the query:
POST https://delivery.ucs.ru/orders/api/v1/orders
Content-Type specify application/json.
You can only add weight to a dish when adding it to an order. If you enter weight into an existing dish in the order, it will not be split into portions.
Request body example
{
"comment": "cook with love ",
"restaurantId": "a7db6017-3f7b-444d-a1d4-9c277b28ffd0",
"persons": "1",
"dishList": [
{
"id": "8198255e-1c7a-702a-a512-05b1803561e5",
"name": "Candy - weight",
"price": "500",
"imageUrls":[
],
"measure": {
"value": 0.100,
"unit": "kg",
"priceMode": "PerUnitOfWeight",
"qntDecDigits": 3,
"changeQntOnce": false,
"joinMode": "almOnePortion"
},
"quantity": 0.75,
},
],
"expeditionType": "delivery",
"expectedAt":"2022-12-23T18:03:42.504+03:00",
"paymentTypeId": "card",
"changeFrom": "5000",
"guest": {
"email": "eewd@dgf.ru",
"phone": "79991234567",
"firstName": "Oleg"
},
"address": {
"postcode": "109443",
"cityId": "73439fb3-c0c4-42ca-a269-64f031a6a33b",
"street": "Yunykh Lenintsev",
"comment": " the house is to the right of the school",
"lat": "55.700897",
"lon": "37.773808",
"cityName": "Moscow",
"entrance": "1",
"houseNumber": "85",
"apartmentNumber": "6",
"subway": "Kuzminki",
"fullAddress": "109443, Moscow, Yunykh Lenintsev st., 85 sec. 2, app. 6"
}
}
Depending on the delivery method: delivery — delivery by courier or pickup — self-pickup, the required fields change.
To ensure that the system transfers orders immediately, specify the Asap parameter in the request. In this case, do not specify the expectedAt parameter, as it becomes optional. Asap orders are transferred to the cash register with minimal delay.
Parameter | Parameter type | Description |
---|---|---|
comment | string | Comment to order |
restaurantId | string | Restaurant ID from Delivery in GUID format |
persons | int | Number of persons |
dishList | array | Order contents |
-id | string | The ID of the dish from the Delivery menu view, which is used for synchronization with the cash register, in GUID format. |
-name | string | Name of the dish |
-price | double the separator will always be a period - "." | Price of the dish |
-measure | Weight parameters. Backward compatibility is supported: if you pass null or do not pass parameters from measure, the system will automatically substitute data from the menu. In case of passing empty strings or values different from the values in the menu, an exception will occur when creating an order. | |
--value | double | Serving size |
--unit | string | Unit of measurement: kg, liter, pcs. The meaning is not a dictionary one. |
--priceMode | string | Cost calculation parameter set in r_keeper. Acceptable values:
|
--qntDecDigits | double | Number of digits in weight after the decimal point, configured in r_keeper |
--changeQntOnce | string | Is it possible to change the weight, a dish setting from r_keeper |
--joinMode | string | Parameter for adding to order, configured in r_keeper. Allowed values:
|
-quantity | double the separator will always be a period - "." | Weight of the added portion |
-ingredients | array | Ingredients |
--id | string | The ingredient ID from the Delivery menu view that is used to sync with the cash register, in GUID format |
--name | string | Ingredient name |
--price | double the separator will always be a period - "." | Price of ingredient |
--quantity | double the separator will always be a period - "." | Quantity of ingredient |
--ingredients | array | modifiers |
---id | string | the modifier ID from the Delivery menu view that is used to synchronize with the cash register, in GUID format. |
---name | string | modifier name |
---price | double the separator will always be a period - "." | modifier price |
---quantity | double the separator will always be a period - "." | modifier quantity |
expeditionType | string | order receiving method ID:
|
soonest | boolean | order transfer time As soon as possible |
expectedAt | DateTime | the time by which the order is expected |
paymentTypeId | string | payment method ID:
|
changeFrom | double the separator will always be a period - "." | change from what amount |
guest | guest | |
string | guest Email | |
-phone | string | phone number |
-firstName | string | name |
-lastName | string | last name |
address | delivery address | |
-postcode | string | zip code |
-street | string | street |
-comment | string | comment to the address |
-lat | double the separator will always be a period - "." | latitude |
-lon | double the separator will always be a period - "." | longitude |
-cityId | string | city ID |
-cityName | string | name of the city |
-floor | int | floor |
-houseNumber | string | house number |
-apartmentNumber | string | apartment number |
-entrance | string | entrance |
-subway | string | subway |
-fullAddress | string | full address |
Example answer
{
"result": {
"orderId": "233132",
"restaurant": {
"phone": "79123456789, 79987654321",
"address": "Bagrationovsky proezd 3"
},
}
}
An example of sending such a request to the establishment interface:
Editing an order
You can only add weight to a dish when adding it to an order. If you enter weight into an existing dish in the order, it will not be split into portions.
Request
PATCH https://delivery.ucs.ru/orders/api/v1/orders/{orderId}
where {orderId} is the order number.
Content-Type specify application/json.
Request body example
{
"dishList": [
{
"id": "8198255e-1c7a-702a-a512-05b1803561e5",
"name": "Candy - weight",
"price": "500",
"imageUrls":[
],
"measure": {
"value": 0.100,
"unit": "kg",
"priceMode": "PerUnitOfWeight",
"qntDecDigits": 3,
"changeQntOnce": false,
"joinMode": "almOnePortion"
},
"quantity": 0.55,
},
],
}
To change the weight of a dish, change the quantity parameter.
Example answer
{
"result": {
"item1": {
"orderId": "233132",
"restaurant": null,
"onlinePayUrl": null
},
"item2": {}
}
}
An example of sending such a request to the establishment interface - the weight of the dish and the price of the order have been changed: