Purpose

Request Metadata for Restaurant Setup

Request typeAsynchronous/synchronous
Supported agent version>= v2.2
PluggetSystemTypeRKRef

Request format


JSON

{
  "taskType": "GetRestaurantConfig",
  "params": {
    "sync": {
      "objectId": number,
       "timeout": number
    }
  }
}

Parameter

Type

Mandatory

Description

taskTypestringyesTask type. For this method, the value is GetAgentSettings
-sync

Synchronous method call
--timeoutintnoAgent response timeout in seconds, default is 120 seconds
--objectIdintnoThe code of the restaurant for which the request was made

Response format


JSON

{
   "responseCommon":{
      "taskGuid":"guid",
      "taskType":"GetRestaurantConfig",
      "objectId": 0
   },  
 
   "taskResponse":{
     "fields": [
 
       {
 
          "name": "Table",
          "path": "OrderCreationPreferences.DefaultTableCode",
          "values": [{"Table1", 10001}, {"Table2", 10002} ... {"Table for delivery", 10099}],   //if null then free input
          "required": true,
          "valueType": "number",                                                                    //accepts value number/text/boolean
          "defaultValue": 10099
 
       }
 
    ]
 
   },
 
   "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
-objectIdint or nullThe code of the restaurant for which the request was made
error
Error container, for more details see the article Error Description
taskResponseobjectData from the agent
-fieldsarrayArray of restaurant settings fields displayed in the admin panel UI
--namestringField name
--pathstringPath in .json file — agent configuration
--valuesarrayArray of available values ​​for this parameter: name + value. If null, then free input of the specified type
--valueTypestringParameter type. Accepts a number, text or boolean value.
--requiredboolRequired or optional field
--defaultValueanyDefault value

The result of the GetRestoranConfig request must be saved in ObjectSettings in the DataList field as a .json file with the following structure:



JSON

{
    "updated": last update time,
    "error": "The agent version does not support data loading",                                             //null if everything is ok
    "fields": [
        {
            "name": "Table",
            "path": "OrderCreationPreferences.DefaultTableCode",
            "values": [{"Table1", 10001}, {"Table2", 10002} ... {"Table for delivery", 10099}],     //if null, then free input, otherwise select from the specified list
            "required": true,
            "valueType": "number",                                                                      //can take values ​​number/text/boolean
            "defaultValue": 10099
        },
        {
            "name": "Cash register",
            "path": "OrderCreationPreferences.DefaultStationId",
            "values": [{"Main", 20001}, ... ],                                                      //if null, then free input, otherwise select from the specified list
            "required": true,
            "valueType": "number",                                                                      //can take values ​​number/text/boolean
            "defaultValue": null
        },
          ...
        {
            "name": "Cashier",
            "path": "OrderCreationPreferences.DefaultCashierId",
            "values": [{"Administator", 70001}, {"WSA User", 70002} ... ],                  //if null, then free input, otherwise select from the specified list
            "required": false,
            "valueType": "number",                                                                      //can take values number/text/boolean
            "defaultValue": 70002
        }
    ]
}