Player Item Management - Modify Item Uses
NOTE: This is a Legacy Economy API, and is in bugfix-only mode. All new Economy features are being developed only for version 2. Modifies the number of remaining uses of a player's inventory item
POST https://titleId.playfabapi.com/Server/ModifyItemUses
Request Header
Name | Required | Type | Description |
---|---|---|---|
X-SecretKey | True |
string |
This API requires a title secret key, available to title admins, from PlayFab Game Manager. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
ItemInstanceId | True |
string |
Unique instance identifier of the item to be modified. |
PlayFabId | True |
string |
PlayFab unique identifier of the user whose item is being modified. |
UsesToAdd | True |
number |
Number of uses to add to the item. Can be negative to remove uses. |
CustomTags |
object |
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). |
Responses
Name | Type | Description |
---|---|---|
200 OK | ||
400 Bad Request |
This is the outer wrapper for all responses with errors |
Security
X-SecretKey
This API requires a title secret key, available to title admins, from PlayFab Game Manager.
Type:
apiKey
In:
header
Definitions
Name | Description |
---|---|
Api |
The basic wrapper around every failed API response |
Modify |
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. |
Modify |
ApiErrorWrapper
The basic wrapper around every failed API response
Name | Type | Description |
---|---|---|
code |
integer |
Numerical HTTP code |
error |
string |
Playfab error code |
errorCode |
integer |
Numerical PlayFab error code |
errorDetails |
object |
Detailed description of individual issues with the request object |
errorMessage |
string |
Description for the PlayFab errorCode |
status |
string |
String HTTP code |
ModifyItemUsesRequest
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.
Name | Type | Description |
---|---|---|
CustomTags |
object |
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). |
ItemInstanceId |
string |
Unique instance identifier of the item to be modified. |
PlayFabId |
string |
PlayFab unique identifier of the user whose item is being modified. |
UsesToAdd |
number |
Number of uses to add to the item. Can be negative to remove uses. |
ModifyItemUsesResult
Name | Type | Description |
---|---|---|
ItemInstanceId |
string |
Unique instance identifier of the item with uses consumed. |
RemainingUses |
number |
Number of uses remaining on the item. |
Error Codes
Name | Code |
---|---|
InvalidItemProperties | 1091 |
NoRemainingUses | 1062 |