Link Search Menu Expand Document

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:

NameTypeDescription
contentProviderIdstringA unique id of the game provider.
clientIdstringClient id.
accounts[]objectA set of games.
accounts.accountIdstringA 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.gameEmbedUrlstringA 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.pendingGamesUrlstringA link to call pending games ( games where win is not taken ). Provider has to provide this link if free games are used.
accounts.royaltyPercentintPercentage of commission from turnover. Integer. 1 == 0.01%.
accounts.currenciesAvailable[]stringA 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[]stringA 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[]stringA 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.gameLaunchMethodobjectGame Launch method settings
accounts.gameLaunchMethod.launchMethodstringLaunch method. (GLM_DEFAULT. GLM_API)
accounts.gameLaunchMethod.providerGameLaunchApiUrlstringProviders API to process game launch

Placeholders:

NameDescription
GAME_SESSIONUnique id of the game session of a specified user.
CURRENCY_NAMEISO currency code.
GAME_IDGame ID passed by the provider.
USER_LANGUAGELanguage of a player.
USER_IDUnique user id.
HOME_URLLink to the lobby platform.
REFILL_URLLink to the platform replenishment.
ACCOUNT_IDAccount id, where the game is launched.

Response:

NameTypeDescription
isSuccessbooleanIs success?
errorMessagestringText description of the error. Empty string if isSuccess == true.
errorstringError code, see “Errors” table
accounts[]objectAccounts

Errors:

NameDescription
NO_ERRORNo error
SIGN_NOT_FOUNDNo signed header was sent.
INVALID_SIGNInvalid signature.
INVALID_BODYInvalid request body.
UNKNOWN_ACCOUNTUnknown account.
INVALID_CLIENT_IDInvalid client id.
INTERNAL_ERRORInternal 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}}&currency={{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=&currency=&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=&currency=&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": ""
}