Debit
Overview
This page explains how to perform debit operations, specifically for placing bets within the platform.
POST /open-api-games/v1/games-processor
Parameters
Request:
| Name | Type | Description |
|---|---|---|
api | string | Name of operation: “debit”, “credit”, “rollback” |
data | object | |
data.userNick | string | User’s nick |
data.amount | long | User balance (Example: 10000 = 100.00EUR) |
data.denomination | int | Currency denomination. Basically for fiat it equals 2 (for example 1 USD = 100 cents) |
data.currency | string | Balance currency. Passed by the link to open the game. See section “Managing Games and Connections”, field accounts[].gameEmbedUrl. |
data.gameId | string | [Optional field] Game id is required for the providers who are using specific session mode. (F.E. Lobby Games) |
data.userId | string | A unique user id |
data.jpKey | string | Jackpot accumulation group id. Players with the same jpKey participate in a single pool of savings and jackpot winnings |
data.spinMeta | object | [Optional field] User-selected bets and combinations in any regular format. Recommended for implementation to quickly resolve disputes with the player, bypassing requests to your technical support. |
data.spinMeta.lines | int | The number of lines won. |
data.spinMeta.betPerLine | long | Amount of the bet per line in cents. |
data.spinMeta.totalBet | long | Total bet on a reel. |
data.spinMeta.symbolMatrix | long | Description of the position of symbols on the player’s screen at the moment of winning. An example is given for a slot game with 3 reels, 3 cells each. The first array corresponds to the top line of the playing field. The second array is on the second line, and so on. |
data.betMeta | object | [Optional field] Information about the bet game when the player wins. Recommended for implementation to quickly resolve disputes with the player, bypassing requests to your technical support. |
data.betMeta.bets | object | Description of the player’s bets. |
data.notes | object | [Optional field] field for additional information about the win. |
data.freeGame | object | Object that is required to process free spins/bets |
data.freeGame.gameId | string | Game id |
data.freeGame.bet | int | Bet amount |
data.freeGame.lines | int | Number of lines |
data.freeGame.delta | int | Amount of spins to process |
Response:
| Name | Type | Description |
|---|---|---|
api | string | Name of operation: “debit”, “credit”, “rollback” |
isSuccess | boolean | Is success? |
error | string | Empty string if isSuccess == true. |
errorMsg | string | Error code, see “Errors” table |
data | object | |
data.transactionId | string | id of transaction |
data.userNick | string | User’s nick |
data.amount | long | User balance (Example: 10000 = 100.00EUR) |
data.denomination | int | Currency denomination. Basically for fiat it equals 2 (for example 1 USD = 100 cents) |
data.currency | string | Balance currency. Passed by the link to open the game. |
data.freeGames | list | Information about available bonuses. |
data.freeGames.bonusId | string | A bonus id |
data.freeGames.games | list | List of available games |
data.freeGames.games.id | string | Game id |
data.freeGames.games.initial | int | Number of spins/bets at bonus init |
data.freeGames.games.left | int | Number of spins/bets left |
data.freeGames.games.bet | int | Bet amount |
data.freeGames.games.lines | int | Number of lines |
Errors:
| Name | Description |
|---|---|
| NO_ERRORS | No errors. Passed if isSuccess == true. |
| ALREADY_PROCESSED | The operation for this transaction has already been successfully processed. |
| SIGN_NOT_PROVIDED | Sign header was not passed. |
| INVALID_SIGN | Invalid signature. |
| UNKNOWN_CURRENCY | Unknown currency. |
| INSUFFICIENT_BALANCE | The player’s balance is not enough to carry out the operation. |
| INTERNAL_ERROR | Internal service error. The operation must be repeated. |
Example
Request:
curl --location --request POST 'https://apiEndpoint/open-api-games/v1/games-processor' \
--header 'Content-Type: application/json' \
--data '{
"api": "debit",
"data": {
"transactionId": "66cf56af-16e0-4387-8608-c2b4eeef4c63",
"gameSessionId": "16e2ea64-5725-40a4-99cc-c5c0deb8568d",
"currency": "RUB",
"amount": 1000,
"betId": "round-123",
"spinMeta": {
"lines": 2,
"betPerLine": 10,
"totalBet": 2,
"symbolMatrix": [[1, 1, 1],
[3, 4, 1],
[5, 6, 1]]
},
"betMeta": {
"bets": [{
"balls": [1, 2, 3, 4],
"colors": ["black", "red"],
"amount": 100
}]
}
}
}'
Response:
{
"api": "debit",
"isSuccess": true,
"error": "",
"errorMsg": "NO_ERRORS",
"data": {
"transactionId": "66cf56af-16e0-4387-8608-c2b4eeef4c63",
"userNick": "t*****[email protected]",
"amount": 10000,
"denomination": 2,
"currency": "EUR",
"freeGames": [
{
"bonusId": "887a1caa-e3d7-444e-99a3-d308040f2659",
"games": [
{
"id": "ib_al",
"initial": 20,
"left": 20,
"bet": 700,
"lines": 9
}
]
}
]
}
}
Free Debit
The way to process debit operation on free games.
Example
Request:
curl --location --request POST 'https://apiEndpoint/open-api-games/v1/games-processor' \
--header 'Content-Type: application/json' \
--data '{
"api": "debit",
"data": {
"transactionId": "66cf56af-16e0-4387-8608-c2b4eeef4c63",
"gameSessionId": "16e2ea64-5725-40a4-99cc-c5c0deb8568d",
"currency": "RUB",
"amount": 0,
"betId": "round-123",
"spinMeta": {
"lines": 2,
"betPerLine": 10,
"totalBet": 2,
"symbolMatrix": [[1, 1, 1],
[3, 4, 1],
[5, 6, 1]]
},
"betMeta": {
"bets": [{
"balls": [1, 2, 3, 4],
"colors": ["black", "red"],
"amount": 100
}]
},
"freeGame": {
"gameId": "ib_al",
"bet": 700,
"lines": 9,
"delta": -1
}
}
}'
Response:
{
"api": "debit",
"isSuccess": true,
"error": "",
"errorMsg": "NO_ERRORS",
"data": {
"transactionId": "66cf56af-16e0-4387-8608-c2b4eeef4c63",
"userNick": "t*****[email protected]",
"amount": 10000,
"denomination": 2,
"currency": "EUR",
"freeGames": [
{
"bonusId": "887a1caa-e3d7-444e-99a3-d308040f2659",
"games": [
{
"id": "ib_al",
"initial": 20,
"left": 20,
"bet": 700,
"lines": 9
}
]
}
]
}
}