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:

  1. 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.
  2. 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

SynchronousHTTP Response directly returns the result of the command
AsynchronousHTTP 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:

  1. GetTaskResponse method — get the response by taskGuid

  2. 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
objectIdintyesRestaurant code in the licensing systemPresent in all methods except GetAgentList
sync
-Synchronous method call (it is acceptable to use one of: synchronous or asynchronous)
systemNamestringnoSpecifying the specific connected system for which the request is being madePresent in all methods except GetAgentList
timeoutint-Agent response time in secondsdefault 120 seconds,
maximum 180 seconds

Menu, out-of-stock list

Request

Description

GetMenuGet menu
UpdateMenuRequest for menu update outside of schedule
GetStopListGet an out-of-stock list from a restaurant
GetMenuByParamsRequest to receive menu from agent
PushDishSettingsRequest to edit dish parameters
PushMenuSelectorsRequest to save menu selectors (new categories and dishes distributed among them)
SetAlcoholCodesSetting AlcoholCodes for Dishes
SetGlobalTradeItemNumbersSetting up GTIN for dishes

Order

Request

Description

GetOrderGet order
GetOrderStateGet order state
CancelOrderCancel order
CreateOrderCreate an order
PayOrderPayment for the order
CompleteOrderComplete the order
AddPrepayOrderAdds a prepayment to the specified order
RemovePrepayOrderRemoves 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

GetRestaurantConfigRequest Metadata for Restaurant Setup
GetRestaurantInfoGet information about the restaurant
GetRestaurantSystemsGet a list of systems connected to the restaurant
GetTableListReturns a list of tables in a restaurant
GetVoidReasonsReturns a list of available order cancellation reasons
GetEmployeesRequest to get a list of employees
SetEmployeeRequest to update employee data or add data about a new employee
RemoveEmployeeRequest to delete employee data

Integration with Store House

Request

Description

ShDocDashingReportCreating an Expenditure Invoice
ShDelDocDashingReport

Deleting an Expenditure Invoice

ShDocReceivingReportCreating a Receiving Report
ShDelDocReceivingReportDeleting a Receiving Report
ShGetCorrsGetting a list of correspondents
ShGetGoodGroupsGetting a list of products and product groups
ShGetGoodsGetting a list of products
ShGetMUnitsGetting units of measurement
ShGetStoresGetting 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

CreateOrUpdateSqlProcCreates or updates the specified procedure in the database.
IsSqlProcExistChecks whether the specified procedure has been created in the database.
RunSqlProcExecutes 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

ExecuteRk7QueryExecuting a custom RK7 XML Interface command
GetAgentListGet a list of agents installed in restaurants with information about their activity
GetConfigForReportingReturns a set of current parameters from the reference server
RunPluginCommandSending a command to the Agent plugin
ServiceGetMultiAgentInfoGet multi-agent parameters
ServicePushAgentSettingsSend new settings to the agent (method access restricted)
ServiceServerBenchmarkBenchmark for server environment

Message queue request

Message queue

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---------
  }
}

Error codes

Error codes