Purchase gamepass webhook

Essentially, this code is designed to establish a webhook connection between Roblox and Discord, allowing it to notify Discord about the in-game purchases made by players. However, currently, it only functions properly when a test purchase of developer items is made within the Roblox studio. How can I modify it to work for various types of purchases, including game passes, developer IDs, and other items and make it work in actual game, not only roblox studio?
(code is not mine)

HTTPService = game:GetService("HttpService")
Webhook_URL = ''

game.Players.PlayerAdded:Connect(function(player)
MarketplaceService.PromptProductPurchaseFinished:Connect(function(userid, id, ifpurchased1)
    if ifpurchased1 then
        local Data = {
            ["content"] = "",
            ["embeds"] = {{
                ["title"] = "**New Product Purchase**" ,
                ["description"] = player.Name .. " **Has Purchased: ** ".. MarketplaceService:GetProductInfo(id, Enum.InfoType.Product).Name, -- Change Robux Amount to how much product was worth
                ["type"] = "rich",
                ['url'] = "https://www.roblox.com/users/".. player.UserId .. "/profile",
                ["color"] = 4972305,
                ["fields"] = {
                    {
                        ["name"] = " Product Price ",
                        ["value"] = MarketplaceService:GetProductInfo(id, Enum.InfoType.Product).PriceInRobux .. " Robux",
                        ["inline"] = true
                        },
                        {
                            ['name'] = "User ID: ",
                            ['value'] = userid,
                            ['inline'] = true
                        }
                }
            }}
        }
        Data = HTTPService:JSONEncode(Data)
        HTTPService:PostAsync(Webhook_URL, Data)
    end
    end)
    end)

If I recall correctly, Discord blocks all requests from Roblox servers. It works in Studio because a server in Studio is not running on Roblox’s servers, but rather a “server” ran on your computer. I know some people use proxies, but I’m not sure if that’s against Roblox or Discord TOS

There are plenty of DevForum posts and even tutorials on how to use or create proxies of your own for use of bypassing the Discord-to-Roblox firewall. Discord blocked Roblox due to their frequent requests and the number of requests coming from Roblox itself - But it should be fine if you use a proxy as it isn’t against any terms of service. To Roblox, it’s just a POST request to a normal URL, which is what HTTPService is for. To Discord, it’s not on its blacklist for websites, so it’s allowed to go through.

TL;DR, It’s fine to use proxies. None of the terms of service from either app stop you from doing so.

If investigated, using proxies could technically be in violation of this guideline at Community Guidelines | Discord :

  • Do not evade permanent Discord-level enforcement actions. This includes creating new or using existing accounts or communities after being removed for violating our platform rules.

as discord retains the right to ban you for whatever reason. Only would really happen if you abused the API.

Then 40%+ games would be takendown…

This has nothing to do with webhooks. Its fine to proxy them