Game launch
POST /v1/game/launch opens a game for a player and returns the launch_url. The same route serves slots, live casino and the sportsbook.
Request#
| Field | Required | Description |
|---|---|---|
player_id | yes | Player id in your system (1–128 characters). It is the player_id returned in the wallet callbacks. |
game | yes | Game code, from GET /v1/games. For the sportsbook: "sportsbook". |
provider | no | Provider code. Required when the same game code exists in more than one provider (AMBIGUOUS_GAME). |
currency | no | Currency (ISO 4217). It must be the merchant currency; default: the merchant's. |
lang | no | Language (pt, es, en or a regional tag such as en-US). Default: the merchant language; without one, pt. |
country | no | Player country, ISO 3166-1 alpha-2 (e.g. MX). Default: the currency country. See Currencies, languages and countries. |
demo | no | true opens in fun mode, without wallet (only games with demo_available; the sportsbook has none). |
lobby_url | no | URL the game returns to when the player leaves. |
The game gets no balance at launch: the provider queries the balance through the wallet callback (action: "balance") as soon as it opens.
import { talos } from './talos' // see Authentication
const res = await talos('POST', '/v1/game/launch', {
player_id: 'user-123',
game: 'fortune-tiger', // code from GET /v1/games
lang: 'en-US',
lobby_url: 'https://your-site.com/casino'
})
if (!res.success) throw new Error(`${res.error.code}: ${res.message}`)
// open res.data.launch_url in an iframe or a new windowTS=$(($(date +%s) * 1000))
NONCE=$(openssl rand -hex 16)
REQ_PATH='/v1/game/launch'
BODY='{"player_id":"user-123","game":"fortune-tiger","lang":"en-US"}'
SIG=$(printf '%s' "$TS.$NONCE.POST.$REQ_PATH.$BODY" | openssl dgst -sha256 -hmac "$TALOS_SECRET" | sed 's/^.* //')
curl -X POST "$TALOS_API_HOST$REQ_PATH" \
-H "Content-Type: application/json" \
-H "X-Merchant-Id: $TALOS_MERCHANT" \
-H "X-Timestamp: $TS" \
-H "X-Nonce: $NONCE" \
-H "X-Signature: $SIG" \
-d "$BODY"Response#
JSON
{
"success": true,
"message": "Jogo iniciado com sucesso",
"statusCode": 200,
"data": {
"launch_url": "https://...",
"game": "fortune-tiger",
"provider": "PGSOFT",
"demo": false
}
}- Open the
launch_urlin aniframe(or in a new window on mobile). It is for immediate use: generate a new one on every open, do not store it for reuse. - If a provider has more than one integration source, TALOS automatically tries the next one when the first does not open the game. It is transparent on your side.
- The
messagecomes in Portuguese; always decide by the fields and byerror.code.
Sportsbook#
For the sportsbook use game: "sportsbook". The launch_url has the format:
https://<sportsbook>/<language>/?jwt=<token>&brand=<brand>The jwt is a short-lived token (10 minutes) and single-use: the sportsbook exchanges it for a session on the first access. Instead of opening the URL directly, use the sportsbook SDK, which takes this token and handles renewal when the session expires.
- The sportsbook has no fun mode:
demo: truefails (LAUNCH_FAILED). - The
sportsbookproduct must be enabled on the merchant (PRODUCT_NOT_ENABLED).
Errors#
| HTTP | Code | Cause |
|---|---|---|
| 400 | UNSUPPORTED_CURRENCY | currency is not one of the supported currencies. |
| 400 | INVALID_COUNTRY | country is not a valid ISO 3166-1 alpha-2 code. |
| 403 | CURRENCY_NOT_ENABLED | currency differs from the merchant currency — use the merchant of that currency (same group). |
| 403 | PRODUCT_NOT_ENABLED | The game type (slot, live, sportsbook) is not enabled on the merchant. |
| 404 | GAME_NOT_FOUND | Game does not exist, is inactive or belongs to an inactive provider. |
| 409 | WALLET_NOT_CONFIGURED | The merchant has no walletUrl yet (only with demo: false). |
| 409 | AMBIGUOUS_GAME | The code exists in more than one provider; send provider. |
| 422 | PROVIDER_NOT_SUPPORTED | The game provider has no launch integration. |
| 422 | VALIDATION_ERROR | Body does not match the schema (missing required field, length, format). |
| 500 | LAUNCH_GAME_FAILED | Internal error; try again. |
| 502 | LAUNCH_FAILED | The provider could not open the game. |
See also the authentication errors and the general format in Errors.