Skip to main content

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.

Redeem code webhook imageRedeem code webhook image

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

  1. Develop a function for the coupon.redeemed webhook processing.
  2. Make your endpoint available.
  3. 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

KeyTypeDescription
player_idstringThe unique Player ID chosen for player authentication.
couponCouponThe coupon object containing the redeem code data.
itemItemThe item object containing the item data.

The Coupon object

KeyTypeDescription
codestringRedeem code.
skustringFree item SKU provided upon the redeem code usage.
redeemed_atnumberCode usage date in Unix epoch time.

Need help?
Contact our integration team at integration@aghanim.com