:PromptProductPurchase not working Properly

I tried to put this is bug reports, but I was not allowed to add a topic there.

When a certain button is clicked in my game this like of code is run:

marketplaceService:PromptProductPurchase(player, 18904578)

The ProductId in that function is my own product, triple checked. I re-created the same Developer Product 2 times to try to see if it would work, but to no avail.

The issue is that when that line runs this is what is printed out:

AllowThirdPartySales has blocked the purchase prompt for 142392648 created by 26993195. To sell this asset made by a different user, you will need to enable AllowThirdPartySales.

What’s strange is that the ProductId is a completely different ProductId than my original product, and if I turned on AllowThirdPartySales, a random, but always the same, product would be brought up for purchase.

If I try to PromptProductPurchase with a ProductId of 0, it tells me that it the ProductId was below 0.

Happens in-game too on all devices.

Try using the Find All Studio feature using the Product IDs that appeared in the output (specifically 142392648 and 26993195)

This one is a UserId.

I will try when I get back to Studio.

There are no mentions of the userID or ProductID displayed in the error message anywhere in the game.

1 Like

Do you use any free models? Could be a hidden backdoor share your script.

I don’t use any free models. It could be one of my plug-ins, but I haven’t changed them for months. I made a quick virus removal code, and the bug still exists.

1 Like

Found the issue!

When you are in the Developer Products section of the Creator Dashboard, if you click the 3 dots on the top right of a Dev Product and click Copy AssetId, that gives you the wrong Id for making Purchases. You need the ProductId, which is written below the Product’s name.
Screenshot 2022-12-23 at 10.30.13 PM
In this example the ProductId is “134941823.”

I was using the AssetId, instead of the productId. Very strange and complicated that Roblox would have both an AssetId and a ProductId for all its Developer Products, but there are both.

I tested in Studio, and it gives you the productId when you copy from Game Settings.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.