Skip to main content

Member Login

Note

If the member (user_id) does not exist, this API will automatically register the member first and then log in.

API Path​

  • POST
  • /api/member/login

Request Parameters​

ParameterNameTypeRequiredSignedDescription
agent_idMerchant IDstringRequiredIncludedMerchant ID
user_idMerchant User IDstringRequiredIncludedUser ID on Merchant Side, string length minimum 3, maximum 64, Only English, numbers, and _
tokenUser Session TokenstringRequiredIncludedToken generated randomly by the merchant, the string length must be greater than 8 and less than 32
platformPlatformstringRequiredIncludedios/android/h5/web
languageLanguagestringRequiredIncludedLanguage
currencyCurrencystringRequiredIncludedCurrency
timestampCurrent Timestampint64RequiredIncludedTimestamp when calling the API (in milliseconds, valid for ten minutes)
game_codeEntry TargetstringOptionalIncludedWhere the player lands after login (a game / table / random table, etc.); omit to enter the game lobby. See game_code Values below
callbackCallback URLstringOptionalIncludedURL called when member returning from the room
limitsBet LimitsdictOptionalExcludedIn dict format, where the key is <Currency>_<GameID>. For live games the value is a comma-separated string of ordered betLimit IDs; for mini games it is a single tier code. See the notes below.
signSignaturestringRequiredExcludedSee API documentation for signature algorithm
custom_languageLanguage Pack SolutionstringOptionalExcludedUsed for customizing Bet Play language packs, custom_language=en-US>en-play
mobile_scale_enableMobile Scaling TogglestringOptionalExcludedControls whether mobile scaling adaptation is enabled. Pass "true" or "false"; when provided, it is appended to the returned game url (&mobile_scale_enable=). If omitted or set to any other value, the parameter is absent from the game url and the game client's default applies.

game_code Values​

game_code decides where the player lands right after login. If omitted or empty, the player enters the game lobby.

Destinationgame_code formatExample
Game lobby (default)omit / empty string—
Table list of a game<gameId>101 (Baccarat table list)
A specific table<tableId> or <gameId>-<tableId>DYfsRc or 101-DYfsRc
A specific table (live mode)live-<gameId>-<tableId>live-101-DYfsRc
A random table of a gamerand-<gameId>rand-101 (a random Baccarat table)
A random table among hot tablesrand-hotrand-hot
A random table among recommended tablesrand-recommendrand-recommend
Multi-table betting main entrymultibetmultibet
Multi-table betting of a gamemultibet-<gameId>multibet-101
AI game Discover pagediscoverdiscover

Where to get the values

Fallback when the destination is unavailable

The login API never fails because of game_code; it falls back as follows:

SituationPlayer lands in
The specified table is not available to your merchantGame lobby
The specified table has a "table redirect" rule configured in the merchant backendThe table chosen by that rule (random table or a table from the configured list)
rand-<gameId>: the game is not enabled for your merchantTable list of that game
rand-<gameId>: the game is enabled but no table is currently availableGame lobby
rand-hot / rand-recommend: no hot/recommended table is currently availableA random table from the games enabled for your merchant; game lobby if none
discover: the AI game entry is not enabled for your merchant, the page is opened on PC, or no AI game is currently availableGame lobby
Value matches none of the formats aboveGame lobby
note
  • Use lowercase for rand, live, multibet, discover, hot and recommend.
  • game_code is included in the signature using the exact value sent; when omitted or empty it is excluded from the signature.

Example: open the AI game Discover page directly

Send "game_code": "discover" with the usual login parameters (discover is included in the signature). The returned url carries &game_code=discover, and the player lands on the AI game Discover page:

{
"agent_id": "agent001",
"user_id": "uid001",
"token": "tokena8c2aaef3880162a",
"platform": "h5",
"language": "en-US",
"currency": "VND2",
"timestamp": 1734417873301,
"game_code": "discover",
"callback": "https://h5-uat.aig1234.com/home",
"sign": "<computed per the signature rules>"
}
tip

Usage of the limits parameter:

  • The key is always <Currency>_<GameID>, e.g. USD_101.
  • Live games (Baccarat / Dragon Tiger / Roulette, etc.): the value is a comma-separated string of ordered betLimit IDs, e.g. "USD_101": "210001,210002".
  • Mini games: the value is one tier code, created by the merchant under "Mini Game Limit Management" in the back office, e.g. "USD_20401": "site_a" (case-sensitive). Pass default to return to the default tier. Login fails (700270) if the tier does not exist or is disabled.
  • An assigned betLimit group / tier is valid for 24 hours; passing it again on the next login overwrites it and restarts the timer. Games not passed in this login keep the assignment from the previous login, which expires after 24 hours and falls back to the merchant default. We recommend passing the complete limits on every login.
  • Placed bets are settled with the limits in effect when the bet was placed; later changes to or deletion of a tier, or expiry of the assignment, do not affect bets already placed.
tip
  • Usage of the custom_language parameter: custom_language=A>B,C>D indicates that the original language package A is replaced with language package B, and the original language package C is replaced with language package D. Multiple replacements are separated by commas.

Response Parameters​

ParameterNameTypeDescription
codeResponse CodeintError Code
messageResponse MessagestringError Message
dataResponse DatadictResponse Data Details
--urlGame Lobby URLstringAfter successful login, the merchant app redirects to this URL to enter the game lobby
--tokenUser Session TokenstringUser Session Token

Request Example​

curl --location 'https://staging.aig1234.com/api/member/login' \
--header 'Content-Type: application/json' \
--data '{
"agent_id": "agent001",
"user_id": "uid001",
"token": "tokena8c2aaef3880162a",
"platform": "h5",
"language": "en-US",
"currency": "VND2",
"timestamp": 1734417873301,
"limits": {
"USD_101": "21**01,21**02,21**03",
"USD_20401": "site_a"
},
"game_code": "101-DYfsRc",
"callback": "https://h5-uat.aig1234.com/home",
"sign": "7776e923ffee88bbd5293fa8ad4a9919"
}'

Response Example​

{
"code": 200,
"message": "success",
"data": {
"url": "https://h5-uat.aig1234.com/home?agent_id=agent001&uid=uid001&token=tokena8c2aaef3880162a&language=en-US&platform=h5&currency=VND2&game_code=101-DYfsRc&callback=https://h5-uat.aig1234.com/home",
"token": "tokena8c2aaef3880162a"
}
}

Error Codes​

200 Success
408000 Request Parameter Error
408003 Whitelist Restriction
408004 API Rate Limit
600100 Invalid Signature
600101 Invalid parameters
700101 Merchant Not Found
700103 User Not Found
700106 Login Failed
700108 User Prohibited from Login
700208 Currency Not in Merchant's Selected Currency List
700270 Bet Limits Error (including a mini game tier code that does not exist or is disabled)