:PromptGamePassPurchase()

Whenever I prompt a game pass purchase it gives me this:
18:51:56.064 - PurchasePromptScript: getProductInfo failed because MarketplaceService:getProductInfo() failed because HTTP 0 (HTTP 400 (HTTP/1.1 400 BadRequest)) Make sure a valid ID was specified
Code Example:

SurfaceShop2["InfiniteMobux"].PurchaseButton.MouseButton1Click:Connect(function()
	mpService:PromptGamePassPurchase(game.Players.LocalPlayer, 837859114)
end)

This does it for any game pass, every time.
Unsure whether this is already being worked on, a bug or hasn’t been added yet.

They changed the way GamePass ID’s are made, see this:

1 Like

Didn’t they revert it…?

Oh yeah they did. Maybe that killed :PromptGamePassPurchase()'s functionality?

Not sure, but i’ll just use :PromptPurchase() for now.

Can’t you do else if not working, do this…

I found this function on the wiki and I tried using it. Later on I noticed that it does not work. I tried calling MarketplaceSerivice:GetProductInfo() on the gamepass’s id and it gave me two IDs, one being the asset ID I was trying to use in PromptGamePassPurchase (which didn’t work) and the other one being “ProductId”, which apparently is undocumented and also didn’t work. It would be nice if this function were labeled broken.

I haven’t tried using this function, but if it is still disabled as a previous post suggested then it shouldn’t show up on the Wiki or should at least say that it is currently disabled. Although, I do know about the two IDs you speak of. AssetId is used to uniquely identify an asset, hence the name, e.g. models, places, shirts etc. whereas ProductId is a unique identifier for developer products, they can have the same Id as an asset but are used to reference a product instead. I assume when and if they enable the GamepassService update they will have their own identifier, probably GamePassId as otherwise if it stayed as an AssetId the info type Enum.InfoType.GamePass would be irrelevant as an extra argument for Marketplace:GetProductInfo().