Wallet API v.2 Desc en

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Integration wallet API

Doc rev. 2.01

Copyright © 2023. All rights reserved.

WALLET API DESCRIPTION


1
Changelog

Version Date Description


ver 1.0 19.06.2019 Initial version

ver 1.01 21.08.2021 Add samples

ver 1.03 17.01.2022 Add parameter - “round_id”


Transaction description

ver 1.04 16.06.2023 Error codes description

ver 2.01 10.11.2023 Add parameter - “player_id” (required)


Game calling order (scheme)

The exchange protocol between the game server and the server of credits.

Server of credits:

1. stores a unique ID of a player, up to 40 symbols (PLAYER_TOKEN);


2. stores credit of a player;
3. stores transactions with confirmed operations;
4. accepts requests from the game server.

The game server:

Integration side required to provide the URL of a server of credits for "Wallet URL" for activation
of communication with the game server.

1. Mandatory fields such as "Wallet token" provided by the control panel. It is possible to
change them by contacting the support team.
2. External identifier (WALLET_TOKEN) serves for searching of an agent, e.g.
«hmeu134_56eEYeGgre» and up to 40 symbols. Only letters, digits and the “_” symbol allowed.

A sample of a run of the game with parameters:

Demo mode

https://domain.example.com?mode=demo&gameID=YOUR_GAME_ID&lang=en

Real mode

https://domain.example.com?mode=real_play&gameID=YOUR_GAME_ID&token=PLAYER_TOKE
N&lang=LANG&wallet=WALLET_TOKEN

2
WALLET API DESCRIPTION
where:
YOUR_GAME_ID — game ID, e.g. - 1014.
PLAYER_TOKEN — ID of a player.
LANG — language of game client, e.g. "en" (set up by 2 letters ISO 639-1 standard).
WALLET_TOKEN — a unique ID of an agent (wallet).

The http POST method is used for all requests to the server.

1.01 A list of operations and their parameters with the samples of successful
responses:

Request of a credit (type="credit")

request:
{"code":"hmeu134_56eEYeGgre","type":"credit","time":"21-09-2023 03:23:23"}

where:
● code — a unique ID of a player's game session.
● type — a type of request.
● time — a date and a time of response.

response:
{"credit":100000,"player_id"="usr-1122334455","result":1,"time":"21-09-2023
03:23:23","currency":"USD"}

where:
● credit — an integer number with an amount of credit in cents (kopecks).
● result — in case of positive result =1, in case of error any other number (e.g. if a code does
not exist).
● currency — name of a currency
● player_id — unique player identifier (up to 40 characters)

Request of a bet in the game (type="bet")

Requests have to be sent before the start of a new game.

request:
{"bet":500,"code":"hmeu134_56eEYeGgre","game":1012,"id":3,"type":"bet","time":"21-09-2023
03:23:23"}

3
WALLET API DESCRIPTION
where:
● bet — an integer number with an amount of bet in cents (kopecks).
● code — a unique ID of a player's game session.
● game — a code of the game system.
● id — ID of transaction, a 64 bit unsigned integer.
● type — a type of request.

response:
{"credit":99500,"result":1,"time":"21-09-2023 03:23:23"}

where:
● credit — an integer number with amount of credit in cents (kopecks), after deducting the
bet.
● result — in case of positive result =1, in case of error any other number (e.g. if a bet exceeds
current credit).

Note!
The “id” parameter is unique within one currency, only one player for the same currency can
have a transaction, for example - 123. But if there are several currencies, then the player can
have the same transaction for UAH=123 and for USD=123.

Request of winning in the game (type="win")


Request has to be sent after winning in the game:

{"code":"hmeu134_56eEYeGgre","game":1012,"id":4,"type":"win","win":1000,"time":"21-09-202
3 03:23:23"}

where:
● code — a unique ID of a player's game session.
● game — a code of the game in the game system.
● id — ID of transaction, a 64 bit unsigned integer.
● type — a type of request.
● win — an integer number with amount of winning in cents (kopecks)

response:

{"credit":100500,"result":1,"time":"21-09-2023 03:23:23"}

where:
● credit — an integer number with amount of credit in cents (kopecks), after adding a winning.
● result — in case of positive result =1, in case of error any other number (a winning has to be
taken because operation of such an account will not be possible).
Request to cancel a bet (type="cancel")

4
WALLET API DESCRIPTION
Request is sent if a game system was unable to place a confirmed bet.
Request:
{"code":"hmeu134_56eEYeGgre","id":5,"type":"cancel","time":"21-09-2023 03:23:23"}

where:
● code — a unique ID of a player's game session.
● id — ID of transaction that should be canceled, a 64 bit unsigned integer.
● type — type of request.

response:
{"credit":100000,"result":1,"time":"21-09-2023 03:23:23"}

where:
● credit — an integer number with amount of credit in cents (kopecks) after cancellation of a bet.
● result — if such transaction canceled or does not exist =1, any other number in case of error.

1.02 Parameter ‘Round_id’


The “round_id” - parameter is equal to the transaction number of the first bet (at the start of the
game).

Request of a bet in the game (type="bet") with “round_id”

{"bet":100,"code":"hmeu134_56eEYeGgre","game":1053,"id":85,"round_id":85,"type":"bet","time":"
21-09-2023 07:27:44"}

where:
● bet — an integer number with an amount of bet in cents (kopecks).
● code — a unique ID of a player's game session.
● game — a code of the game in the game system.
● id — ID of transaction that should be canceled, a 64 bit unsigned integer.
● round_id – transaction number of the first bet.
● type — type of request.

5
WALLET API DESCRIPTION
Request after winning in the game:

{"code":"hmeu134_56eEYeGgre","game":1053,"id":86,"round_id":85,"type":"win","win":50,"time":
"21-09-2023 07:27:45"}

If there is no win, then will be a request with win=0:

{"code":"hmeu134_56eEYeGgre","game":1053,"id":86,"round_id":85,"type":"win","win":0,"time":"
21-09-2023 07:27:45"}

The Parameter ‘Round_id’ also applies to a cancellation request.

{"code":"hmeu134_56eEYeGgre","id":5,"type":"cancel","round_id":85,"time":"21-09-2023 07:27:45"}

1.03 Error codes description

If the "result":1, the request is processed and the following steps are taken according to the
documentation.

An example of a successful response:


{"credit":10000,"result":1,"time":"21-09-2023 9:13:22", "currency":"EUR"}

where:
● credit — an integer number with amount of credit in cents (kopecks) after bet or win request.
● result — in case of positive result =1.
● currency — name of a currency.

If the "result": a number other than “1”, the request is not processed and is counted as an error
request. And we record what we got in "err_code" and "err_desc" in the log.

An example of an error response:


{"result":0,"err_code":400,"err_desc":"ValidationException","time":"21-09-2023 09:13:22"}

where:
● result — in case of error, any other number that is not equal to 1.
● err_code — error code that occurred.
● err_desc — error text that is displayed on the client.

6
WALLET API DESCRIPTION
2.01 Game calling order

Order of calls at the beginning of the game:

7
WALLET API DESCRIPTION
Call order at the end of a winning game:

8
WALLET API DESCRIPTION

You might also like