Documentation

ModifyItemUses

Modifies the number of remaining uses of a player's inventory item

Request Details

This function can both add and remove uses of an inventory item. If the number of uses drops below zero, the item will be removed from active inventory.

ModifyItemUsesRequest
Request Properties
ItemInstanceId (required) String

Unique instance identifier of the item to be modified.

PlayFabId (required) String

PlayFab unique identifier of the user whose item is being modified.

UsesToAdd (required) int32

Number of uses to add to the item. Can be negative to remove uses.

POST https://{{TitleID}}.playfabapi.com/Server/ModifyItemUses
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PlayFabId": "20394883",
  "ItemInstanceId": "94585729",
  "UsesToAdd": 1
}
        

Response Details

ModifyItemUsesResult
Result Properties
ItemInstanceId String

Unique instance identifier of the item with uses consumed.

RemainingUses (required) int32

Number of uses remaining on the item.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "ItemInstanceId": "94585729",
    "RemainingUses": 0
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
InvalidItemProperties 1091
NoRemainingUses 1062