Changing an order
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"
}
}
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"
}
}
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"
}
}
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:
- A specific parameter is transferred (optional) - checking is not enabled
- A certain parameter is transferred (mandatory) - checking is enabled
- The entire order is transferred - checking of required fields for the order is enabled
- The expeditionType parameter is transferred - checking of required fields for the order is enabled
Parameter | Description | Required for delivery | Required for pickup | |
---|---|---|---|---|
orderId | string | order number | yes | yes |
comment | string | comment to order | no | no |
restaurantId | string | restaurant id | no | yes |
persons | int | number of persons | no | no |
dishList | array | order contents | yes | yes |
-id | string | dish id (GUID format) from the Delivery menu view, which is used to synchronize with the cash register | yes | yes |
-name | string | name of the dish | no | no |
-price | double the separator will always be a period - "." | price of the dish | no | no |
-measure | measure | no | no | |
--value | double | serving size | no | no |
--unit | string | unit of measurement: kg, liter, pcs. The meaning is not a dictionary one | no | no |
-quantity | double the separator will always be a period - "." | number of dishes | yes | yes |
-ingredients | array | ingredients | no | no |
--id | string | ingredient id (GUID format) from the Delivery menu view, which is used to sync with the cash register | ||
--name | string | name of ingredient | ||
--price | double the separator will always be a period - "." | ingredient price | ||
--quantity | double the separator will always be a period - "." | quantity of ingredient | yes | yes |
--ingredients | array | modifiers | ||
---id | string | modifier id (GUID format) from the Delivery menu view, which is used for synchronization with the cash register | ||
---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 amount | yes | yes |
expeditionType | string | method of receiving an order (delivery, pickup) | yes | yes |
expectedAt | DateTime | time by which the order is expected | yes | yes |
paymentTypeId | string | payment method id:
| yes | yes |
changeFrom | double the separator will always be a period - "." | change from what amount | no | no |
guest | guest | yes | no | |
string | guest email | no | no | |
-phone | string | phone number | yes | no |
-firstName | string | name | no | no |
-lastName | string | last name | no | no |
address | delivery address | no | no | |
-postcode | string | zip code | no | no |
-street | string | street | yes | no |
-comment | string | comment to address | no | no |
-lat | double the separator will always be a period - "." | latitude | no | no |
-lon | double the separator will always be a period - "." | longitude | no | no |
-cityId | string | city id | no | no |
-cityName | string | name of the city | yes | no |
-floor | int | floor | no | no |
-houseNumber | string | house number | yes | |
-apartmentNumber | string | apartment number | no | no |
-entrance | string | entrance | no | no |
-subway | string | subway | no | no |
-fullAddress | string | full address | yes | no |