Skip to main content

Terminate Session Endpoint

This document describes the Terminate Session endpoint for Klas Gaming Casino integration. This endpoint is used to notify the operator system when a player session is finished.


Endpoint

POST {WEBHOOK_URL}/terminate

Note: {WEBHOOK_URL} is the webhook URL provided by the operator. Klas Gaming will send POST requests to this endpoint.


Headers

  • X-Signature: HMAC-SHA256 signature for message integrity (see Security Headers)
  • Content-Type: application/json

Request Body

{
"request_id": "string", // Required. Unique request identifier.
"timestamp": "number", // Required. Timestamp of the request (number).
"session_id": "string", // Required. Unique session identifier.
"player_id": "string", // Required. Unique player identifier from operator system.
"game_code": "string" // Optional. Unique game identifier. Empty if no active game session.
}
ParameterTypeMandatoryDescription
request_idstringYesUnique request identifier.
timestampnumberYesTimestamp of the request.
player_idstringYesUnique identifier of the player from the operator's system.
session_idstringYesUnique identifier of the current player session.
game_codestringNoUnique game identifier. Empty if no active game session.

Response Body

{
"status_code": "OK" // Status code of the execution
}
ParameterTypeMandatoryDescription
status_codestringYesStatus code of the execution.

Possible Status Codes

Status CodeReason
OKRequest successful
ERR_UNKNOWNInternal server error
ERR_TIMEOUTTimeout exception

Flow Description

  1. Klas Gaming sends a POST request to /terminate with the required fields and headers.
  2. The backend processes the request and terminates the player session.
  3. The response includes a status code indicating the result.

Example Request

curl -X POST https://<your-api>/terminate \
-H "Content-Type: application/json" \
-H "X-Signature: <hmac_signature>" \
-d '{
"request_id": "1234-5678-90ab-cdef12345678",
"timestamp": 1710000000,
"session_id": "1234-5678-90ab-cdef12345678",
"player_id": "12001",
"game_code": "ABSlot"
}'

Example Response

{
"status_code": "OK"
}

Notes

  • All requests must be signed using the HMAC mechanism described in Security Headers.
  • For more details, refer to the Klas Gaming integration documentation or contact your integration representative.