Documentation

AddCharacterVirtualCurrency

Increments the character's balance of the specified virtual currency by the stated amount

Request Details

AddCharacterVirtualCurrencyRequest
Request Properties
Amount (required) int32

Amount to be added to the character balance of the specified virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase over this value will be discarded.

CharacterId (required) String

Unique PlayFab assigned ID for a specific character owned by a user

PlayFabId (required) String

PlayFab unique identifier of the user whose virtual currency balance is to be incremented.

VirtualCurrency (required) String

Name of the virtual currency which is to be incremented.

POST https://{{TitleID}}.playfabapi.com/Server/AddCharacterVirtualCurrency
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PlayFabId": "20394883",
  "CharacterId": "23424524523",
  "VirtualCurrency": "GC",
  "Amount": 100
}
        

Response Details

ModifyCharacterVirtualCurrencyResult
Result Properties
Balance (required) int32

Balance of the virtual currency after modification.

VirtualCurrency String

Name of the virtual currency which was modified.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "VirtualCurrency": "GC",
    "Balance": 1500
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
InvalidVirtualCurrency 1051