circle-userUser

Overview

Base URL: https://api.idosgames.com

HTTP Method: GET / POST

Route: /api/v2/{TitleTemplateId}/{TitleId}/Client/User/{Action}/{UserID}

Documentation: LiveOps Configuration & Logicarrow-up-right

Actions (UserAction):

  • GetClientState

  • GetUserInventory

  • GetCustomUserData

  • UpdateCustomUserData

  • TransferVirtualCurrency

  • SubtractVirtualCurrency

  • ConsumeItem

  • DeleteUserAccount

  • GetUsageTime

  • AddUsageTime

Authentication

Required Headers

  • Authorization: Bearer <SessionTicket>

  • Content-Type: application/json

Unauthorized (401)

Returned when:

  • Authorization header is missing

  • Bearer token is missing/invalid

  • Session validation failed

Response Envelope (Server Standard)

All responses are wrapped with OperationResult<T>:

Success

Failure

SuccessResponse

Used by operations like UpdateCustomUserData and DeleteUserAccount:


Quick Reference (Action Table)

Request body can be {} for actions without arguments.


Endpoints

1) GetClientState

Returns the full client state for the player. This is the primary bootstrap call — it returns user data, inventory, currencies, configuration, characters, quests, premium state, and more.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/GetClientState/{UserID}

Body

Response (OperationResult<ClientStateResponse>)

Implementation note: The exact shape of ClientStateResponse is produced by the server's internal aggregation logic. It combines multiple data sources into a single payload. Refer to the SDK documentation for the full ClientStateResponse schema.

Common Errors


2) GetUserInventory

Returns the player's current inventory, including items and virtual currency balances.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/GetUserInventory/{UserID}

Body

Response (OperationResult<GetUserInventoryResult>)

Note: The exact fields of GetUserInventoryResult are defined by the SDK's ServerModels. The sample above shows typical fields.

Common Errors


3) GetCustomUserData

Returns the player's custom user data (key-value pairs), excluding internal/system keys.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/GetCustomUserData/{UserID}

Body

Response (OperationResult<GetCustomUserDataResult>)

Common Errors


4) UpdateCustomUserData

Updates a single key-value pair in the player's custom user data. System keys (matching SystemCustomUserDataKey enum values) are forbidden.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/UpdateCustomUserData/{UserID}

Body

Response (OperationResult<SuccessResponse>)

Common Errors

Missing key or value

System key rejected

Database update failed


5) TransferVirtualCurrency

Transfers an amount of one virtual currency to another. Both currencies must form an allowed pair in AllowedCurrencyTransferPairs from the title configuration. System currencies (Coin, CoinLimit, Token, TokenLimit) are forbidden.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/TransferVirtualCurrency/{UserID}

Body

TransferAmount defaults to 1 if not provided or ≤ 0.

Response (OperationResult<CurrencyTransferResponse>)

Common Errors

Missing arguments

Missing currency IDs

Same currency

System currency blocked

Amount too small

Config not found

Transfer pairs not configured

Pair not in whitelist

Inventory unavailable

Not enough balance

Transfer operation failed

Post-transfer inventory error


6) SubtractVirtualCurrency

Subtracts (burns) a specified amount of virtual currency from the player's balance.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/SubtractVirtualCurrency/{UserID}

Body

Response (OperationResult<CurrencyUpdateResponse>)

Common Errors

Missing arguments

Amount too small

Insufficient balance

Subtraction failed

Note: On unexpected exceptions, this action throws rather than returning a failure envelope. The error will be: "Error for UserID: {userId}: <exception message>".


7) ConsumeItem

Consumes (reduces uses / removes quantity) of an item from the player's inventory. Supports two modes:

  • By ItemInstanceID — targets a specific item instance

  • By ItemID (+ optional CatalogVersion) — targets items across all instances of that item type

Equipped items cannot be reduced to 0.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/ConsumeItem/{UserID}

Body (by ItemInstanceID)

Body (by ItemID)

SubtractAmount defaults to 1 if not provided or ≤ 0. If CatalogVersion is omitted, it defaults to "Item".

Response (OperationResult<ConsumeItemResponse>)

By ItemInstanceID:

By ItemID:

Common Errors

Missing arguments

No identifier provided

Item not found / insufficient / equipped

Consume by ItemID failed


8) DeleteUserAccount

Permanently deletes the player's account and all associated data.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/DeleteUserAccount/{UserID}

Body

Response (OperationResult<SuccessResponse>)

Common Errors


9) GetUsageTime

Returns aggregated usage time statistics for the player.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/GetUsageTime/{UserID}

Body

Response (OperationResult<UsageTimeStats>)

Common Errors

