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
| Parameter | Name | Type | Required | Signed | Description |
|---|---|---|---|---|---|
| agent_id | Merchant ID | string | Required | Included | Merchant ID |
| user_id | Merchant User ID | string | Required | Included | User ID on Merchant Side, string length minimum 3, maximum 64, Only English, numbers, and _ |
| token | User Session Token | string | Required | Included | Token generated randomly by the merchant, the string length must be greater than 8 and less than 32 |
| platform | Platform | string | Required | Included | ios/android/h5/web |
| language | Language | string | Required | Included | Language |
| currency | Currency | string | Required | Included | Currency |
| timestamp | Current Timestamp | int64 | Required | Included | Timestamp when calling the API (in milliseconds, valid for ten minutes) |
| game_code | Entry Target | string | Optional | Included | Where the player lands after login (a game / table / random table, etc.); omit to enter the game lobby. See game_code Values below |
| callback | Callback URL | string | Optional | Included | URL called when member returning from the room |
| limits | Bet Limits | dict | Optional | Excluded | In 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. |
| sign | Signature | string | Required | Excluded | See API documentation for signature algorithm |
| custom_language | Language Pack Solution | string | Optional | Excluded | Used for customizing Bet Play language packs, custom_language=en-US>en-play |
| mobile_scale_enable | Mobile Scaling Toggle | string | Optional | Excluded | Controls 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.
| Destination | game_code format | Example |
|---|---|---|
| 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 game | rand-<gameId> | rand-101 (a random Baccarat table) |
| A random table among hot tables | rand-hot | rand-hot |
| A random table among recommended tables | rand-recommend | rand-recommend |
| Multi-table betting main entry | multibet | multibet |
| Multi-table betting of a game | multibet-<gameId> | multibet-101 |
| AI game Discover page | discover | discover |
Where to get the values
<gameId>: game ID, see Appendices - Game ID Definition.<tableId>: table ID, i.e. theinst_idreturned by Game Room List (only tables available to your merchant are returned; recommended source), or see the Appendices - Table ID Definition.- Table IDs are globally unique. To open a specific table, passing only
<tableId>is recommended; the game ID is resolved automatically.
Fallback when the destination is unavailable
The login API never fails because of game_code; it falls back as follows:
| Situation | Player lands in |
|---|---|
| The specified table is not available to your merchant | Game lobby |
| The specified table has a "table redirect" rule configured in the merchant backend | The table chosen by that rule (random table or a table from the configured list) |
rand-<gameId>: the game is not enabled for your merchant | Table list of that game |
rand-<gameId>: the game is enabled but no table is currently available | Game lobby |
rand-hot / rand-recommend: no hot/recommended table is currently available | A 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 available | Game lobby |
| Value matches none of the formats above | Game lobby |
note
- Use lowercase for
rand,live,multibet,discover,hotandrecommend. game_codeis 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). Passdefaultto 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
limitson 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
| Parameter | Name | Type | Description |
|---|---|---|---|
| code | Response Code | int | Error Code |
| message | Response Message | string | Error Message |
| data | Response Data | dict | Response Data Details |
| --url | Game Lobby URL | string | After successful login, the merchant app redirects to this URL to enter the game lobby |
| --token | User Session Token | string | User 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¤cy=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)