Add a way to get a player's purchase history

As a Roblox developer, it is currently too hard to restore a player’s purchases after data gets reset/wiped

Sometimes I need to reset player data in my game. I want to add a feature that lets them ‘restore’ certain purchases they make in my game. For example, a player can pay Robux to upgrade their walkspeed, and this can be purchased multiple times. If I need to reset the games data for whatever reason, the player will lose those upgrades and since Roblox provides no tools to developers to check if a player bought a developer product, the player ends up with nothing.

MarketplaceService:GetPurchaseHistory(Player.UserId) would let me add a button that would let the player restore those purchases. The data returned from :GetPurchaseHistory would include every developer product and gamepass they bought in the game the function is called from, with the product id, purchase id, price and time they bought it.

Example of data that could be returned:

{
   "GamePass":[
      {
         "Id": 123, --ID of purchased product
         "PurchaseId": "61381cb4-c680-4da4-ba1c-55db9f2146b8", --The same PurchaseId returned by MarketplaceService.ProcessReceipt
         "PurchaseTime": 1578259599, --UTC time since unix epoch 
         "PurchasePrice": 100 --The amount the player purchased it for. Needed if the product changes price since they purchased the product
      }
   ],
   "DeveloperProduct":[
      {
         "PurchaseTime":1578259599,
         "PurchaseId":"61381cb4-c680-4da4-ba1c-55db9f2146b8",
         "PurchasePrice":20,
         "Id":123
      }
   ]
}
37 Likes

I definitely support this, it’d be pretty beneficial for developers.

However, I believe instead of keeping every purchase in a dictionary mixed with GamePasses & Products, the GetPurchaseHistory function would take a InfoType Enumeration - then GetPurchaseHistory would return all the purchases of the InfoType in an array.

For example:

local MarketplaceService = game:GetService("MarketplaceService")
local PurchasedGamepasses = MarketplaceService:GetPurchaseHistory(Player.UserId, Enum.InfoType.GamePass)

for _, PurchaseInfo in ipairs(PurchasedGamepasses) do
    --// etc
end

And yes, this would include purchased Assets & Subscriptions (when they are released).

3 Likes

This should be limited to transactions done with the place’s owner. I don’t want people looking through transactions that they shouldn’t even have access to as it would be a tool for beggars to target players by their balance.

10 Likes

I can’t express how important this is, and how much we lose from not having it.

We have a support team of 6 people (and growing). When a player complains a purchase they made hasn’t gone through in game, we have no way of verifying whether they actually spent the robux or not. This makes it incredible difficult to support these tickets, borderline impossible in some cases.

We accept screenshots and video evidence, but players have begun photoshopping their screenshots (often badly) to pretend they made Robux purchases. This is only possible because we have no viable way of confirming whether a robux purchase was made in our game.

Please, please, please add some way of confirming that a user made a robux purchase. It doesn’t even seem like it would be that hard, all the purchases are logged somewhere (since they display linearly on page). Our support team desperately needs to be able to input a username and see a historical list of transactions they made.

8 Likes

This is something that would be great to help minimize the effects of data loss in data stores. I personally think that this should accept a query of asset types and ids otherwise this could result in thousands of user purchases. Obviously, if the owner of the game doesn’t own the asset, it shouldn’t be returned. Something like this: MarketplaceService:GetPurchaseHistory(userId, {InfoType = Enum.InfoType.GamePass, Id = 123}, {InfoType = Enum.InfoType.GamePass, Id = 123}) or something like this: MarketplaceService:GetPurchaseHistory(userId, infoType, id)

5 Likes

Wait, so you’re telling me that Roblox doesn’t save Robux purchases automatically? You have to save them yourself? That’s crazy. I honestly don’t see any reason why they don’t already do this. It seems odd that you have to save purchases in DataStores (which can occasionally go down or malfunction) and there’s no other way to get them. :face_with_monocle:

1 Like