Documentation

UpdatePlayerStatistics

Updates the values of the specified title-specific statistics for the user

Request Details

This operation is additive. Statistics not currently defined will be added, while those already defined will be updated with the given values. All other user statistics will remain unchanged.

UpdatePlayerStatisticsRequest
Request Properties
ForceUpdate Boolean

Indicates whether the statistics provided should be set, regardless of the aggregation method set on the statistic. Default is false.

PlayFabId (required) String

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

Statistics (required) List<StatisticUpdate>

Statistics to be updated with the provided values

POST https://{{TitleID}}.playfabapi.com/Server/UpdatePlayerStatistics
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PlayFabId": "10931252888739651331",
  "Statistics": [
    {
      "StatisticName": "Points",
      "Version": 1,
      "Value": 600
    },
    {
      "StatisticName": "Wins",
      "Version": 2,
      "Value": 16
    },
    {
      "StatisticName": "Stars",
      "Value": 7
    }
  ]
}
        

Response Details

UpdatePlayerStatisticsResult
Result Properties

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8


Authentication

SecretKey

Possible Error Codes

Name Code
AccountNotFound 1001
DuplicateStatisticName 1253
StatisticCountLimitExceeded 1203
StatisticNameConflict 1196
StatisticNotFound 1195
StatisticValueAggregationOverflow 1308
StatisticVersionClosedForWrites 1197
StatisticVersionInvalid 1198