Skip to documentation
/

createPlayer

POST/v1/commandscreatePlayer

Persist the Idempotency-Key and exact request before dispatch. Reconcile unknown outcomes before retrying.

Signature

typescript example
.ts
client.createPlayer(parameters: CreatePlayerParameters, options: MutationOptions): Promise<SuccessResponse<PlayerIdentity>>

Call examples

typescript example
.ts
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.

json example
.json
{  "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.

json example
.json
{  "method": "createPlayer",  "user_username": "player-1001",  "currency": "USD"}
FieldRequiredValue
user_usernameYesNonblank, 1–128 characters, no control characters; preserve case
currencyYesEntitled three-letter uppercase code

Identity is scoped to workspace, username and currency. Reuse that identity for launches.

Response#

json example
.json
{  "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.

Was this page helpful?