Documentation

SubtractCharacterVirtualCurrency

Decrements the character's balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API.

Request Details

SubtractCharacterVirtualCurrencyRequest
Request Properties
Amount (required) int32

Amount to be subtracted from the user balance of the specified virtual currency.

CharacterId (required) String

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

PlayFabId (required) String

Unique PlayFab assigned ID of the user on whom the operation will be performed.

VirtualCurrency (required) String

Name of the virtual currency which is to be decremented.

POST https://{{TitleID}}.playfabapi.com/Server/SubtractCharacterVirtualCurrency
    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