Changing the order
Query
PATCH https://delivery.ucs.ru/orders/api/v1/orders/{orderID}
Content-Type: application/json
CODE
The PATCH method allows executing a complete or partial update of the model.
Query example («Guest» partial change)
{
"guest": {
"phone": "79215724648",
"firstName": "Alex"
}
}
CODE
Query example («Guest» and «Address» partial change)
{
"guest":{
"phone":"77733595836",
"firstName":"John"
},
"address":{
"postcode":"W8 5SA",
"street":"Keningston Hish St",
"lat":55.69945,
"lon":37.773144,
"cityName":"London",
"apartmentNumber":"4",
"houseNumber":"85",
"entrance":"1 ",
"fullAddress":"4, 85, Keningston High Street, London, W8 5SA"
}
}
CODE
Query example (complete change)
{
"comment": "Cook it with love",
"restaurantID": "76439fb3-c0c4-42ca-a269-64f031a6a33b",
"orderStatusID": 1,
"orderStatusName": "New",
"persons": "1",
"dishList": [
{
"ID": "76439fb3-c0c4-42ca-a269-64f031a6a33b",
"name": "salad caesar",
"price": "400",
"measure": {
"value": "0.300",
"unit": "kg"
},
"quantity": "1",
"ingredients": [
{
"ID": "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",
"paymentTypeID": "card",
"changeFrom": "5000",
"guest": {
"phone": "79215724648",
"firstName": "Alex"
},
"address": {
"postcode": "109443",
"cityID": "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"
}
}
CODE
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:
- if a certain (non-mandatory) parameter is sent, checking is turned off
- if a certain (mandatory) parameter is sent, checking is turned on
- if the whole order is sent, checking of fields mandatory for the order is turned on
- if expeditionType parameter is sent, checking of fields mandatory for the order is turned on
| Parameter | Description | Mandatory for delivery | Mandatory for pickup | |
|---|---|---|---|---|
| orderID | string | order ID | yes | yes |
| comment | string | order comment | ||
| restaurantID | string | restaurant ID | yes | |
| persons | int | number of persons | ||
| dishList | array | dish list | yes | yes |
-ID | string | dish ID | yes | yes |
| -name | string | dish name | ||
| -price | double Only a full stop symbol «.» is used as a delimiter | price | ||
| -measure | measure | |||
| --value | double | service size | ||
| --unit | string | unit of measurement: kg, liter, pcs | ||
| -quantity | double Only a full stop symbol «.» is used as a delimiter | quantity | yes | yes |
| -ingredients | array | ingredients | ||
| expeditionType | string | type of order receiving (delivery, pickup) | yes | yes |
| expectedAt | DateTime | time at which order is expected | yes | yes |
| paymentTypeID | string | payment type ID:
| yes | yes |
| changeFrom | double Only as full stop symbol «.» is used as a delimiter | sum to get change from | ||
| guest | guest | yes | ||
| string | guest's email | |||
| -phone | string | phone number | yes | |
| -firstName | string | first name | ||
| -lastName | string | last name | ||
| address | delivery address | |||
| -postcode | string | postcode | ||
| -street | string | street | yes | |
| -comment | string | comment 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 | string | city ID | ||
| -cityName | string | city name | yes | |
| -floor | int | floor | ||
| -houseNumber | string | house number | yes | |
| -apartmentNumber | string | apartment number | ||
| -entrance | string | entrance | ||
| -subway | string | subway | ||
| -fullAddress | string | full address | yes |