Wallet, on your server
wallet.stake
Takes the bet when a round starts.
Who calls it
We → you
POST {your server}/v1/wallet.stakeWe send it when a round starts. We sign the call with our private key. Check it with our public key for the environment. See Signing calls. You answer within 5 seconds.
Request
| Field | Type | What it is |
|---|---|---|
transactionId | string | The same call again moves no money. |
roundId | string | Links the stake to its win, loss or refund. Store your own round with it. |
sessionId | string | Links the money to our session. |
casinoSessionId | string | Links the money to your own session. |
playerId | string | Whose balance. |
gameId | string | Your own round record and reports per game. |
amount | integer | The bet. A whole number in the currency’s smallest unit: 100 EUR is 1.00 EUR. The decimals follow the ISO 4217 list. Social coins use the decimals set in the environment. |
currency | string | Which money. |
traceId | string | One search finds the whole chain on both sides. |
Answer
| Field | Type | What it is |
|---|---|---|
balance | integer | The new balance. |
Or refuse the stake with one code from the table below.
If you do not answer
- After 5 seconds, no result is made. The round goes to refunding. A late “accepted” is ignored.
- An HTTP 500, or an answer we can’t read, counts as no answer.
- The player sees “Checking your bet…” until the refund is accepted, then “Bet not placed. Your money is back.”
- No new round in that game starts while the answer to the last stake is unknown. The player sees “Checking your last bet…”.
- After 5 unknown answers in a row from one environment’s server, we send no new wallet.stake to it for 30 seconds. Players see “The game is paused. Please try again in a moment.” Wins, losses and refunds keep being retried.
Rules your wallet must follow
The wallet test run checks each rule.
- The same transactionId again gets the same answer and moves no money.
- The same transactionId with any other field different is refused with duplicate_mismatch. It shows a bug on one side, instead of hiding it.
- wallet.win, wallet.loss and wallet.refund are always accepted, even after the session closed, the player was blocked, or during maintenance. The bet is already taken. The round must end.
- A refund for a wallet.stake you never received is accepted, moves no money, and answers "applied": false.
- You remember that refund. If the wallet.stake arrives late, you refuse it with already_refunded.
- You handle a wallet.stake and its refund one after the other, never at the same time.
- A wallet.stake ends with one win, one loss or one refund, never two. You refuse the second with already_ended or already_refunded.
- You keep every transactionId as long as we might still send it: at least 90 days, and longer for any item still on the stuck list.
Errors
| Code | What the player sees |
|---|---|
insufficient_funds | Not enough balance. |
session_closed | Your session ended. |
player_blocked | You can’t play right now. |
limit_reached | You reached a limit set by the casino. |
maintenance | The casino is under maintenance. |
Three more codes are not for the player:
duplicate_mismatch: a bug on one side, with an alert. We treat the answer as unknown. The round goes to refunding.already_refundedon a late wallet.stake: expected. The round is already refunding or refunded. Nothing changes.already_endedoralready_refundedon a second win, loss or refund: a bug on our side. The item goes on the stuck list.
Example
Request
{
"transactionId": "t-01JC90…",
"roundId": "r-01JC90…",
"sessionId": "s-01JC8Z…",
"casinoSessionId": "c-5531",
"playerId": "p-82731",
"gameId": "mines",
"amount": 100,
"currency": "EUR",
"traceId": "tr-01JC…"
}
Answer
{ "ok": true, "result": { "balance": 24900 } }