What's the current / correct way to sell game passes in game?

Trying to sell game passes:

Method 1

MarketplaceService:PromptPurchase(requestingPlayer, assetId)

Output

AssetId '1181375139' is of type Game Pass. Please use GamePassService:PlayerHasPass instead.

Works

Method 2

MarketplaceService:PromptGamePassPurchase(requestingPlayer, assetId)

Output

PurchasePromptScript: getProductInfo failed because MarketplaceService:getProductInfo() failed because HTTP 0 (HTTP 400 (HTTP/1.1 400 BadRequest)) Make sure a valid ID was specified

On screen prompt errors with ‘Your purchase failed because something went wrong’

Questions…

What’s the right way to do this - why does Method 1’s output make no sense and Method 2 not work?
Are game passes being depreciated?

Are we still limited to 9 game passes?

What’s going on with this funky update - [OUTDATED] Update on Game Passes

Appreciate the help guys.

4 Likes

Hello!
So basically. This is caused by recent gamepass update.

Gamepasses have got now their own id (just like developer products). Gamepasses made before the update kept their asset ids (from links), but newer haven’t got them. To prompt purchase you need to call PromptPurchaseGamePass with it’s “gamepass” id. Asset ids won’t work (this is probably reason why method 2 displayed error in your case).

Other things such as 9 gamepass limit aren’t removed.

2 Likes

But it says in that thread that update has been revoked - and the method they state for getting hold of the gamepass id doesn’t work.

1 Like

Oh yes. I see. You are right. I have got no idea then. It’s really buggy the. :confused:

1 Like

I personally use:

local player = game.Players.LocalPlayer
local marketplaceService = game:GetService(“MarketplaceService”)
local gamePassId = (ID Here)

function onClicked()
marketplaceService:PromptPurchase(player, gamePassId)
end

script.Parent.MouseButton1Click:connect(onClicked)

I use this inside of buttons to display up a way of buying the game pass. Doesn’t seem to not work for me… Although my gamepasses are older than the Sept 14th update.

Also, what is this about being limited to 9 gamepasses? My one game has 14, and 13 of them are accessible to be bought in one place alone.

3 Likes

Upon further searching:
https://twitter.com/rbxdevtips/status/588575330182385664?lang=en

This is apparently a thing that happened. Unsure the legitimacy of it, but probably true.

2 Likes

Thought I would bring this back up, I’m having the same exact problem.

I get an error saying that the gamepass’s ID is less than 0, when in reality it isn’t.

(ID: 873893098)

Output : Internal error while fetching asset type because MarketplaceService:GetProductInfo() argument is not a valid assetId (supplied assetId was less than 0)

1 Like

Does anyone know how to get a game pass ID?
Mine only seem to give a libary/asset ID?

They say

“To get the game pass ID from an existing asset ID, go to www.roblox.com/library/{assetId}/view58. You will be redirected to www.roblox.com/game-pass/{gamePassId}/view53. You can then copy the game pass ID from the URL.”

But I don’t seem to be able to do this…?

Use PromptPurchase with the assetId instead. The game pass update was reverted but they didn’t take out the warning. Just ignore the warning.

2 Likes

Thank you

1 Like