Game API Integration Guide - V2

This guide outlines the process for integrating slot games via API, adhering to industry standards. The integration consists of two main components:

  1. Game Server APIs: Implemented by the game provider to handle game-related operations.
  2. Wallet API: Implemented by the integration partner to manage user accounts and balances

1) Game Server APIs

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:

  1. Games-List API (/api/agent/v2/games-list)
  2. Open-Game-Session API (/api/agent/v2/open-game-session/)

 

1.A) Game-List API

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",
}

 

1.B) Open-Game-Session API

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",
}

 

2) Partner Wallet API

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:

  1. Get-Balance: The command "get-balance" sends a POST JSON request to the wallet url of the partner to check player balance
  2. Write-Bet: The command "write-bet" sends a POST JSON request to the wallet url of the partner to update player balance

 

2.A) Get-Balance

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",
}

 

2.B) Write-Bet

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.

  1. 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.

  2. 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",
}