Documentation

AddUserVirtualCurrency

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

Request Details

AddUserVirtualCurrencyRequest
Request Properties
Amount (required) int32

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

PlayFabId (required) String

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

VirtualCurrency (required) String

Name of the virtual currency which is to be incremented.

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

Response Details

ModifyUserVirtualCurrencyResult
Result Properties
Balance (required) int32

Balance of the virtual currency after modification.

BalanceChange (required) int32

Amount added or subtracted from the user's virtual currency. Maximum VC balance is Int32 (2,147,483,647). Any increase over this value will be discarded.

PlayFabId String

User currency was subtracted from.

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": {
    "PlayFabId": "B456AE0",
    "VirtualCurrency": "GC",
    "BalanceChange": 10,
    "Balance": 1500
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
InvalidVirtualCurrency 1051