Skip to main content

Credit Endpoint

This document describes the Credit endpoint for Klas Gaming Casino integration. This endpoint is used to deposit funds to the player account. The operation is idempotent: if the wallet receives more than one request with the same transfer_id, the transaction must be registered only once.


Endpoint

POST {WEBHOOK_URL}/credit

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", // Required. Game key of the active player's game.
"transfer_id": "string", // Required. Unique reference of the transaction.
"round_id": "string", // Required. Unique reference of the game round.
"round_completed": true, // Required. Specify if this is the last transaction for the current round (boolean).
"amount": "100", // Required. Deposit amount (sum of all line wins and jackpot wins).
"currency": "EUR", // Required. Currency code (ISO-4217, e.g., EUR, USD).
"reason": "win", // Required. Transfer reason.
"gift_spin": { // Optional. Object with bonus/campaign info.
// ...
},
"jackpot_wins": "0", // Optional. Jackpot win amount (if any).
"deduction": "0" // Optional. Deduction amount (if any).
}
ParameterTypeMandatoryDescription
request_idstringYesUnique request identifier.
timestampnumberYesTimestamp of the request.
session_idstringYesUnique identifier of the current player session.
player_idstringYesUnique identifier of the player from the operator's system.
game_codestringYesGame key of the active player's game.
transfer_idstringYesUnique reference of the transaction.
round_idstringYesUnique reference of the game round.
round_completedbooleanYesSpecify if this is the last transaction for the current round.
amountstringYesDeposit amount (sum of all line wins and jackpot wins).
currencystringYesCurrency code (ISO-4217, e.g., EUR, USD).
reasonstringYesTransfer reason.
gift_spinobjectNoObject with bonus/campaign info (bonus code, campaign id, spins, etc.).
jackpot_winsobjectNoJackpot win amount (if any).
deductionstringNoDeduction amount (if any).

Note: The amount is the aggregated sum of all line wins plus all jackpot wins (if any).


Response Body

{
"balance": "30", // Player balance (e.g., 30 EUR)
"casino_transfer_id": "string", // Unique reference of the transfer created in the operator's system
"bonus_amount": "0", // Amount deposited to player's bonus money account
"real_amount": "100", // Amount deposited to player's real money account
"status_code": "OK" // Status code of the execution
}
ParameterTypeMandatoryDescription
balancestringYesPlayer balance (EUR 30).
casino_transfer_idstringYesUnique reference of the transfer created in the operator's system.
bonus_amountstringYesAmount deposited to player's bonus money account.
real_amountstringYesAmount deposited to player's real money account.
status_codestringYesStatus code of the execution.

Possible Status Codes

Status CodeReason
OKRequest successful
ERR_INTEGRITY_CHECK_FAILEDMessage integrity check failed
ERR_UNKNOWNInternal server error
ERR_TIMEOUTTimeout exception

Flow Description

  1. Klas Gaming sends a POST request to /credit with the required fields and headers.
  2. The backend processes the request, deposits the funds, and returns the updated balance and transaction details.
  3. The response includes the player's balance, transaction references, and a status code indicating the result.

Example Request

curl -X POST https://<your-api>/credit \
-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",
"transfer_id": "1234-5678-90ab-cdef12345678",
"round_id": "1234-5678-90ab-cdef12345678",
"round_completed": true,
"amount": "100",
"currency": "EUR",
"reason": "win",
"gift_spin": {},
"jackpot_wins": "0",
"deduction": "0"
}'

Example Response

{
"balance": "30",
"casino_transfer_id": "operator_tx_1234-5678-90ab-cdef12345678",
"bonus_amount": "0",
"real_amount": "30",
"status_code": "OK"
}

Notes

  • The operation is idempotent: if the same transfer_id is used more than once, the transaction is only registered once.
  • The amount is the aggregated sum of all line wins plus all jackpot wins (if any).
  • 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.