Note: The error message references "GetUserInventory" — this is a copy-paste artifact in the source code. The actual action is GetUsageTime.


10) AddUsageTime

Records additional usage time for the player and returns updated statistics.

Request

Route POST /api/v2/{TitleTemplateId}/{TitleId}/Client/User/AddUsageTime/{UserID}

Body

UsageTime — the amount of time to add (defined in the base IGSRequest class; typically in minutes or seconds — see server implementation).

Response (OperationResult<UsageTimeStats>)

Common Errors


Models (Contracts)

UserRequest

The shared request DTO for all User actions. Each action reads only the fields it needs.

UserRequest extends IGSRequest. Fields ItemID, CatalogVersion, and UsageTime are inherited from the base class. TransferAmount defaults to 1. Value accepts any JSON type (string, number, object, etc.).

Field
Type
Used by
Description

Key

string

UpdateCustomUserData

Custom data key to update

Value

any

UpdateCustomUserData

Value to set for the key (serialized to string server-side)

CurrencyID

string

SubtractVirtualCurrency

Virtual currency ID to subtract from

SubtractAmount

long

SubtractVirtualCurrency, ConsumeItem

Amount to subtract/consume. Defaults to 1 if ≤ 0 in ConsumeItem

FromCurrencyID

string

TransferVirtualCurrency

Source currency ID

ToCurrencyID

string

TransferVirtualCurrency

Destination currency ID

TransferAmount

long

TransferVirtualCurrency

Amount to transfer (default: 1)

ItemInstanceID

string

ConsumeItem

Specific item instance to consume

ItemID

string

ConsumeItem

Item ID to consume (across all instances)

CatalogVersion

string

ConsumeItem

Catalog version (defaults to "Item" if omitted)

UsageTime

int

AddUsageTime

Usage time value to record

CurrencyTransferResponse

CurrencyUpdateResponse

ConsumeItemResponse

Notes:

  • When consuming by ItemInstanceID: ItemID and CatalogVersion will be null.

  • When consuming by ItemID: ItemInstanceID will be null.

UsageTimeStats

SuccessResponse

CurrencyTransferPair

Used in TitlePublicConfiguration.AllowedCurrencyTransferPairs to define permitted transfer directions.


A) Bootstrap (App Launch / Login)

  1. GetClientState

This single call returns the complete client state. Use it to populate the main screen, inventory, characters, shop, etc.

B) Refresh Inventory

  1. GetUserInventory

Call after any purchase, consumption, or equipment change to get up-to-date item and currency data.

C) Update Custom Data

  1. UpdateCustomUserData (Key, Value)

For saving player preferences, tutorial progress, UI state, etc.

D) Transfer Currency

  1. TransferVirtualCurrency (FromCurrencyID, ToCurrencyID, TransferAmount)

  2. (optional) GetUserInventory (refresh balances)

E) Spend Currency

  1. SubtractVirtualCurrency (CurrencyID, SubtractAmount)

  2. (optional) GetUserInventory (refresh balances)

F) Consume Item

  1. ConsumeItem (ItemInstanceID or ItemID + CatalogVersion, SubtractAmount)

  2. (optional) GetUserInventory (refresh inventory)

G) Track Usage Time

  1. AddUsageTime (UsageTime) — call periodically (e.g., every minute)

  2. GetUsageTime — call to display stats in profile/settings

H) Delete Account

  1. DeleteUserAccount

⚠️ This action is irreversible. Show a confirmation dialog before calling.


Config Usage Guide (Client)

Currency Transfer Whitelist

Before showing a currency transfer UI, the client should check AllowedCurrencyTransferPairs from the title configuration (returned in GetClientState). Only pairs explicitly listed are permitted. The direction matters: a pair {From: "A", To: "B"} does not imply {From: "B", To: "A"} is allowed.

System Currency IDs

The following currencies are system-reserved and cannot be used in TransferVirtualCurrency:

  • Coin ID (soft currency)

  • CoinLimit ID

  • Token ID (hard currency)

  • TokenLimit ID

The exact IDs are defined by DefaultData on the server. If a transfer is attempted with any of these, the server returns "Forbidden currency id".

Custom User Data Keys

The client can store arbitrary key-value pairs via UpdateCustomUserData, with one restriction: keys that match any value in the SystemCustomUserDataKey enum are reserved by the system and will be rejected with "Incorrect key (system key)".


Examples (cURL)

GetClientState

GetUserInventory

GetCustomUserData

UpdateCustomUserData

TransferVirtualCurrency

SubtractVirtualCurrency

ConsumeItem (by ItemInstanceID)

ConsumeItem (by ItemID)

DeleteUserAccount

GetUsageTime

AddUsageTime

Last updated