Request

PATCH https://delivery.ucs.ru/orders/api/v1/orders/{orderId}

Content-Type: application/json

The PATCH method allows you to fully or partially update the model.

Request example – partial change of "Guest"

{
 "guest": {
   "phone": "79215724648",
   "firstName": "Maksim"
 }
}
CODE

Request example – partial change of "Guest" and "Address"

{
 "guest":{
    "phone":"77733595836",
    "firstName":"Valery Gennadievich"
  },
 "address":{
    "postcode":"109443",
    "street":"Yunykh Lenintsev",
    "lat":55.69945,
    "lon":37.773144,
    "cityName":"Moscow",
    "apartmentNumber":"456",
    "houseNumber":"85",
    "entrance":"1 ",
    "fullAddress":"109443, Moscow, Ulitsa Yunykh Lenintsev, house 85, building 1"
  }
}
CODE

Request example - complete change

{
 "comment": "cook with love ",
 "restaurantId": "76439fb3-c0c4-42ca-a269-64f031a6a33b",
 "orderStatusId": 1,
 "orderStatusName": "New",
 "persons": "1",
 "dishList": [
   {
     "id": "76439fb3-c0c4-42ca-a269-64f031a6a33b",
     "name": "Caesar salad",
     "price": "400",
     "measure": {
        "value": "0.300",
        "unit": "kg"
     },	
     "quantity": "1",
     "ingredients": [ 
       {
         "id": "76439fb3-c0c4-42ca-a269-64f031a6a33b",
         "name": "tomatoes",
    	 "price": "120",
         "measure": {
            "value": "0.100",
            "unit": "kg" 
         },
         "quantity": "2"
       }
     ]
   }
 ],
 "expeditionType": "delivery",
 "expectedAt":"2020-10-22T10:44:51.586+00:00",
 "paymentTypeId": "card",
 "changeFrom": "5000",
 "guest": {
   "phone": "79215724648",
   "firstName": "Maksim"
 },
 "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, Ulitsa Yunykh Lenintsev, house 85, building 2, apartment 6" 
 }
}
CODE

Response upon successful order change: 200 OK 

Parameters

Required fields depend on the selected delivery method:

  • delivery — delivery by courier
  • pickup — self pickup

Checking for filling in required fields:

  1. A specific parameter is transferred (optional) - checking is not enabled
  2. A certain parameter is transferred (mandatory) - checking is enabled
  3. The entire order is transferred - checking of required fields for the order is enabled
  4. The expeditionType parameter is transferred - checking of required fields for the order is enabled
Parameter
DescriptionRequired for deliveryRequired for pickup
orderIdstringorder numberyesyes
commentstringcomment to ordernono
restaurantIdstringrestaurant idnoyes
personsintnumber of personsnono
dishListarrayorder contentsyesyes

-id

stringdish id (GUID format) from the Delivery menu view, which is used to synchronize with the cash registeryesyes
-namestringname of the dishnono
-price

double

the separator will always be a period - "." 

price of the dishnono
-measure
measurenono
--valuedoubleserving sizenono
--unitstringunit of measurement: kg, liter, pcs. The meaning is not a dictionary one nono
-quantity

double

the separator will always be a period - "." 

number of dishesyesyes
-ingredientsarrayingredientsnono
--idstringingredient id (GUID format) from the Delivery menu view, which is used to sync with the cash register

--namestringname of ingredient

--price

double

the separator will always be a period - "." 

ingredient price

--quantity

double

the separator will always be a period - "." 

quantity of ingredientyesyes
--ingredientsarraymodifiers 

---idstringmodifier id (GUID format) from the Delivery menu view, which is used for synchronization with the cash register

---namestringmodifier name

---price

double

the separator will always be a period - "." 

modifier price

---quantity

double

the separator will always be a period - "." 

modifier amountyesyes
expeditionTypestringmethod of receiving an order (delivery, pickup)yesyes
expectedAtDateTimetime by which the order is expectedyesyes
paymentTypeIdstring

payment method id:

  • cash - payment in cash,
  • card - payment by card,
  • online - online payment.
yesyes
changeFrom

double

the separator will always be a period - "." 

change from what amountnono
guest
guestyesno
-emailstringguest emailnono
-phonestringphone numberyesno
-firstNamestringnamenono
-lastNamestringlast namenono
address
delivery addressnono
-postcodestringzip codenono
-streetstringstreetyesno
-commentstringcomment to addressnono
-lat

double

the separator will always be a period - "." 

latitudenono
-lon

double

the separator will always be a period - "." 

longitudenono
-cityIdstringcity ​​idnono
-cityNamestringname of the cityyesno
-floorintfloornono
-houseNumberstringhouse numberyes
-apartmentNumberstringapartment numbernono
-entrancestringentrancenono
-subwaystringsubwaynono
-fullAddressstringfull addressyesno