Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
Query

false
Info
icon
Code Block
PATCH https://delivery.ucs.ru/orders/api/v1/orders/{
orderId
orderID}


Content-Type: application/json

The PATCH method allows executing a complete or partial update of the model.

...

Code Block
{
 "comment": "Cook it with love",
 "restaurantIdrestaurantID": "76439fb3-c0c4-42ca-a269-64f031a6a33b",
 "orderStatusIdorderStatusID": 1,
 "orderStatusName": "New",
 "persons": "1",
 "dishList": [
   {
     "idID": "76439fb3-c0c4-42ca-a269-64f031a6a33b",
     "name": "salad caesar",
     "price": "400",
     "measure": {
        "value": "0.300",
        "unit": "kg"
     },	
     "quantity": "1",
     "ingredients": [ 
       {
         "idID": "76439fb3-c0c4-42ca-a269-64f031a6a33b",
         "name": "tomatos",
    	 "price": "120",
         "measure": {
            "value": "0.100",
            "unit": "kg" 
         },
         "quantity": "2"
       }
     ]
   }
 ],
 "expeditionType": "delivery",
 "expectedAt":"2020-10-22T10:44:51.586+00:00",
 "paymentTypeIdpaymentTypeID": "card",
 "changeFrom": "5000",
 "guest": {
   "phone": "79215724648",
   "firstName": "Alex"
 },
 "address": {
   "postcode": "109443",
   "cityIdcityID": "73439fb3-c0c4-42ca-a269-64f031a6a33b",
   "street": "Kensington High St",
   "comment": "the house is situated to the right of the school",
   "lat": "55.700897",
   "lon": "37.773808",
   "cityName": "London",
   "entrance": "1",
   "houseNumber": "85",
   "apartmentNumber": "6",
   "subway": "High Street Kensington",
   "fullAddress": "6, 85, Keningston High Street, London, W8 5SA" 
 }
}

...

Response in case of

...

successful order change: 200 OK 

Parameters

Mandatory fields depend on the selected type of delivery:

  • delivery — courier delivery 
  • pickup — client's take-out

Checking of mandatory fields filling:

  1. if a certain (non-mandatory) parameter is sent, checking is turned off
  2. if a certain (mandatory) parameter is sent, checking is turned on
  3. if the whole order is sent, checking of fields mandatory for the order is turned on
  4. if expeditionType parameter is sent, checking of fields mandatory for the order is turned on
Parameter
DescriptionMandatory for deliveryMandatory for pickup
orderId
orderIDstringorder
id
IDyesyes
commentstringorder comment
restaurantId


restaurantIDstringrestaurant
id
ID
yes
personsintnumber of persons

dishListarraydish listyesyes

-

id

ID

stringdish
id
IDyesyes
-namestringdish name

-price

double

Only a full stop symbol «.» is used as a delimiter 

price

-measure
measure

--valuedoubleservice size

--unitstringunit of measurement: kg, liter, pcs

-quantity

double

Only a full stop symbol «.» is used as a delimiter

quantityyesyes
-ingredientsarrayingredients

expeditionTypestringtype of order receiving (delivery, pickup)yesyes
expectedAtDateTimetime at which order is expectedyesyes
paymentTypeId
paymentTypeIDstring

payment type

id

ID:

  • cash,
  • card,
  • online.
yesyes
changeFrom

double

Only as full stop symbol «.» is used as a delimiter

sum to get change from

guest
guestyes
-emailstringguest's email

-phonestringphone numberyes
-firstNamestringfirst name

-lastNamestringlast name

address
delivery address

-postcodestringpostcode

-streetstringstreetyes
-commentstringcomment on the address

-lat

double

Only a full stop symbol «.» is used as a delimiter

latitude

-lon

double

Only a full stop symbol «.» is used as a delimiter

longitude

-
cityId
cityIDstringcity
id 
ID 

-cityNamestringcity nameyes
-floorintfloor

-houseNumberstringhouse numberyes
-apartmentNumberstringapartment number

-entrancestringentrance

-subwaystringsubway

-fullAddressstringfull addressyes