Skip to content
VAS HUB
Wallet API

Authentication

Checks a launch token and tells the game who the player is and what they can play with.

Path/auth
MethodPOST
Content-Typeapplication/json
HeadersX-Client-IDX-Client-TSX-Client-Signature

Appended to your wallet base URL. Signed: see Securing requests.

When we call it

  • When the game opens with a token in its URL.
  • Again whenever the player reloads the game or their connection drops and comes back, with the same token.

Request

ParameterTypeDescription
user_tokenrequiredstringThe launch token from the game URL.
tokenrequiredstringThe same token again (older wallets read this field).
platformrequiredstringDevice type. Currently always mobile.
currencyrequiredstringThe game server's currency, e.g. KES.
Request body
{
  "user_token": "8f3c1d2e9b7a4c5d8e1f2a3b4c5d6e7f",
  "token": "8f3c1d2e9b7a4c5d8e1f2a3b4c5d6e7f",
  "platform": "mobile",
  "currency": "KES"
}

Response

FieldTypeDescription
coderequiredinteger200 when the player was found.
messagerequiredstringok, or the reason for a refusal.
data.user_idrequiredstringThe player's ID on your side. The game sends it back on every later call.
data.balancerequirednumberThe player's balance, in the amount unit agreed for your integration.
data.usernameoptionalstringDisplay name. Other players only ever see it masked (j***u).
data.phoneoptionalstringKept on our side for support; never shown to other players.
data.currencyoptionalstringThe balance currency, e.g. KES.
Response
{
  "code": 200,
  "message": "ok",
  "data": {
    "user_id": "100245",
    "username": "jkamau",
    "phone": "254712345678",
    "balance": 1500.5,
    "currency": "KES"
  }
}

Result codes

CodeMeaning
200Token valid: the player plays.
401Token unknown or expired: the player is asked to reopen the game from your site.
403Account blocked or self-excluded.

Every method: see Result codes.