question

mrfish avatar image
mrfish asked

Economy (V2) Adding items to player from server?

Hello,

I'm working to add Economy (V2) to my Unity title, and am having trouble finding a way to allow my server to add items to my player's Playfab inventories.

I've attempted to use PlayFabEconomyAPI.AddInventoryItems(), but have found this may not be the right approach for what I'm trying to do. Since the commands are blocked due to my title not allowing clients to make changes to the DB. (I'd like to keep it that way as well)

Is there another method I should be using, or a way to whitelist my server to make these commands?

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

Gosen Gao avatar image
Gosen Gao answered

We also recommend not to modify the Inventory from the client. But since you want to do it from the server, you can get a title level Entity Token with Authentication - Get Entity Token - REST API (PlayFab Authentication) | Microsoft Learn to call Inventory - REST API (PlayFab Economy) | Microsoft Learn APIs.

10 |1200

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

contact-18 avatar image
contact-18 answered

hey i have the same problem. I don't quite understand how to call Add Inventory Items with Get Entity Token. An example would be very helpful.

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.