createPlayer
/v1/commandscreatePlayerPersist the Idempotency-Key and exact request before dispatch. Reconcile unknown outcomes before retrying.
Signature
client.createPlayer(parameters: CreatePlayerParameters, options: MutationOptions): Promise<SuccessResponse<PlayerIdentity>>Call examples
import { AggregatorClient } from '@aggregator-network/sdk'; const apiKey = process.env.AGGREGATOR_API_KEY;if (!apiKey) throw new Error('Set AGGREGATOR_API_KEY');const client = new AggregatorClient({ apiKey }); const player = await client.createPlayer( { user_username: 'player-1001', currency: 'USD' }, { idempotencyKey: 'persisted-player-operation-001' },);Persist the operation key and exact request before sending. Reserve funds where required. These examples run on your backend.
Response examples
Example responses. Request options are in Try it now.
{ "error": 0, "response": { "balance": "0", "created": "2026-12-04T00:00:00Z", "currencycode": "USD" }}Request#
getGame maps players automatically. Use optional createPlayer only to establish identity first. Scope: proxy:createPlayer or proxy:*. Persist the request and Idempotency-Key before sending.
{ "method": "createPlayer", "user_username": "player-1001", "currency": "USD"}| Field | Required | Value |
|---|---|---|
user_username | Yes | Nonblank, 1–128 characters, no control characters; preserve case |
currency | Yes | Entitled three-letter uppercase code |
Identity is scoped to workspace, username and currency. Reuse that identity for launches.
Response#
{ "error": 0, "response": { "balance": "0", "currencycode": "USD", "created": "2026-10-27T00:00:00.000Z" }}The response is illustrative. The gateway returns balance, created, and optional currencycode; provider player IDs, usernames, and account metadata are not returned. Player creation establishes identity; it does not fund a game session. Supply the starting balance with getGame. Keep decimal balance strings as decimals, and follow mutation recovery rules.
Build your server request
/v1/commandscreatePlayerRequest parameters
Call example
import { AggregatorClient } from '@aggregator-network/sdk'; const client = new AggregatorClient({ apiKey: process.env.AGGREGATOR_API_KEY, baseUrl: 'https://aggregatornetwork.com',}); // Persist the key and exact request before dispatch.const idempotencyKey = process.env.AGGREGATOR_OPERATION_KEY;if (!idempotencyKey) throw new Error('Set persisted operation key'); const result = await client.createPlayer({ "user_username": "player-1001", "currency": "USD"}, { idempotencyKey });// Inspect result on your server. Keep launch URLs private.Response
Run the generated example on your server and inspect its response there.