Purpose

Update order composition in restaurant by order id and objectId

Request typeAsynchronous/synchronous
Supported agent versionv2
PluggetSystemTypeRKMid

Request format



JSON

{
  "taskType": "UpdateOrder",
  "params": {
    "async": {
      "objectId": number,
       "timeout": number
    },
    "sync": {
      "objectId": number,
       "timeout": number
    },
    "orderGuid": "uuid",
    "products": [
        { // simple variant
            "id": number,
            "name": "string",
            "price": number, // the parameter is not mandatory. It can be left blank, since the order is created with the price indicated at the cash register
            "quantity": number,
            "discountIds": [
                {
                    "id": number,
                    "value":number
                }
            ]
        },
        { // variant with modifiers or combo
            "id": number,
            "name": "string",
            "price": number, // the parameter is not mandatory. It can be left blank, since the order is created with the price indicated at the cash register
            "quantity": number,
            "ingredients": [ //array of modifiers or combo elements
             {
                "id": number,
                "name": "string",
                "quantity": number,
                "price":  number, // the parameter is not mandatory. It can be left blank, since the order is created with the price indicated at the cash register
                "ingredients": [ //array of modifiers for combo components. Only from agent version 2.7.9.1
                   {
                     "id": number,
                     "name": "string",
                     "quantity": number,
                     "price": number // the parameter is not mandatory. It can be left blank, since the order is created with the price indicated at the cash register
                   }   
                ]
             }
            ]
        }
    ],
    "delivery": {
       "address": {
           "comment": "string",
           "fullAddress": "string"
       }
    },   
    "discountIds": [
           number,
           number
        ],
// or
        "discountIds": [
            {
                "id": number,
                "value":number
            }
        ],
   }
}

Parameter

Type

Mandatory

Description

Parameter

Type

Mandatory

Description

async

Asynchronous method call: either synchronous or asynchronous
sync

Synchronous method call: either synchronous or asynchronous
timeoutintnoAgent response time in seconds. Default is 120 seconds
objectIdintyesRestaurant code in the licensing system
orderGuiduuidyesUnique order identifier
productsarraynoOrder contents. If not specified, the contents is not updated.
- idintyesDish ID
- namestring
Name of the dish
- pricemoney
Price for one dish. The separator between the whole and fractional parts of the amount must be a dot
- quantitymoneyyesNumber of dishes
- ingredientsarray
Ingredients or contents of a combo dish
– idintyesIngredient ID
- discountIds

An array of cash discount identifiers for a dish. A discount must be specified, otherwise it will be deleted.
  - id

Discount ID
  - value

Discount value. Specify the amount or percentage. 0 – full application of the discount. Both positive and negative values ​​can be specified.




discountIds

int[]/

object[]

noArray of IDs of cash discounts GetRefData(DISCOUNTS).Ident. If the discount was specified when creating the order, then it is necessary to specify it during UpdateOrder, otherwise the discount will be deleted
- idintyesDiscount ID
- valuedecimalnoDiscount value. Specify the amount or percentage. 0 – full application of the discount. Both positive and negative values ​​can be specified
deliveryobject?noRestaurant courier delivery
 |- addressobject?noAddress
   |- commentstring?noComment on the address. If not specified or null, no update occurs
   |- fullAddressstring?noDelivery address. If not specified or null, no update occurs

Response format


JSON

{
   "responseCommon":{
      "taskGuid":"guid",
      "taskType":"UpdateOrderProducts",
      "objectId":number
   },
   "error":{
      "wsError":{
         "code":"string",
         "desc":"string"
      }
   }
}

Parameter

Type

Description

-taskGuidguidUnique code for this task. Used when receiving a task via the queue
-taskTypestring enumTask type
-objectIdintRestaurant code in the licensing system
error
Error container, for more details see the article Error Description