Why is my promptPurchase not working?

The prompt purchase isn’t working for some reason. The gamepass one works perfectly but the T shirt one gets this popping up:

image

script:

local function donateButtonClicked(donateButton)

						local itemId = donateButton.Id.Value
						local itemPrice = donateButton.Price.Value
						local assetType = donateButton.AssetType.Value
						
						if assetType == "Gamepass" then
							MarketPlaceService:PromptGamePassPurchase(loserPlayer, itemId)
						elseif assetType == "Tshirt" then
							MarketPlaceService:PromptPurchase(loserPlayer, itemId)
						else
							print("Error")
						end

						return
					end

Have you enabled Studio Access to API Services? If I’m not mistaken, I believe the PromptPurchase fetches information from Roblox’s API Services.

1 Like

Yes thats all enabled

fdgdfgdfgdf

Are you sure you are using the right gamepassid?

1 Like

Have you also enabled third party sales? If the shirt is not uploaded under the game owner, it will count as a third party sale and will not work. If that’s not the case, I’m not sure what the problem would be because, at least to me, the script looks completely fine.

1 Like
local UrlA = "https://catalog.roproxy.com/v1/search/items/details?Category=3&CreatorName="

local function getUserGeneratedTShirtsRecursive(player, tshirts, cursor)
	tshirts = tshirts or {}
	local requestUrl = UrlA
	local username = "rafferty05"
	local data = HttpService:JSONDecode(HttpService:GetAsync(UrlA .. username)).data
	if data then
		table.sort(data,
			function(a,b)
				return a.price < b.price
			end
		)
		for _, item in ipairs(data) do
			local e,s = pcall(function()
				table.insert(tshirts, item.id)
				
				local price = item.price
				local id = item.id

				local newButton = workspace.DonateButton:Clone()
				newButton.LayoutOrder = price
				newButton.Name = price
				local priceValue = newButton.Price
				local idValue = newButton.Id
				local assetValue = newButton.AssetType
				priceValue.Value = price
				idValue.Value = id
				assetValue.Value = "Tshirt"
				newButton.Text = "$"..price
				
				print(newButton.Id.Value)

				newButton.Parent = player.PlayerGui.Donation.Frame.itemsScroller
			end)
		end
	end
	return tshirts
end

Here is where I get the assetId’s and I printed them as you can see and they all printed fine…

I just added a print statement to triple check and its 100% the tshirt Id. I have no idea why its not working

if assetType == "Tshirt" then
							print("ITEM:")
							print(itemId)
							MarketPlaceService:PromptPurchase(loserPlayer, itemId)
						end