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.
