Game Launch
Get game launch URL for players to enter real-money games.
Endpoint
| Property | Value |
|---|---|
| Path | POST /papi/v1/game/launch |
| Auth | Agent Token (Bearer) |
| Content-Type | application/x-www-form-urlencoded |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
member_id | string | Yes | Player unique identifier (Agent-side ID) |
game_id | string | Yes | Game ID (from Game List API) |
currency | string | Yes | Currency code (e.g. MYR, USD). Automatically converted to uppercase |
platform | string | No | Platform type: WEB / MOBILE / DESKTOP, default WEB. Automatically converted to uppercase |
language | string | No | Language code, default en-US |
return_url | string | No | URL to redirect after game exit |
Automatic Setup
When a player launches a game for the first time:
- The player is automatically registered with the game provider (no separate call needed)
- A wallet with
balance=0is automatically created for the specified currency (if not already exists)
Request Example
bash
curl -X POST https://api.example.com/papi/v1/game/launch \
-H "Authorization: Bearer {agent_token}" \
-d "member_id=PLAYER_001&game_id=xxxx-guid¤cy=MYR&platform=WEB&language=en-US"Response Fields
| Field | Type | Description |
|---|---|---|
game_url | string | Game launch URL (redirect player to this URL to enter game) |
Response Example
json
{
"status": true,
"code": 0,
"data": {
"game_url": "https://game.provider.com/play?token=xxx&lang=en-US"
},
"msg": "success"
}Error Codes
| Code | Message | Description |
|---|---|---|
| 1001 | err.param.invalid | Required parameters missing (member_id, game_id, currency) |
| 1002 | err.signature.invalid | Agent Token verification failed |
| 2001 | err.player.not_found | Player not found (must register first) |
| 4001 | err.game.not_found | Game not found or offline |
| 4005 | err.game.launch_failed | Game launch failed (provider registration or internal error) |
| 4006 | err.game.access_denied | Agent does not have permission for this game |
| 5002 | err.provider.call_failed | Game provider API call failed |