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).
}
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| request_id | string | Yes | Unique request identifier. |
| timestamp | number | Yes | Timestamp of the request. |
| session_id | string | Yes | Unique identifier of the current player session. |
| player_id | string | Yes | Unique identifier of the player from the operator's system. |
| game_code | string | Yes | Game key of the active player's game. |
| transfer_id | string | Yes | Unique reference of the transaction. |
| round_id | string | Yes | Unique reference of the game round. |
| round_completed | boolean | Yes | Specify if this is the last transaction for the current round. |
| amount | string | Yes | Deposit amount (sum of all line wins and jackpot wins). |
| currency | string | Yes | Currency code (ISO-4217, e.g., EUR, USD). |
| reason | string | Yes | Transfer reason. |
| gift_spin | object | No | Object with bonus/campaign info (bonus code, campaign id, spins, etc.). |
| jackpot_wins | object | No | Jackpot win amount (if any). |
| deduction | string | No | Deduction 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
}
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| balance | string | Yes | Player balance (EUR 30). |
| casino_transfer_id | string | Yes | Unique reference of the transfer created in the operator's system. |
| bonus_amount | string | Yes | Amount deposited to player's bonus money account. |
| real_amount | string | Yes | Amount deposited to player's real money account. |
| status_code | string | Yes | Status code of the execution. |
Possible Status Codes
| Status Code | Reason |
|---|---|
| OK | Request successful |
| ERR_INTEGRITY_CHECK_FAILED | Message integrity check failed |
| ERR_UNKNOWN | Internal server error |
| ERR_TIMEOUT | Timeout exception |
Flow Description
- Klas Gaming sends a POST request to
/creditwith the required fields and headers. - The backend processes the request, deposits the funds, and returns the updated balance and transaction details.
- 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.