question

tudorjude47 avatar image
tudorjude47 asked

Is there any way of getting a Player's Purchases info with the server API?

So the question is pretty straightforward. On my cloudscript i'd like to access the Player's Purchases info so I can use that data later in the cloudscript to do something with this Player. For example, I made a cloudscript that queries the player's purchase history. If that player's combined total of pack with ID 06 purchases excedes a number do something differently for that player later in the script.

1 comment
10 |1200

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

tudorjude47 avatar image tudorjude47 commented ·

Edit: I could solve this issue of mine if I could access the user's revoked inventory items as well somehow via server call but I can't seem to find the API that returns these items.

0 Likes 0 ·
brendan avatar image
brendan answered

Right now, the purchase info is available via reporting and the Game Manager, but not as a distinct API call. However, one way you could enable this right now would be by setting up a Rule in PlayStream to increment a statistic for the player whenever a purchase event occurs with the ItemId you want to track.

3 comments
10 |1200

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

tudorjude47 avatar image tudorjude47 commented ·

This will unfortunately not work retroactively, though. Is there no way to access revoked/expired items via API either?

0 Likes 0 ·
brendan avatar image brendan tudorjude47 commented ·

No, the revoked/expired items are no longer part of the player inventory, which is why they're not returned. Unfortunately, we cannot maintain as a "secondary inventory" all items the player has ever had in inventory, as the cost would be prohibitive for many titles. To track long-term on historical information about player actions, you would need to either use events, or else store the salient details you need using stats or user data.

If what you specifically need is the purchase history, that's something we may be able to expose in a future update, but it would not be available in the near-term, as it would need to be prioritized against all our existing backlog items. We prioritize in part based upon feedback from our developer community though, so we'll make sure to keep track of whether any other developers request this.

0 Likes 0 ·
tudorjude47 avatar image tudorjude47 commented ·

Ok, thank you for the answer. The solution for now will just have to be non-retroactive.

0 Likes 0 ·
Luc avatar image
Luc answered

I appreciate your explanation very much. (the cost would be prohibitive for many titles)

I understand that that list can grow indefinitely and a purchase can contain many details, of which the receipt can be quite a large string.

Even so, I would like to be able to configure PlayFab to hold on to the IAP/item id.

For CS purposes, the most important values are:

- IAP/item id

- Date

- Price

- Currency type / local price

price is only 3rd because it can often be derived from your own IAP config.

Due to the expiring purchase history, I will be building a script that keeps a duplicate list of purchases with this info. A list I can read from the user's player data and can easily view on an online tool.

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.