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:

  1. Create a dish in the manager station
  2. In the r_k Delivery admin panel, add a dish to the menu view
  3. 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.

  1. Create a weighed dish, such as Medovik Cake (Russian Honey Cake)
  2. Set the price and activate the dish
  3. 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.
  4. 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.

  1. Go to the r_k Delivery admin panel 
  2. Go to Menu > Restaurant Menu View
  3. Select a group and add a weighed dish to it
  4. 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
CODE

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" 
  } 
}
CODE

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.

ParameterParameter typeDescription
commentstringComment to order
restaurantIdstringRestaurant ID from Delivery in GUID format
personsintNumber of persons
dishListarrayOrder 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.

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

--valuedoubleServing size
--unitstringUnit of measurement: kg, liter, pcs. The meaning is not a dictionary one.
--priceModestringCost calculation parameter set in r_keeper. 

Acceptable values:

  • PerUnitOfWeight — portion by weight, calculated as quantity = weight
  • PerPortion — portion for a standard portion is calculated as:
    • quantity = weight/value
    • weight = quantity*value
  • PerDose — portion for drinks, calculated as:
    • quantity = weight/value
    • weight = quantity*value
--qntDecDigitsdoubleNumber of digits in weight after the decimal point, configured in r_keeper
--changeQntOncestringIs it possible to change the weight, a dish setting from r_keeper
--joinModestring

Parameter for adding to order, configured in r_keeper. Allowed values:

  • almJoinLines — merge. Adds a weight/quantity to the same one existing in the order
  • almSeparately — on a separate line
  • almOnePortion — a separate line for each portion
-quantity

double

the separator will always be a period - "." 

Weight of the added portion
 -ingredientsarrayIngredients
--idstringThe ingredient ID from the Delivery menu view that is used to sync with the cash register, in GUID format
--namestringIngredient 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
--ingredientsarraymodifiers 
---idstringthe modifier ID from the Delivery menu view that is used to synchronize with the cash register, in GUID format.
---namestringmodifier name
---price

double

the separator will always be a period - "." 

modifier price
---quantity

double

the separator will always be a period - "." 

modifier quantity
expeditionTypestring

order receiving method ID:

  • delivery — delivery by a courier
  • pickup — self-pickup 
soonestbooleanorder transfer time As soon as possible
expectedAtDateTimethe time by which the order is expected
paymentTypeIdstring

payment method ID:

  • cash — payment in cash
  • card — payment by card
  • online — online payment.
changeFrom

double

the separator will always be a period - "." 

change from what amount
guest
guest
-emailstringguest Email
-phonestringphone number
-firstNamestringname
-lastNamestringlast name 
address
delivery address
-postcodestringzip code
-streetstringstreet
-commentstringcomment to the address
-lat

double

the separator will always be a period - "." 

latitude
-lon

double

the separator will always be a period - "." 

longitude
-cityIdstringcity ID
-cityNamestringname of the city
-floorintfloor
-houseNumberstringhouse number
-apartmentNumberstringapartment number
-entrancestringentrance
-subwaystringsubway
-fullAddressstringfull address

Example answer

{
    "result": {
        "orderId": "233132",
        "restaurant": {
            "phone": "79123456789, 79987654321",
            "address": "Bagrationovsky proezd 3"
        },
    }
}
CODE

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}
CODE

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,
         },
 ],
}
CODE

To change the weight of a dish, change the quantity parameter.

Example answer

{
    "result": {
        "item1": {
            "orderId": "233132",
            "restaurant": null,
            "onlinePayUrl": null
        },
        "item2": {}
    }
}
CODE

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: