Documentation

GetUserInventory

Retrieves the specified user's current inventory of virtual goods

Request Details

All items currently in the user inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included.

GetUserInventoryRequest
Request Properties
PlayFabId (required) String

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

POST https://{{TitleID}}.playfabapi.com/Admin/GetUserInventory
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PlayFabId": "204883457"
}
        

Response Details

GetUserInventoryResult
Result Properties
Inventory List<ItemInstance>

Array of inventory items belonging to the user.

PlayFabId String

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

VirtualCurrency Dict<String, int32>

Array of virtual currency balance(s) belonging to the user.

VirtualCurrencyRechargeTimes Dict<String, VirtualCurrencyRechargeTime>

Array of remaining times and timestamps for virtual currencies.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "PlayFabId": "204883457",
    "Inventory": [
      {
        "ItemId": "shield_level_5",
        "ItemInstanceId": "9879843",
        "ItemClass": "shields",
        "CatalogVersion": "5",
        "UnitPrice": 0
      },
      {
        "ItemId": "energy_boost_1",
        "ItemInstanceId": "3854637",
        "ItemClass": "boosts",
        "RemainingUses": 4,
        "CatalogVersion": "5",
        "UnitPrice": 0
      }
    ],
    "VirtualCurrency": {
      "GC": 15
    },
    "VirtualCurrencyRechargeTimes": {
      "GC": {
        "SecondsToRecharge": 3600,
        "RechargeTime": "2014-01-01T12:00:00Z",
        "RechargeMax": 50
      }
    }
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code