Seamless wallet integration (legacy)
Seamless wallet integration is now considered legacy, as it is no longer recommended for use and is not supported.
Therefore, for Casino Seamless wallet integration, please refer to the standard Seamless Integration documentation.
3.1 Settings
To set up Seamless Wallet you should provide us with:
- CALLBACK_URL. URL for request to get a balance, money deposit/withdrawal/rollback
- SECRET_KEY. The Key that is used to sign requests.
3.2 Interaction protocol
All requests are to be sent by HTTP(S) using the method POST, using JSON, answers are expected to be made in JSON format.
3.3 Security
In order to provide for security of the API, a secret key is used to sign requests. A request signature has to be validated on your server, and an error should be returned in case it does not match.
Please note that if your secret key is compromised, then immediately notify the support service. To ensure better security please request changes to your key from time to time.
Forming request
To form up a request for signature to JSON - SECRET_KEY is added to the string of the request, afterwards SHA256 algorithm is applied.
A PHP - example of forming a signature:
// Step 1. Gathering required data
$SECRET_KEY = ''; // Your secret key
$jsonMessage = '{}'; // JSON string
// Step 2. Adding a secret key to the string
// and forming a signature, using SHA256 algorithm
$sign = hash(‘sha256’, $jsonMessage . $SECRET_KEY);
3.4 API methods documentation
3.4.1 Balance request
Request header (HTTP header)
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| sign | Request signature | Mandatory |
Request parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| clientId | Casino identifier. Sent in the request line | Mandatory |
| method | “balance” | Mandatory |
| sessionId | Unique game session identifier | Mandatory |
| userId | User identifier | Mandatory |
| currency | Currency ISO-code | Mandatory |
Request validation
Upon receipt it is required to validate the request the following way:
- Request parameters, marked as Mandatory, must be passed in the request. If this does not happen, then the error “Invalid request params” has to be returned.
- sign. The request signature must match the parameters passed. In case it does not, then the error “Invalid signature” has to be returned.
- clientId. If clientId is not valid, then the error “Invalid request params” has to be returned.
- userId must exist. If a player does not exist, then the error “Player not found” has to be returned.
- currency must be a valid currency ISO-code that is used in your system. If it is not, then the error “Invalid request params” has to be returned.
- sessionId must exist. If session does not exist, then the error “Session not found” has to be returned.
If an error occurs please return the parameters errorCode and errorDescription only.
Response parameters
A response to a request is expected to be in JSON. Response parameters:
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| balance | Current player’s balance in Cents | Mandatory |
| currency | Currency ISO-code | Mandatory |
| errorCode | Error code, if the request does not come thru successfully, and 0 in any other case | Mandatory |
| errorDescription | Error description in case the request has not been successfully handled | Optional |
Resending request
If any error message is received, the Request is not going to be resent.
Request example
{
"clientId": "yourClientId",
"method": "balance",
"sessionId": "a7c29f707997ace69478c30dd3cbc8a9",
"userId": "1234656",
"currency": "USD"
}
Response example
{
"balance": 5000,
"currency": "USD",
"errorCode": 0,
"errorDescription": "",
}
3.4.2 Debit request
Request withdraws money from the player’s wallet. This financial transaction will be done when a bet is placed (regular, side or bet behind), freeroll is used or the dealer is tipped.
Request header (HTTP header)
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| sign | Request signature | Mandatory |
Request parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| clientId | Casino identifier. Sent in the request line | Mandatory |
| method | “debit” | Mandatory |
| userId | User identifier | Mandatory |
| sessionId | Unique game session identifier | Mandatory |
| gameId | Game identifier | Mandatory |
| amount | Amount to debit/credit in cents | Mandatory |
| currency | Currency ISO-code | Mandatory |
| transactionId | Transaction identifier (string data type that can include alphanumeric characters) | Mandatory |
| betType | Type of bet | Mandatory |
| roundId | Game round identifier | Optional |
Request validation
Upon receipt of the request it is required to validate it the following way:
- request parameters, marked as Mandatory, shall be passed in the request. If the parameters are not passed, then the error “Invalid request params” has to be returned.
- sign. Request signature shall correspond to parameters passed. If not, then the error “Invalid signature” has to be returned.
- clientId. If clientId is not valid, then the error “Invalid request params” has to be returned.
- sessionId must exist. If session does not exist, then the error “Session not found” has to be returned.
- userId must exist. If a player does not exist, then the error “Player not found” has to be returned.
- currency shall have a valid ISO-code used in your system. If not, then the error “Invalid request params” has to be returned.
- amount shall always be a positive integer. If not, then the error “Invalid request params” has to be returned.
- If a transaction with passed transactionId has already been handled on your side, then the error “Transaction is already processed” has to be returned. You should not process the transaction for the second time.
- If a Player does not have enough funds for withdrawal, the error “Insufficient funds” has to be returned.
- betType. If you would like forbid specific bet(s) then you could return error “Bet type is not supported” for them.
If the error “Insufficient funds”, “Transaction already processed” or “Bet type is not supported” occurs, it is required to return all parameters. If other errors occur, you should only return parameters errorCode and errorDescription.
Response parameters
A response to a request is expected to be in JSON. Response parameters:
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| balance | Current player’s balance in Cents | Mandatory |
| currency | Currency ISO-code | Mandatory |
| errorCode | Error code, if the request does not come thru successfully, and 0 in any other case | Mandatory |
| errorDescription | Error description in case the request has not been successfully handled | Optional |
Resending request
If any error message is received, the request is not going to be resent.
Request example
{
"clientId": "yourClientId",
"method": "debit",
"sessionId": "a7c29f707997ace69478c30dd3cbc8a9",
"userId": "1234656",
"gameId": "301",
"amount": "1000",
"currency": "USD",
"transactionId": "123456",
"roundId": "",
"betType": "",
}
Response example
{
"balance": 5000,
"currency": "USD",
"errorCode": 0,
"errorDescription": "",
}
3.4.3 Credit player balance request
A request to deposit money to user account.
Request header (HTTP header)
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| sign | Request signature | Mandatory |
Request parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| clientId | Casino identifier. Sent in the request line | Mandatory |
| method | “credit” | Mandatory |
| userId | User identifier | Mandatory |
| sessionId | Unique game session identifier | Mandatory |
| gameId | Game identifier | Mandatory |
| amount | Amount to debit/credit in cents | Mandatory |
| currency | Currency ISO-code | Mandatory |
| transactionId | Transaction identifier (string data type that can include alphanumeric characters) | Mandatory |
| roundId | Game round identifier | Optional |
| winType | Type of win | Mandatory |
Request validation
Upon receipt of the request it is required to validate it the following way:
- request parameters, marked as Mandatory, shall be passed in the request. If the parameters are not passed, then the error “Invalid request params” has to be returned.
- sign. Request signature shall correspond to parameters passed. If not, then the error “Invalid signature” has to be returned.
- clientId. If clientId is not valid, then the error “Invalid request params” has to be returned.
- sessionId must exist. If session does not exist, then the error “Session not found” has to be returned.
- userId must exist. If a player does not exist, then the error “Player not found” has to be returned.
- currency shall have a valid ISO-code used in your system. If not, then the error “Invalid request params” has to be returned.
- amount shall always be a positive integer, or 0 if the player did not win any funds. If not, then the error “Invalid request params” has to be returned.
- If a transaction with passed transactionId has already been handled on your side, then the error “Transaction is already processed” has to be returned. You should not process the transaction for the second time.
If the error “Transaction already processed” occurs, it is required to return all parameters. If other errors occur, you should only return parameters errorCode and errorDescription.
Response parameters
A response to a request is expected to be in JSON. Response parameters:
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| balance | Current player’s balance in Cents | Mandatory |
| currency | Currency ISO-code | Mandatory |
| errorCode | Error code, if the request does not come thru successfully, and 0 in any other case | Mandatory |
| errorDescription | Error description in case the request has not been successfully handled | Optional |
Resending request
If any error message is received, the request is not going to be resent.
Request example
{
"clientId": "yourClientId",
"method": "credit",
"sessionId": "a7c29f707997ace69478c30dd3cbc8a9",
"userId": "1234656",
"gameId": 301,
"amount": 1000,
"currency": "USD",
"transactionId": "123456",
"roundId": "",
"winType": "",
}
Response example
{
"balance": 5000,
"balance": 5000,
"currency": "USD",
"errorCode": 0,
"errorCode": 0,
"errorDescription": "",
}
3.4.4 Rollback debit transaction
Request header (HTTP header)
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| sign | Request signature | Mandatory |
Request parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| clientId | Casino identifier. Sent in the request line | Mandatory |
| method | “rollback” | Mandatory |
| userId | User identifier | Mandatory |
| sessionId | Unique game session identifier | Mandatory |
| gameId | Game identifier | Mandatory |
| amount | Amount to debit/credit in cents | Mandatory |
| currency | Currency ISO-code | Mandatory |
| transactionId | Transaction identifier (string data type that can include alphanumeric characters) | Mandatory |
| originalTransactionId | Debit (rolled back) transaction identifier | Mandatory |
| roundId | Game round identifier | Optional |
Request validation
Upon receipt of the request it is required to validate it the following way:
- request parameters, marked as Mandatory, shall be passed in the request. If the parameters are not passed, then the error “Invalid request params” has to be returned.
- sign. Request signature shall correspond to parameters passed. If not, then the error “Invalid signature” has to be returned.
- clientId. If clientId is not valid, then the error “Invalid request params” has to be returned.
- sessionId must exist. If session does not exist, then the error “Session not found” has to be returned.
- userId must exist. If a player does not exist, then the error “Player not found” has to be returned.
- currency shall have a valid ISO-code used in your system. If not, then the error “Invalid request params” has to be returned.
- amount shall always be a positive integer. If not, then the error “Invalid request params” has to be returned.
- If a transaction with passed transactionId has already been handled on your side, then the error “Transaction is already processed” has to be returned. You should not process the transaction for the second time.
- If originalTransactionId doesn’t exist, then the error “Transaction not found” has to be returned.
If the error “Transaction already processed” occurs, it is required to return all parameters. If other errors occur, you should only return parameters errorCode and errorDescription.
Response parameters
A response to a request is expected to be in JSON. Response parameters:
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| balance | Current player’s balance in Cents | Mandatory |
| currency | Currency ISO-code | Mandatory |
| errorCode | Error code, if the request does not come thru successfully, and 0 in any other case | Mandatory |
| errorDescription | Error description in case the request has not been successfully handled | Optional |
Resending request
If any error message is received, the request is not going to be resent.
Request example
{
"clientId": "yourClientId",
"method": "rollback",
"sessionId": "a7c29f707997ace69478c30dd3cbc8a9",
"userId": "1234656",
"gameId": "301",
"amount": "1000",
"currency": "USD",
"transactionId": "123456",
"originalTransactionId": "123455",
"roundId": "",
}
Response example
{
"balance": 5000,
"currency": "USD",
"errorCode": 0,
"errorDescription": "",
}
3.5 Dictionaries
3.5.1 Response error codes
| errorCode | errorDescription |
|---|---|
| 0 | Completed successfully |
| 1 | Invalid signature |
| 2 | Player not found |
| 3 | Insufficient funds |
| 4 | Invalid request params |
| 5 | Session not found |
| 6 | Transaction is already processed |
| 7 | Bet type is not supported |
| 8 | Transaction not found |
3.5.2 Bet type codes
| Code | Description |
|---|---|
| bet | Regular bet |
| freeround | Freeround |
| tip | Tip |
| insurance | Insurance |
| double_bet | Double bet |
| split_bet | Split bet |
| ante | Ante |
| bet_behind | Bet behind |
| split_bet_behind | Split bet behind |
| double_bet_behind | Double bet behind |
| bet_behind_insurance | Insurance bet behind |
| call | Call |
3.5.3 Win type codes
| Code | Description |
|---|---|
| win | Win with regular bet |
| win_free | Win with freeround |
| win_insurance | Win with insurance |
| win_double | Win with double bet |
| win_split | Win with split bet |
| win_ante | Ante win |
| win_bet_behind | Win with bet behind |
| win_split_bet_behind | Win with split bet behind |
| win_double_bet_behind | Win with double bet behind |
| win_bet_behind_insurance | Win with insurance bet behind |
| win_call | Win after call |