API Call Returning Shirts as Gamepasses for Users On-Sale Items

I’m trying to fetch only the gamepasses I’ve created and put on sale in my inventory, exactly like how Pls Donate does it.

Some donation games show a clean linear list of a player’s on-sale gamepasses for others to buy.
Also known as a Tip Jar.

But it’s returning shirts from my profile instead, and labeling them as gamepasses in the output.

Expected: Just my on-sale gamepasses (actual gamepass IDs/names/prices&stuff).

Actual: Shirts showing up as “gamepasses.” The proxy seems fine suspect the issue is the endpoint I’m using in Studio or how I’m filtering the response/using the incorrect GET method.

Code:

local HttpService = game:GetService("HttpService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")

local PROXY_BASE = "https://[ my-url ].workers.dev/"

local function fetchPlayerGamepasses(userId)
	local url = PROXY_BASE .. "catalog/v1/search/items/details?Category=33&CreatorTargetId=" .. userId .. "&CreatorType=User&Limit=30"
	local success, response = pcall(HttpService.GetAsync, HttpService, url)
	if not success then
		warn("Fetch failed for gamepasses:", response)
		return {}
	end
	local decoded = HttpService:JSONDecode(response)
	return decoded.data or {}
end

local function printPlayerProducts(player)
	local userId = player.UserId

	local gamepasses = fetchPlayerGamepasses(userId)
	warn(player.Name .. " has " .. #gamepasses .. " gamepasses for sale:")
	for _, gp in ipairs(gamepasses) do
		warn("\n  - ID: " .. gp.id .. " | Name: " .. gp.name .. " | Price: " .. (gp.price or 0) .. " R$")
	end
end

if RunService:IsStudio() then
	for _, x: Player in Players:GetPlayers() do
		printPlayerProducts(x)
	end
else
	Players.PlayerAdded:Connect(printPlayerProducts)
end

Output:

11:00:37.866  PrestigeToken has 2 gamepasses for sale:  -  Edit
11:00:37.866  - ID: 16340739461 | Name: GradientClassicShirt2 | Price: 40000 R$  -  Edit
11:00:37.867  - ID: 113064099038487 | Name: luobu | Price: 7000 R$  -  Edit -

both Id’s redirect to shirts that are on sale on my profile, not gamepasses.

In the url link i think the category is wrong, for some reason I think the category is for game passes is 8 but I’m not too sure, I would suggest asking the ai for which category id is game passes ( I know I have probably broken 13 laws and are wanted by 84 countries for suggesting to use ai on something that isn’t even really code). I am probably wrong about this btw, it was justed my uneducated guess.

It’s number 34
Even though in the code I provided, I wrote on accident 33 - it still doesn’t work with 34 or using a string “GamePass”

https://create.roblox.com/docs/reference/engine/enums/AssetType

The Catalog API is only for fetching avatar items. Passes, badges, etc are not supported for this endpoint.

You will want to instead fetch a list of a user’s public experiences using https://games.roblox.com/v2/users/{USER_ID}/games?limit=50&cursor=, and then list each Pass in each experience with https://apis.roblox.com/game-passes/v1/universes/{UNIVERSE_ID}/game-passes?passView=Full&pageSize=50&pageToken=.

You could also alternatively just use https://apis.roblox.com/game-passes/v1/users/USER_ID/game-passes?count=100&exclusiveStartId= if the user’s inventory is public, and filter out which Passes are not created by them.

The only reason why GamePass exist as an asset type is because Passes used to be assets, but they are now their own separate thing.

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