question

Victor Burgos avatar image
Victor Burgos asked

Unreal 4 C++ : How to use Economy V2 properly to retrieve Items

Okay, so I'm a bit lost. I thought I had a hang of this Economy V2 thing, I tested out an Item Request with

 void UEconomyManager::ItemRequestTest()
 {
     PlayFab::EconomyModels::FGetItemRequest ItemRequest;
     ItemRequest.Id = TEXT("randomnumber");
    
     EconomyAPI->GetItem(ItemRequest,
         PlayFab::UPlayFabEconomyAPI::FGetItemDelegate::CreateUObject(this, &UEconomyManager::OnItemRequestSuccess),
         PlayFab::FPlayFabErrorDelegate::CreateUObject(this, &UEconomyManager::OnError));
 }

I was able to see that it was successful. But then I was reading it's only supposed to return the last 50 items if I used GetItemsRequest.

But basically, what I want to be doing is that once the Client has been authenticated and signed in, I want to do a one-time query on their inventory and cache it.

So, I checked out GetCatalogItems, which to my surprise retrieves the Catalogs(Legacy) inventory! I wondered why it spits out "One" as the ItemId.

Anyway, could this be an issue with an old SDK? It looks like my current version is from Nov 2022. Or am I just doing something wrong to retrieve my player's inventory using Economy V2.

In any case, can you please also show an example of the proper way to retrieve & cache the player's inventory, so that we're all on the same page?

Thanks!

apisIn-Game EconomyunrealPlayer Inventory
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Simon Cui avatar image
Simon Cui answered

GetCatalogItems API is one of Economy V1 APIs, while Get Inventory Items is an Economy V2 API to get a player’s current inventory items. You can also use ContinuationToken to paginate through multiple counts of results. To learn more about Economy V2 APIs, you can refer to Inventory - REST API (PlayFab Economy) | Microsoft Learn and Catalog - REST API (PlayFab Economy) | Microsoft Learn .

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.