Webhook events
This section describes the list of events available and the payload structure per request.
Webhook Request Structure
When our platform generates a webhook request, it sends a structured payload containing multiple events. Each event consists of specific fields that describe the nature of the event, the relevant data, and the time when it occurred. Below is a detailed breakdown of the webhook event structure:
{
"events": [
{
"eventName": "string",
"payload": [
{
"key": "string",
"type": "string",
"value": "string"
}
],
"eventDate": "string"
}
]
}
Event Object Structure
Each event in the events array contains the following fields:
- eventName: A string that indicates the type of event. Examples include virtualCurrency_on_walletUpdate, ranks_on_xpUp, level_up, etc.
- payload: An array of key-value pairs providing detailed information related to the event. Each item in the payload includes:
- type: The data type of the value (available: string, number, boolean, i18n and date).
- key: The name of the data field (e.g., PlayerId, Balance, XpBalance).
- value: The value associated with the key. This returns the string representation of the data type.
- eventDate: An ISO Date string representing the date and time when the event occurred.
Payload Item Types
Each payload item can have one of the following types:
- string: Represents text data.
- number: Represents numeric data.
- boolean: Represents boolean data.
- i18n: Represents internationalized text with translations for different languages.
- date: Represents date and time in ISO 8601 format.
Example Event Object
{
"eventName": "level_up",
"payload": [
{
"type": "string",
"key": "PlayerId",
"value": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9"
},
{
"type": "number",
"key": "CurrentLevel",
"value": "9"
},
{
"type": "i18n",
"key": "RewardExternalDescription",
"value": {
"languages": [
{ "language": "EN", "value": "100 Coins" },
{ "language": "IT", "value": "100 Coins" },
{ "language": "FR", "value": "100 Coins" },
{ "language": "DE", "value": "100 Coins" }
]
}
},
{
"type": "number",
"key": "RemainingPendingLevels",
"value": "8"
},
{
"type": "string",
"key": "CurrentRankExternalName",
"value": "Member"
},
{
"type": "i18n",
"key": "CurrentRankExternalDescription",
"value": {
"languages": [
{ "language": "en", "value": "Member" },
{ "language": "IT", "value": "Member" },
{ "language": "FR", "value": "Member" },
{ "language": "DE", "value": "Member" }
]
}
},
{
"type": "number",
"key": "XpBalance",
"value": "5000.00"
},
{
"type": "boolean",
"key": "Active",
"value": "true"
},
{
"type": "date",
"key": "Timestamp",
"value": "2024-06-24T21:28:41.938Z"
}
],
"eventDate": "2024-06-24T21:28:41.939Z"
}
Events List
Gamification optout
This event is dispatched when a player deactivates all loyalty features by choosing to opt out.
Event Name: gamification_optout
Display event details
{
"playerId": "b9ee09af-4e40-4844-9b68-a72601d5d597",
"eventName": "gamification_optout",
"payload": [
{
"type": "string",
"key": "PlayerId",
"value": "b9ee09af-4e40-4844-9b68-a72601d5d597"
},
{
"type": "date",
"key": "Timestamp",
"value": "2024-06-25T17:41:25.613Z"
},
{
"type": "number",
"key": "CurrentLevel",
"value": "1"
},
{
"type": "string",
"key": "CurrentRankExternalName",
"value": "Member"
},
{
"type": "number",
"key": "XpBalance",
"value": "0.00"
}
],
"eventDate": "2024-06-25T17:41:25.613Z"
}
Gamification optin
This event is dispatched when a player activates all loyalty features by choosing to opt in.
Event Name: gamification_optin
Display event details
{
"playerId": "b9ee09af-4e40-4844-9b68-a72601d5d597",
"eventName": "gamification_optin",
"payload": [
{
"type": "string",
"key": "PlayerId",
"value": "b9ee09af-4e40-4844-9b68-a72601d5d597"
},
{
"type": "date",
"key": "Timestamp",
"value": "2024-06-25T17:41:29.058Z"
},
{
"type": "number",
"key": "CurrentLevel",
"value": "1"
},
{
"type": "string",
"key": "CurrentRankExternalName",
"value": "Member"
},
{
"type": "number",
"key": "XpBalance",
"value": "0.00"
}
],
"eventDate": "2024-06-25T17:41:29.059Z"
}
Level Up
This event is triggered when a level requirement is completed.
Event Name: level_up
Display event details
{
"playerId": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9",
"eventName": "level_up",
"payload": [
{
"type": "string",
"key": "PlayerId",
"value": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9"
},
{
"type": "number",
"key": "CurrentLevel",
"value": "9"
},
{
"type": "i18n",
"key": "RewardExternalDescription",
"value": {
"languages": [
{
"language": "EN",
"value": "100 Coins"
},
{
"language": "ES",
"value": "100 Monedas"
}
]
}
},
{
"type": "number",
"key": "RemainingPendingLevels",
"value": "8"
},
{
"type": "string",
"key": "CurrentRankExternalName",
"value": "Member"
},
{
"type": "i18n",
"key": "CurrentRankExternalDescription",
"value": {
"languages": [
{
"language": "en",
"value": "Member"
},
{
"language": "IT",
"value": "Member"
},
{
"language": "FR",
"value": "Member"
},
{
"language": "DE",
"value": "Member"
}
]
}
},
{
"type": "number",
"key": "XpBalance",
"value": "5000.00"
},
{
"type": "date",
"key": "Timestamp",
"value": "2024-06-24T21:28:41.938Z"
}
],
"eventDate": "2024-06-24T21:28:41.939Z"
}
Rank up
This event is triggered when all the levels in a Rank are completed, and the requirements of a Rank are completed.
Event Name: rank_up
Display event details
{
"playerId": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9",
"eventName": "rank_up",
"payload": [
{
"type": "string",
"key": "PlayerId",
"value": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9"
},
{
"type": "number",
"key": "CurrentLevel",
"value": "19"
},
{
"type": "string",
"key": "CurrentRankExternalName",
"value": "Silver"
},
{
"type": "i18n",
"key": "CurrentRankExternalDescription",
"value": {
"languages": [
{
"language": "en",
"value": "Silver"
},
{
"language": "es",
"value": "Plata"
}
]
}
},
{
"type": "number",
"key": "XpBalance",
"value": "18250.00"
},
{
"type": "date",
"key": "Timestamp",
"value": "2024-06-24T21:28:42.899Z"
}
],
"eventDate": "2024-06-24T21:28:42.899Z"
}
On player downgrade
This event is triggered whenever a player is downgraded.
Event Name: on_player_downgrade
Display event details
{
"playerId": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9",
"eventName": "rank_up",
"payload": [
{
"type": "string",
"key": "PlayerId",
"value": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9"
},
{
"type": "number",
"key": "PreviousLevel",
"value": "19"
},
{
"type": "number",
"key": "CurrentLevel",
"value": "1"
},
{
"type": "string",
"key": "CurrentRankExternalName",
"value": "Silver"
},
{
"type": "string",
"key": "PreviousRankExternalName",
"value": "Gold"
},
{
"type": "number",
"key": "PreviousXpBalance",
"value": "18250.00"
},
{
"type": "number",
"key": "XpBalance",
"value": "10.00"
},
{
"type": "number",
"key": "PreviousTokensBalance",
"value": "2789.00"
},
{
"type": "number",
"key": "TokensBalance",
"value": "1.00"
},
{
"type": "date",
"key": "Timestamp",
"value": "2024-06-24T21:28:42.899Z"
}
],
"eventDate": "2024-06-24T21:28:42.899Z"
}
Mission completed
This event is triggered when a Mission is completed.
Event Name: mission_completed
Display event details
{
"playerId": "b9ee09af-4e40-4844-9b68-a72601d5d597",
"eventName": "mission_completed",
"payload": [
{
"key": "PlayerId",
"type": "string",
"value": "b9ee09af-4e40-4844-9b68-a72601d5d597"
},
{
"key": "RewardExternalName",
"type": "i18n",
"value": {
"languages": []
}
},
{
"key": "RemainingPendingMissions",
"type": "number",
"value": "6"
},
{
"key": "MissionBundleExternalName",
"type": "i18n",
"value": {
"languages": [
{
"language": "EN",
"value": "Mission One"
},
{
"language": "ES",
"value": "Misión Uno"
}
]
}
}
],
"eventDate": "2024-06-25T17:38:11.881Z"
}
Mission bundle completed
This event is triggered when a Mission Bundle is completed and all pertinent Missions within it are completed.
Event Name: mission_bundle_completed
Display event details
{
"playerId": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9",
"eventName": "mission_bundle_completed",
"payload": [
{
"key": "PlayerId",
"type": "string",
"value": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9"
},
{
"key": "MissionBundleExternalName",
"type": "i18n",
"value": {
"languages": []
}
}
],
"eventDate": "2024-06-25T15:00:35.954Z"
}
Ranks Level Points Balance Updated
This event is dispatched when the player is credited with XP Points
Event Name: ranks_on_xpUp
Display event details
{
"eventName": "ranks_on_xpUp",
"payload": [
{
"type": "string",
"key": "PlayerId",
"value": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9"
},
{
"type": "number",
"key": "XpBalance",
"value": "5000"
},
{
"type": "number",
"key": "PointsUntilNextLevel",
"value": "-4900"
},
{
"type": "number",
"key": "PointsUntilNextRank",
"value": "10000"
}
],
"eventDate": "2024-06-25T15:00:35.954Z"
}
Virtual Currency Tokens Balance Updated
This event is dispatched when the player is credited with Virtual Currency Coins
Event Name: virtualCurrency_on_walletUpdate
Display event details
{
"eventName": "virtualCurrency_on_walletUpdate",
"payload": [
{
"type": "string",
"key": "PlayerId",
"value": "d4a9bbb4-576b-4c29-8f8d-e03c427265c9"
},
{
"type": "number",
"key": "Balance",
"value": "5000"
}
],
"eventDate": "2024-06-25T15:00:35.954Z"
}
Reward Shop Product Purchase
This event is dispatched when any change is performed for a player reward shop product order. For example on purchase, on shipped, on cancelled, etc.
Event Name: product_purchase
Display event details
{
"playerId": "d023aa08-7a3b-462b-b9c3-89cb3a8489b9",
"eventName": "product_purchase",
"payload": [
{
"key": "PlayerId",
"value": "d023aa08-7a3b-462b-b9c3-89cb3a8489b9",
"type": "string"
},
{
"key": "OrderStatus",
"value": "purchased",
"displayValue": "Purchased",
"type": "enum",
"options": [
{
"key": "Cancelled",
"value": "cancelled"
},
{
"key": "OutOfStock",
"value": "out_of_stock"
},
{
"key": "Purchased",
"value": "purchased"
},
{
"key": "Shipped",
"value": "shipped"
},
{
"key": "ThirdParty",
"value": "third_party"
}
]
},
{
"key": "ProductExternalName",
"value": {
"languages": [
{
"language": "EN",
"value": "(H3) spaceX moon travel"
}
]
},
"type": "i18n"
},
{
"key": "ProductExternalDescription",
"value": {
"languages": [
{
"language": "EN",
"value": "<p><em>The Moon is one of Earth’s closest habitable neighbors and provides an opportunity to gain valuable experience for missions to Mars and beyond.</em></p>"
}
]
},
"type": "i18n"
},
{
"key": "Quantity",
"value": "1",
"type": "number"
},
{
"key": "Price",
"value": "3",
"type": "number"
},
{
"key": "RecipientName",
"value": "John",
"type": "string"
},
{
"key": "RecipientAddress",
"value": "Zarcero, 10, Calle, 12345, CR",
"type": "string"
},
{
"key": "ProductType",
"value": "external_product",
"displayValue": "External Product",
"type": "enum",
"options": [
{
"key": "Bonus",
"value": "bonus"
},
{
"key": "Booster",
"value": "booster"
},
{
"key": "ExternalProduct",
"value": "external_product"
},
{
"key": "XP",
"value": "xp"
}
]
},
{
"key": "ProductStatus",
"value": "purchased",
"displayValue": "Purchased",
"type": "enum",
"options": [
{
"key": "Cancelled",
"value": "cancelled"
},
{
"key": "OutOfStock",
"value": "out_of_stock"
},
{
"key": "Purchased",
"value": "purchased"
},
{
"key": "Shipped",
"value": "shipped"
},
{
"key": "ThirdParty",
"value": "third_party"
}
]
},
{
"key": "TokensBalance",
"value": "238",
"type": "number"
},
{
"key": "Timestamp",
"value": "2024-09-11T17:32:43.224Z",
"type": "date"
},
{
"key": "ExternalURL",
"value": "https://www.amazing-fake-shop-store.com/SpaceX-Spacecraft-Astronaut-Desktop-Ornaments/pd/LTGe5ckn23",
"type": "string"
},
{
"key": "Comment",
"value": "Reward purchased from widgets. ",
"type": "string"
},
{
"key": "Suppliers",
"value": "Amazing Fake Store",
"type": "string"
},
{
"key": "ProductRemainingStock",
"value": "49",
"type": "number"
}
],
"eventDate": "2024-09-11T17:32:43.224Z"
}
Happy integration!