List Sessions
The ListSessions
operation requests a list of multiple sessions.
- SUB /ListSessions
- PUB /ListSessions
If filtering parameters have been specified, the response from the EPOS should contain only those sessions that satisfy all specified filters. If no sessions match the filters, the EPOS will return an empty list. If no parameters are set, the response will include all sessions stored on the EPOS.
- Receive a
listSessionsRequest
from Dojo. - The EPOS should respond with a
listSessionsResponse
.
In the following example, the isPayable
and hasTable
booleans are set to true
, while isFinished
is set to false
. This
indicates that the request is searching for sessions that are seated, have ordered items, but have not yet paid for their meals.
{
"jsonrpc": "2.0",
"id": "9420313f-91ff-49b9-af9e-33977426daaa",
"method": "ListSessions",
"params": {
"isFinished": false,
"hasTable": true,
"isPayable": true,
"tableNames": [],
"requestorInfo": {
"requestorType": "REQUESTOR_TYPE_CARD_MACHINE",
"cardMachineRequestorInfo": {
"terminalId": [],
"waiterId": 1
}
}
}
}
ListSessions
will return a listSessionsResponse
whether the request parameters match
any available sessions or not. If they do not match any sessions, the sessions
object will still be returned, but it will be empty. If the
parameters are left empty, the response will include all sessions currently stored on the EPOS.
In this example, the request has matched two tables stored on the EPOS. Both tables have the isPayable
boolean set to true
. Because
the request did not specify a tableNames
value, the response includes two separate tables. Because the waiterId
was specified as 1
, the response only i
ncludes tables associated with the relevant waiter (in this case, John Smith).
{
"jsonrpc": "2.0",
"id": "9420313f-91ff-49b9-af9e-33977426daaa",
"result": {
"sessions": [
{
"id": "89911090-e37f-42fb-9892-f5a49ca61769",
"name": "John's party",
"tableName": "TBL 101",
"numberOfCovers": 15,
"createdAt": "2023-01-01T15:00:00.123+02:00",
"isPayable": true,
"waiter": {
"id": 1,
"name": "John Smith"
}
},
{
"id": "2454382b-b2c9-43db-924d-3b08cf60f15a",
"name": "Alice's gathering",
"tableName": "TBL 102",
"numberOfCovers": 10,
"createdAt": "2023-08-15T12:30:00.000+00:00",
"isPayable": true,
"waiter": {
"id": 1,
"name": "John Smith"
}
}
]
}
}