Session Methods

Session Management

Start Session

POST [host]/api/session/start

Description

Starts a session on a specific kiosk to interact with its hardware devices. You must provide either the kiosk_id or the kiosk_token.

Security

TypeHeaderValue
Auth TokenAuthorizationBearer <your_auth_token>

Request Body (JSON)

{
  "kiosk_id": "3a191de7-...", // Optional if kiosk_token is used
  "kiosk_token": "eyJ0eXAi...", // Optional if kiosk_id is used
  "record": true // Defines whether to record the screen
}

Successful Response (200)

Returns the session_id and a new token. This new token will act as the sessionToken for all subsequent hardware-related requests.

Response Example

{
    "success": true,
    "message": "Session open",
    "kiosk_id": "3a191de7-...",
    "session_id": "d5509e19-140e-8c71-c2dd-799c6c6a18e2",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1[…]",
    "request_id": "ad1f4f2b962b400714301bd3dcb143f6"
}`

[!IMPORTANT] From this point forward, use the token returned in this response for all session-based endpoints (Scanner, Webcam, Payments, etc.).



Close Session

POST [host]/api/session/close

Description

Closes the currently active session.

[!IMPORTANT] This endpoint must always be called before attempting to open a new session to ensure the kiosk state is correctly reset.

Security

TypeHeaderValue
Session TokenAuthorizationBearer <your_session_token>

Response Example (200)

{
    "success": true,
    "message": "Session closed",
    "request_id": "77f907cee6add682f38d7da4de4b6191"
}