Provider Account
Overview
Account is a list of games with supported currencies and descriptions of country restrictions.
Each provider can have an unlimited set of accounts. On one website, several accounts can be included at once in accordance with the agreements reached and the existing restrictions. For example, in USD currency there is one remuneration rate of the provider, and in EUR currency - a different one.
POST /open-api-games/v1/accounts
Parameters
Request:
| Name | Type | Description |
|---|---|---|
contentProviderId | string | A unique id of the game provider. |
clientId | string | Client id. |
accounts | []object | A set of games. |
accounts.accountId | string | A unique id for the account. If 0 is given, then the account will be created, and its id will be passed in the response. An account is a set of games provided for a specific commission for a specific set of countries and currencies. Different accounts may contain the same games. |
accounts.gameEmbedUrl | string | A link to call the game. A link is inserted into the iframe on the platform site if it is a desktop. A link opens directly if using a mobile device. Check table “Placeholders” for templates which can be used in the link. |
accounts.pendingGamesUrl | string | A link to call pending games ( games where win is not taken ). Provider has to provide this link if free games are used. |
accounts.royaltyPercent | int | Percentage of commission from turnover. Integer. 1 == 0.01%. |
accounts.currenciesAvailable | []string | A list of available currencies. Games will be available only for players with a balance in one of the currencies specified in the account. Test / Guest sessions are available if there is a currency with the code “FUN”. A complete list of currencies and their codes is located in the currencies folder. The list of currencies can be passed empty, in which case the games of this account will be available for all currencies, including FUN currency. |
accounts.countriesAvailable | []string | A list of available countries. If empty, then all countries are allowed. A complete list of countries can be found in the countries folder. |
accounts.countriesDisabled | []string | A list of forbidden countries. If empty, then the filter for forbidden countries is not performed. A complete list of countries can be found in the countries folder. |
accounts.gameLaunchMethod | object | Game Launch method settings |
accounts.gameLaunchMethod.launchMethod | string | Launch method. (GLM_DEFAULT. GLM_API) |
accounts.gameLaunchMethod.providerGameLaunchApiUrl | string | Providers API to process game launch |
Placeholders:
| Name | Description |
|---|---|
GAME_SESSION | Unique id of the game session of a specified user. |
CURRENCY_NAME | ISO currency code. |
GAME_ID | Game ID passed by the provider. |
USER_LANGUAGE | Language of a player. |
USER_ID | Unique user id. |
HOME_URL | Link to the lobby platform. |
REFILL_URL | Link to the platform replenishment. |
ACCOUNT_ID | Account id, where the game is launched. |
Response:
| Name | Type | Description |
|---|---|---|
isSuccess | boolean | Is success? |
errorMessage | string | Text description of the error. Empty string if isSuccess == true. |
error | string | Error code, see “Errors” table |
accounts | []object | Accounts |
Errors:
| Name | Description |
|---|---|
NO_ERROR | No error |
SIGN_NOT_FOUND | No signed header was sent. |
INVALID_SIGN | Invalid signature. |
INVALID_BODY | Invalid request body. |
UNKNOWN_ACCOUNT | Unknown account. |
INVALID_CLIENT_ID | Invalid client id. |
INTERNAL_ERROR | Internal error of the account management service. |
Example
Request:
{
"contentProviderId": "1ef438b4-9b66-412e-bad0-b61e2b38b8fa",
"accounts": [
{
"accountId": 0,
"gameEmbedUrl": "https://myawesomesite.com/client/launch.html?gameSession={{GAME_SESSION}}&game_id={{GAME_ID}}¤cy={{CURRENCY_NAME}}&lang={{USER_LANGUAGE}}",
"pendingGamesUrl": "",
"gameLaunchMethod": {
"launchMethod": "GLM_API",
"providerGameLaunchApiUrl": "https://goapi.lostgame.tech/7c82d104-7a59-b837-a1cc-a773se21d303/game-launch-url"
}
"royaltyPercent": 100,
"currenciesAvailable": [
"EUR",
"USD"
],
"countriesAvailable": [],
"countriesDisabled": [
"US"
]
}
]
}
Response:
{
"isSuccess": true,
"errorMessage": "",
"error": "NO_ERROR",
"accounts": []
}
Using a script for sending a request from SDK:
endpointUrl="https://apiEndpoint/open-api-games/v1/accounts" \
secret="secret" bash ./execute-request.sh "{
'contentProviderId': 'sampleId',
'accounts': [ {
'accountId': 0,
'gameEmbedUrl': 'https://myawesomesite.com/client/launch.html?gameSession=&game_id=¤cy=&lang=',
'pendingGamesUrl': '',
'gameLaunchMethod': {
'launchMethod': 'GLM_DEFAULT',
'providerGameLaunchApiUrl': ''
}
'royaltyPercent': 100,
'currenciesAvailable': ['RUB', 'USD'],
'countriesAvailable': [],
'countriesDisabled': ['IT']
}]
}"
Another example, you can use following script. Insert your personal data:
#!/bin/bash
# Set Variable Values
endpointUrl="https://api.lostgame.tech/open-api-games/v1/accounts"
secret="YOUR_SECRET"
REQ='{
"contentProviderId": "YOUR_PROVIDER_ID",
"accounts": [
{
"accountId": 0,
"gameEmbedUrl": "https://myawesomesite.com/client/launch.html?gameSession=&game_id=¤cy=&lang=",
"pendingGamesUrl": "",
"gameLaunchMethod": {
"launchMethod": "GLM_API",
"providerGameLaunchApiUrl": "https://goapi.lostgame.tech/7c82d104-6a59-4b37-a1cc-a7731e21d303/game-launch-url"
}
"royaltyPercent": 100,
"currenciesAvailable": [
"USD"
],
"countriesAvailable": [],
"countriesDisabled": [
"US"
]
}
],
"clientId": "YOUR_CLIENT_ID"
}'
# Generate signature
if hash md5 2>/dev/null; then
MD5=md5
else
MD5="md5sum"
fi
SIGN=`echo -n "$REQ$secret" | $MD5 | awk '{ print $1 }'`
echo running POST request to host $endpointUrl with sign = $SIGN and request = $REQ
# Send POST query
curl -v \
-H "Sign:$SIGN" \
-H "Content-Type: application/json" \
--request POST --max-time 30 \
--data "$REQ" $endpointUrl
An additional example is provided in sample-account-client/examples.js. Functions: addAccount, updateAccount, listAccounts.
Building game embed url on providers side
If it is required to make other operations before launching game, accounts.gameLaunchMethod option is available. By default, game embed url is built in open game api (GLM_DEFAULT). To enable the option of building game launch url on providers side providerGameLaunchApiUrl is required.
Expected response from provider if GLM_API is enabled:
Response
{
"gameLaunchUrl": ""
}