Get Session
The Tables API is now archived. For up-to-date Pay at Table integrations, please use the Dojo API and EPOS Data API:
The GetSession
operation requests information about a single session.
The session can be currently active, or it can be a previous, finished session. To retrieve information about multiple specified
sessions, use ListSessions
.
- SUB /GetSession
- PUB /GetSession
All parameters included in the GetSession
request are mandatory.
- Receive a
getSessionRequest
message from Dojo. - If the specified session does not exist, the EPOS should send an Error response with the code
SESSION_NO_SUCH_SESSION
. - Otherwise, if the session exists, the EPOS should respond with a
getSessionResponse
message.
{
"jsonrpc": "2.0",
"id": "434f4e2f-6cde-48b3-8c77-050e25a77955",
"method": "GetSession",
"params": {
"sessionId": "c1d071aa-fc82-47cb-8ffd-d873915dbc04",
"requestorInfo": {
"requestorType": "REQUESTOR_TYPE_CARD_MACHINE",
"cardMachineRequestorInfo": {
"terminalId": "123123",
"waiterId": 1
}
}
}
}
The getSessionResponse
message includes the following new information:
- The name assigned to a table and the number of covers seated at it.
- The full date-time that the session was created.
- Whether the session is still in-progress, because the
isPayable
boolean indicates if the table has an outstanding balance to pay. If a session has not yet been fully paid for, the value of this field will betrue
. For any finished sessions, it will befalse
. - The request required the waiter's ID, and the response additionally returns their
name
. If no name is set, the ID will be displayed anywhere the waiter is referenced, instead.
{
"jsonrpc": "2.0",
"id": "434f4e2f-6cde-48b3-8c77-050e25a77955",
"result": {
"session": {
"id": "6c133121-8423-48af-b9c1-ce6741f224da",
"name": "John's party",
"tableName": "TBL 101",
"numberOfCovers": 15,
"createdAt": "2021-01-01T15:00:00.123+02:00",
"isPayable": false,
"waiter": {
"id": 1,
"name": "John Smith"
}
}
}
}