Overview
When a request hits a webhook proxy with an active auto-delivery rule, NEX can generate a unique API key or grant token, set an expiry, and deliver it through one or more channels before the webhook is forwarded.
Purchase trigger
Set trigger to Purchase / payment event. NEX runs the rule only when a JSON field (default event) matches values like purchase, order.completed, or payment.succeeded.
{
"event": "purchase",
"userId": "123456789",
"email": "[email protected]",
"discordUserId": "987654321",
"product": "VIP Pass"
}
Examples
Your server POSTs a purchase payload; NEX generates a time-limited API key, emails it to the buyer, and injects it into the forwarded JSON.
- Dashboard → Auto-Delivery → Setup
- Trigger: purchase · field
event· valuepurchase - Key type: API key · duration: 30 days
- Channels: email + payload · email field:
email
Project files
- ServerScriptService/
- NexPurchaseWebhook.server.lua
local HttpService = game:GetService("HttpService")
local WEBHOOK_URL = "https://nexrbx.com/api/webhooks/p/YOUR_PUBLIC_ID"
local function notifyPurchase(player, productName)
local payload = {
event = "purchase",
userId = tostring(player.UserId),
email = "[email protected]",
product = productName,
}
pcall(function()
HttpService:PostAsync(WEBHOOK_URL, HttpService:JSONEncode(payload), Enum.HttpContentType.ApplicationJson)
end)
end
NEX injects a one-time nex_grant_… token. Your game server redeems it to unlock access.
- Key type: grant token · duration: 7 days
- Channel: payload · recipient field:
userId
Project files
- ServerScriptService/
- NexGrantRedeem.server.lua
local HttpService = game:GetService("HttpService")
local REDEEM_URL = "https://developer.nexrbx.com/api/developer/auto-delivery/redeem"
local function redeemGrantToken(token)
local ok, response = pcall(function()
return HttpService:PostAsync(REDEEM_URL, HttpService:JSONEncode({ token = token }), Enum.HttpContentType.ApplicationJson)
end)
if not ok then return false end
return HttpService:JSONDecode(response).valid == true
end
NEX queues the key for your bot integration to DM the customer on Discord.
- Channel: queue for bot delivery
- Discord field:
discordUserId
Project files
Dashboard-only — include discordUserId in the purchase payload.
{
"event": "purchase",
"userId": "123456789",
"discordUserId": "987654321012345678",
"email": "[email protected]"
}
Require an API key via filter, then auto-deliver on authorized purchases.
Project files
- ServerScriptService/
- NexAuthorizedPurchase.server.lua
- ReplicatedStorage/
- NexSecrets.lua
HttpService:PostAsync(WEBHOOK_URL, payload, Enum.HttpContentType.ApplicationJson, false, {
["Authorization"] = "Bearer " .. API_KEY,
})
Delivery channels
- Payload — field
nex_deliverymerged into forwarded JSON - Email — full key sent to the configured email field
- Bot — queued for Discord DM delivery
API keys vs grant tokens
API keys (nex_dev_…) — verify via API keys or script licenses. Grant tokens (nex_grant_…) — one-time redeem below.
License products on purchase
When key type is API key, optionally select a License product. NEX creates both the API key and a license entitlement with HWID binding, device limits, leak alerts, and update channel access.
- Create a product under Licenses → Create product
- Auto-Delivery → API key mode → pick the product
- Set recipient field to
userIdto bind Roblox buyers
Pair with a storefront adapter on the webhook proxy so Gumroad, Sellix, and similar payloads normalize automatically.
Redeem endpoint
POST https://developer.nexrbx.com/api/developer/auto-delivery/redeem
{ "token": "nex_grant_…" }
Invalid, expired, or already-redeemed tokens return { "valid": false }.
Testing with replay
From Webhooks → Statistics → Recent events, click Replay to resend a stored payload without a live purchase.