Why isn't my developer product purchase webhook working?

I’m trying to make a simple system to notify me when someone buys my developer product (through a discord webhook)

I’ve got a script where if you click the button, you get prompted to buy the id that works fine

local MarketplaceService = game:GetService("MarketplaceService")

local productid = "1199713006"

script.Parent.MouseButton1Click:Connect(function()
	MarketplaceService:PromptProductPurchase(game.Players.LocalPlayer,productid)
end)

but I’m not sure how to actually get the script to check if the product has actually been bought, then send the webhook to my discord.

the 2 things i’m asking for help on are

  • do i need to use a separate script somewhere else to actually send off the webhook?
  • how am i able to get a script to check if whoever clicked the button actually bought the product.

thanks.

Dev products require you to keep track of purchases. When a player makes a purchase a receipt object is created and sent to the MarketplaceService’s ProcessReceipt Function. You are required to define this function.

https://developer.roblox.com/en-us/api-reference/callback/MarketplaceService/ProcessReceipt

1 Like

thanks! i’ll try and use this.