Code Redeem Webhook
Aghanim offers a redeemed code webhook to notify your game when a redeem code for a free item has been used by a player, providing detailed information about the event.
This webhook is activated through the Redeemed code event, selectable in Game → Webhooks.
warning
To credit in-game items to player accounts, use the item.add webhook. The coupon redeemed webhook is designed to provide detailed data when item.add is insufficient.

Requirements
To use redeemed code webhooks from Aghanim, you should have the webhook server configured as follows:
- HTTPS endpoint, accepting POST webhook requests.
- Listen for events, generated and signed by Aghanim.
- Respond with 2xx status codes to signal successful processing, and 4xx or 5xx for denial or errors.
Configuration
- Develop a function for the
coupon.redeemedwebhook processing. - Make your endpoint available.
- Register your endpoint within Aghanim account → Game → Webhooks → New Webhook by choosing the corresponding event type.
Alternatively, you can register your endpoint within Aghanim using the Create Webhook API method.
The Event Data schema
| Key | Type | Description |
|---|---|---|
player_id | string | The unique Player ID chosen for player authentication. |
coupon | Coupon | The coupon object containing the redeem code data. |
item | Item | The item object containing the item data. |
The Coupon object
| Key | Type | Description |
|---|---|---|
code | string | Redeem code. |
sku | string | Free item SKU provided upon the redeem code usage. |
redeemed_at | number | Code usage date in Unix epoch time. |
Need help?
Contact our integration team at integration@aghanim.com