This guide outlines the process for integrating slot games via API, adhering to industry standards. The integration consists of two main components:
The Game Server provides 2 API endpoints that must be accessed by the integration partner's server. Authentication for these endpoints is handled using the provided agent_key:
Route:
https://backend.geniustech.top/api/agent/v2/games-list
Type:
HTTPS POST
Headers:
| Key | Value |
|---|---|
| Content-type | application/json |
| Body: | |
| Key | Value |
| ------------ | -------------- |
| agent_key | <agent_key> |
cURL Example:
curl --location --request POST 'https://backend.geniustech.top/api/agent/v2/games-list' \
--header 'Content-Type: application/json' \
--data-raw '{
"agent_key": "xxxxxxxxxxxxxxxxx"
}'
Response Format (for Success):
{
"status": "success",
"message": "",
"games-list": [
{}, {}, ... {}
]
}
Response Format (for Error):
{
"status": "error",
"message": "Error: Explanation of the error",
}
Route:
https://backend.geniustech.top/api/agent/v2/open-game-session
Type:
HTTPS POST
Headers:
| Key | Value |
|---|---|
| Content-type | application/json |
| Body: | |
| Key | Value |
| ------------ | -------------- |
| agent_key | <agent_key> |
| user_id | <user_id_set_by_the_partner> |
| currency | <currency_inside_the_game> |
| game_id | <game_id_from_game_list> |
| wallet_url | <wallet_url_of_the_partner> |
| exit_url | <exit_url_for_games_that_have_exit_button> |
cURL Example:
curl --location --request POST 'https://backend.geniustech.top/api/agent/v2/open-game-session/' \
--header 'Content-Type: application/json' \
--data-raw '{
"agent_key": "xxxxxxxxxxxxxxxxx",
"user_id": "1234",
"currency": "USD",
"game_id": "XAkAIAchRBGtrcvjoxHwfFbeFpDCngiu0s7d3FymmAm",
"wallet_url": "https://backend.stake.com/api/wallet/",
"exit_url": "https://www.stake.com/"
}'
Response Format (for Success):
{
"status": "success",
"message": "",
"game_url": "https://..."
}
Response Format (for Error):
{
"status": "error",
"message": "Error: Explanation of the error",
}
The Wallet API is designed to enable a seamless wallet integration, which must be implemented by the integration partner. The partner is responsible for maintaining and updating user balances.
When calling the Open-Game-Session API, the partner must provide the URL of their wallet. The wallet implementation must support the following commands:
Type:
HTTPS POST
Headers:
| Key | Value |
|---|---|
| Content-type | application/json |
| Body: | |
| Key | Value |
| ------------ | -------------- |
| cmd | "get-balance" |
| agent_key | <agent_key> |
| user_id | <user_id_set_by_the_partner> |
Response Format (for Success):
{
"status": "success",
"message": "",
"user_id": "1234",
"balance": "100.00"
}
Note: Balance value must be of type String and in format of Decimal 12,2 like in the example above
Response Format (for Error):
{
"status": "error",
"message": "Error: Explanation of the error",
}
Type:
HTTPS POST
Headers:
| Key | Value |
|---|---|
| Content-type | application/json |
| Body: | |
| Key | Value |
| ------------ | -------------- |
| cmd | "write-bet" |
| agent_key | <agent_key> |
| user_id | <user_id_set_by_the_partner> |
| bet | <bet> |
| win | <win> |
| game_id | <game_id> |
| date | <date> |
In the writeBet command, only the bet and win parameters require processing.
Processing the bet parameter:
-- Verify if the current balance is sufficient to cover the bet value.
-- If the balance is not enough, the operation should terminate without further processing.
Processing the win parameter:
If the balance check passes:
-- Deduct the bet amount from the balance.
-- Add the win value to the balance.
This ensures that the bet parameter is validated before any changes to the balance are made, maintaining system integrity.
Response Format (for Success):
{
"status": "success",
"message": "",
"user_id": "1234",
"balance": "100.00"
}
Note: Balance value must be of type String and in format of Decimal 12,2 like in the example above
Response Format (for Error):
{
"status": "error",
"message": "Error: Explanation of the error",
}