White Server API v2
Introduction
The article describes White Server API v2
Please note
Integration is paid. To use it, you need to buy a license.
Authorization
A token is used for authorization. To obtain a token, it is necessary to:
- Send a request for integration to integrations@rkeeper.ru. In your request, please indicate that you are an aggregator, your details, a brief description of the service, and whether there is a test stand.
- Get an authorization key for the White Server API.
The token must be passed in the AggregatorAuthentication header.
General description
We use JSON-RPC. Requests are made using HTTP POST method.
The name of the called method is passed in the request body. The server returns a response with http status 200 Ok.
POST https://{{serverName}}/wsserverlp/api/v2/aggregators/Create { "taskType": "method name" }
where serverName — ws.ucs.ru
All json requests must be in UTF-8 encoding.
There are several types of requests:
Request type | How does it work? | Example command |
---|---|---|
Synchronous | HTTP Response directly returns the result of the command | |
Asynchronous | HTTP Response returns taskGuid (command identifier) Scenario: 1) The aggregator sends a command to Whiteserver, the taskGuid comes in the response. 2) Whitesever forwards the request to the restaurant. 3) After execution, the result comes to WhiteServer. 4) The aggregator can get the result from WhiteServer in two ways a) Request with the GetTaskResponse command (specifying the taskGuid) b) Connect to the Whiteserver command queue via long polling and wait for responses to commands (the response contains the taskGuid) | GetStopList, GetOrderState |
There are 2 ways to get a response to an asynchronous request:
GetTaskResponse method — get the response by taskGuid
via a request to the message queue
Description of methods
Description of general parameters of requests to Whiteserver | ||||
Parameter | Type | Required | Description | Value |
---|---|---|---|---|
async | - | Asynchronous method call. It is acceptable to use one of: synchronous or asynchronous | ||
objectId | int | yes | Restaurant code in the licensing system | Present in all methods except GetAgentList |
sync | - | Synchronous method call (it is acceptable to use one of: synchronous or asynchronous) | ||
systemName | string | no | Specifying the specific connected system for which the request is being made | Present in all methods except GetAgentList |
timeout | int | - | Agent response time in seconds | default 120 seconds, maximum 180 seconds |
Menu, out-of-stock list
Request | Description |
---|---|
GetMenu | Get menu |
UpdateMenu | Request for menu update outside of schedule |
GetStopList | Get an out-of-stock list from a restaurant |
GetMenuByParams | Request to receive menu from agent |
PushDishSettings | Request to edit dish parameters |
PushMenuSelectors | Request to save menu selectors (new categories and dishes distributed among them) |
SetAlcoholCodes | Setting AlcoholCodes for Dishes |
SetGlobalTradeItemNumbers | Setting up GTIN for dishes |
Order
Request | Description |
---|---|
GetOrder | Get order |
GetOrderState | Get order state |
CancelOrder | Cancel order |
CreateOrder | Create an order |
PayOrder | Payment for the order |
CompleteOrder | Complete the order |
AddPrepayOrder | Adds a prepayment to the specified order |
RemovePrepayOrder | Removes prepayments in the specified order |
GetOrderList | Request a list of orders from the cash register server. The request is only available if there is permission in the restaurant settings in WsAdmin |
PatchOrder | Changing order fields without changing the order content |
PrintBill | Printing a guest bill |
UndoBill | Cancellation of a guest bill |
UpdateOrder | Update order content in restaurant by order id and objectId |
ValidateOrder | Validation and calculation of the cost of an order in a restaurant |
Restaurants
Request | Description |
---|---|
GetAgentInfo | Getting information about an agent installed in a restaurant |
GetRestaurantAgents | Get a list of agents who have roles in the restaurant |
GetRestaurantConfig | Request Metadata for Restaurant Setup |
GetRestaurantInfo | Get information about the restaurant |
GetRestaurantSystems | Get a list of systems connected to the restaurant |
GetTableList | Returns a list of tables in a restaurant |
GetVoidReasons | Returns a list of available order cancellation reasons |
GetEmployees | Request to get a list of employees |
SetEmployee | Request to update employee data or add data about a new employee |
RemoveEmployee | Request to delete employee data |
Integration with Store House
Request | Description |
---|---|
ShDocDashingReport | Creating an Expenditure Invoice |
ShDelDocDashingReport | Deleting an Expenditure Invoice |
ShDocReceivingReport | Creating a Receiving Report |
ShDelDocReceivingReport | Deleting a Receiving Report |
ShGetCorrs | Getting a list of correspondents |
ShGetGoodGroups | Getting a list of products and product groups |
ShGetGoods | Getting a list of products |
ShGetMUnits | Getting units of measurement |
ShGetStores | Getting a list of warehouses |
ShRepBillOfBalance | Request for the "Inventory Balance Report" report |
ShAlcListPrepare | Obtaining a list of Cocktail Recipe Cards |
ShAlcMenuPrepare | Obtaining Cocktail Recipe Cards for the menu |
ShExecuteProcedure | Perform the Store House procedure from the list of allowed ones |
ShGetReceivingReports | Receiving a list of Receiving Repors for a period |
Reporting (Only for the "RkReports" aggregator)
Request | Description |
---|---|
CreateOrUpdateSqlProc | Creates or updates the specified procedure in the database. |
IsSqlProcExist | Checks whether the specified procedure has been created in the database. |
RunSqlProc | Executes the specified procedure on the database and returns the result of the execution. |
Other
Request | Description |
---|---|
Request | Description |
GetTaskResponse | Getting an answer to a task |
ExecuteRk7Query | Executing a custom RK7 XML Interface command |
GetAgentList | Get a list of agents installed in restaurants with information about their activity |
GetConfigForReporting | Returns a set of current parameters from the reference server |
RunPluginCommand | Sending a command to the Agent plugin |
ServiceGetMultiAgentInfo | Get multi-agent parameters |
ServicePushAgentSettings | Send new settings to the agent (method access restricted) |
ServiceServerBenchmark | Benchmark for server environment |
Message queue request
Events
Events inform the external service about changes made to the restaurant's internal services (cash register, warehouse).
Receiving events
You can receive events by connecting to the message queue.
Example of response with events
{ "eventResponse": { ----------agent event response json--------- }, "responseCommon": { "taskType": "Event", "objectId": int }, "error": { ----------error response json--------- } }