GetStopList
Description
Purpose | Get a stop list from a restaurant |
Request type | Asynchronous |
Request format
{ "taskType": "GetStopList", "params": { "async": { "objectId": 0, "timeout": 0 } } }
Description of parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
taskType | Task type | ||
async | Asynchronous method | ||
timeout | int | - | Agent response timeout in seconds, default is 120 seconds |
objectId | int | + | Restaurant code in the licensing system |
Response format
{ "responseCommon":{ "taskGuid":"guid", "taskType":"GetStopList", "objectId":"int" }, "error":{ "wsError":{ "code":"string", "extCode":"string", "desc":"string" } } }
Parameter | Type | Description |
---|---|---|
taskGuid | guid | The unique code of this task is used when receiving the task through the queue |
taskType | string enum | Task type |
objectId | int | Restaurant code in the licensing system |
error | Error container with detailing on related systems inside | |
- wsError | Errors received from the WhiteServer service | |
– code | string | Error code |
– extCode | string | Extended error code |
– desc | string | Error description |
Asynchronous response format
Successful response
{ "taskResponse": { "stopList": { "dishes": [ { "id": "string", "name": "string", "type": "string" } ] } }, "responseCommon": { "taskGuid": "string", "taskType": "GetStopList", "objectId": 0 } }
Successful response, but stoplist is empty
{ "taskResponse": { "stopList": { "dishes": [] } }, "responseCommon": { "taskGuid": "string", "taskType": "GetStopList", "objectId": 0 } }
Response with error
{ "responseCommon": { "taskGuid": "string", "taskType": "GetStopList", "objectId": 0 }, "error": { "wsError": { "code": "string", "extCode": "string", "desc": "string" }, "agentError": { "code": 0, "desc": "string" } } }
Description of parameters
Parameter | Parameter type | Mandatory | Description |
---|---|---|---|
taskGuid | uuid | + | Request ID |
stoplist | |||
- dishes | array | array of elements in the stop list. | |
– id | integer | Dish ID | |
– name | string | Name of the dish | |
– type | string | Product type. Possible options: product, ingredient, category (currently always product) | |
error | string enum | Error container, inside there is detailing on related systems | |
- wsError | string enum | Whiteserver Error | |
– code | string | Error code | |
– extCode | string | Extended error code | |
– desc | string | Error description | |
- agentError | string enum | Agent Error | |
– code | int | Error code | |
– desc | string | Error description |
Examples
Request
{ "taskType": "GetStopList", "params": { "async": { "objectId": 199990106, "timeout": 60 } } }
Synchronous response
{ "responseCommon": { "taskGuid": "fa1bdcbf-1e96-425c-9159-eb57d4accb6f", "taskType": "GetStopList", "objectId": 199990106 }, "responseSync": "QueuedSuccess" }
Successful asynchronous response
{ "stopList": { "dishes": [ { "id": "1000021", "name": "Buckwheat porridge", "type": "product" }, { "id": "1000019", "name": "Tea", "type": "product" } ] }, "responseCommon": { "taskGuid": "fe5633c8-ee7d-4ef5-ab98-8ff9e98adbdc", "taskType": "GetStopList", "objectId": 199990106 } }
Asynchronous response with error
{ "responseCommon": { "taskGuid": "fa1bdcbf-1e96-425c-9159-eb57d4accb6f", "taskType": "GetStopList", "objectId": 199990106 }, "error": { "agentError": { "code": 82, "desc": "No access to main system (Rk7)" } } }