question

Wisarut Kiatboonsri by Playfab avatar image
Wisarut Kiatboonsri by Playfab asked

Economy v2 Get InventoryItem title?

"I am attempting to obtain players' currencies using PlayFab.PlayFabEconomyAPI.GetInventoryItems. The response includes an array of InventoryItems with long item ID, such as '550d8777-6357-4ffe-9e06-ed1f0e9264a4'. How can I retrieve currency names title 'gold' or 'diamond' to map them to my UI?"

Player 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.

Wisarut Kiatboonsri by Playfab avatar image
Wisarut Kiatboonsri by Playfab answered

OK , I forgot that I can get CatalogItem and map it by it

10 |1200

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

Simon Cui avatar image
Simon Cui answered

Please refer to this post: Economy V2: InventoryItem class REALLY needs AlternateId - Playfab Community.

As a workaround, for several items, you can use Catalog - Get Items - REST API (PlayFab Economy) | Microsoft Learn and map them. But for many items, you may use Catalog - Search Items - REST API (PlayFab Economy) | Microsoft Learn to cache AlternateIds and Ids of all items locally. Then after you call GetInventoryItems and get Ids of items, you can use your local cache data to retrieve the corresponding AlternaterIds based on Ids.

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.