Event Data Structures
Event Structure
The JSON structure of each event is broken down into the following objects, with an example included.
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| headers | Object | Y | (see headersObject) |
| request | Object | Y | (see requestObject) |
| response | Object | Y | (see responseObject) |
| atomicOperations | array of Objects | Y | (see atomicOperations) |
Headers Object
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| eventName | String | Y | Name of the triggered Event |
| eventDate | string | Y | timestamp (with microtime) when AIR received a request, that triggered this event (format: YYYY-MM-DDTHH:MM:SS.UUUUUU)(timestamp) |
| eesEnvironmentType | String | Y | Environment type (LIVE, STAGING, UAT, QA, DEV, TEST, etc,) |
| eesSubsystemId | String | Y | The ID of the Eagle Eye Subsystem allowing Eagle Eye to identify where this Notification was triggered |
| callerIP | String | Y | The IP address from which Request was made |
| unitId | String | Y | Eagle Eye Unit Id used during authorisation (arisen from clientId used) |
| unitFriendlyName | String | Y | Unit Name |
| clientId | String | Y | ClientId value used for a call that triggered this Event Notification |
| clientIdFriendlyName | String | Y | Friendly name of the API key used for Authentication |
| eesEventId | String | Y | Event ID, unique within AIR |
| eesMasterEventId | String | Y | Master Event ID allowing to "chain" Event Notifications, if there is no Master Event, this value will be equal to eesEventId |
| externalMessageId | String | Y | External System Message ID (if provided to our APIs) |
| eesAPIVersion | String | Y | AIR API version |
Request Object
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| resource | string | Y | API endpoint used by the calling application |
| method | string | Y | A HTTP method used for a resource above |
| body | string | Y | Request body used for a call above (please note this request body could be double escaped). Note: the request body will return null for Resource APIs, including the Campaign, Plan and Scheme calls. |
| contentType | string | Y | HTTP Content-Type used for an API call above (defaults to application/json) |
| customHeaders | object | Y | This JSON object will consist custom headers present in Request above (please note header name has to follow this pattern: X-CUSTOM-*). |
Response Object
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| code | Int32 | Y | HTTP status code returned by AIR to the calling application (documented in referenced document API endpoint documentation) |
| body | string | Y | HTTP Response sent to the calling application. Please refer to API documentation for a response body structure. Note: the response body will return null for Resource APIs, including the Campaign, Plan and Scheme calls. Refer to the event Atomic Operations Objects for additional detail. |
| contentType | string | Y | HTTP Content-Type returned to the calling application (defaults to application/json) |
Atomic Operations Object
This JSON array contains detailed information what was created, updated or deleted (soft-deleted) within AIR as a result of an API call mentioned above.
Each item in this array contains the following information:
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| objectType | string | Y | AIR Object Type (Entity Name). Please refer to the referenced API documentation for each entity definition and structure |
| operationType | string | Y | Operation type on mentioned above Entity (CREATE/UPDATE/DELETE)(enum) |
| objectValue | object | Y | A JSON representation of AIR Entity, after processing this API call (see referenced endpoint documentation for details) |
Atomic Operation Types
- CREATE
- UPDATE
- DELETE
Object Types
The following is a list of available entities that could be used as items in the atomicOperations array.
Each entity's structure can be found in the response payloads for each documented API in the reference section of this portal, and further schema details for each are accessible directly from the .yaml files available in the API Specifications guide.
| Object Types |
|---|
| campaignEntity |
| planEntity |
| schemeEntity |
| fundEntity |
| fundTransactionEntity |
| pointsRewardBankEntity |
| pointsRewardBankRewardEntity |
| pointsRewardBankWalletLinkEntity |
| supplierUnitEntity |
| tierMembershipEntity |
| tierMembershipTransactionEntity |
| walletAccountEntity |
| walletAccountTransactionEntity |
| walletConsumerEntity |
| walletEntity |
| walletIdentityEntity |
| walletInviteEntity |
| walletTransactionEntity |
Object Relationships
The relational structure of these object entities is shown below, and this structure should form the foundation of any downstream platform’s schema that consumes the events to replicate the data.
Example
{
"headers": {
"unitId": "6082",
"callerIp": "172.10.0.22",
"clientId": "TESTWalletClient1",
"eventDate": "2019-06-11T11:19:09.946511",
"eventName": "POSCONNECT.ACCOUNT.VERIFY",
"eesEventId": "425215af-1c81-4c64-8a22-6f6da92882b6",
"eesApiVersion": null,
"eesSubsystemId": "hercules.local",
"eesMasterEventId": "XP@AHRxL7vZ36DQ0exl-HwAAAAI",
"unitFriendlyName": "Test Wallet Unit",
"externalMessageId": null,
"eesEnvironmentType": "local",
"clientIdFriendlyName": "Test Wallet Unit"
},
"request": {
"body": "{\n \"walletId\": \"52031\",\n \"accountId\": \"16612034\"\n}",
"method": "POST",
"resource": "/connect/account/verify",
"contentType": "application/json",
"customHeaders": []
},
"response": {
"body": "{\"accountTransaction\":{\"accountTransactionId\":\"1887862\",\"parentAccountTransactionId\":\"\",\"accountId\":\"16612034\",\"account\":{\"accountId\":\"16612034\",\"walletId\":\"52031\",\"campaignId\":\"29774\",\"type\":\"ECOUPON\",\"clientType\":null,\"status\":\"ACTIVE\",\"state\":\"BASIC\",\"dates\":{\"start\":\"2019-06-11T11:18:54+01:00\",\"end\":\"2038-01-19T03:14:07+00:00\"},\"meta\":[],\"dateCreated\":\"2019-06-11T11:18:54+01:00\",\"lastUpdated\":\"2019-06-11T11:18:54+01:00\",\"overrides\":{\"offer\":{\"reward\":{\"discountValue\":\"15\"}}},\"balances\":{\"available\":0,\"refundable\":0},\"relationships\":[],\"enriched\":{\"qualifier\":null,\"reward\":{\"offerId\":\"17982\",\"offerName\":\"TestOffer\",\"posReference\":null},\"enrichmentType\":\"COUPON\",\"campaignName\":\"Test Campaign\",\"campaignReference\":\"TESTCampaign1234\"}},\"event\":\"VERIFY\",\"value\":0,\"source\":1,\"balancesBefore\":{\"available\":0,\"refundable\":0},\"balancesAfter\":{\"available\":0,\"refundable\":0},\"transactionDetails\":[],\"properties\":[],\"dateCreated\":\"2019-06-11T11:19:10+01:00\",\"lastUpdated\":\"2019-06-11T11:19:10+01:00\"},\"message\":{}}",
"code": 200,
"contentType": "application/json;charset=utf-8"
},
"atomicOperations": [
{
"objectType": "walletAccountTransactionEntity",
"objectValue": {
"event": "VERIFY",
"value": 0,
"source": 1,
"account": {
"meta": [],
"type": "ECOUPON",
"dates": {
"end": "2038-01-19T03:14:07+00:00",
"start": "2019-06-11T11:18:54+00:00"
},
"state": "BASIC",
"status": "ACTIVE",
"balances": {
"available": 0,
"refundable": 0
},
"walletId": "52031",
"accountId": "16612034",
"overrides": {
"offer": {
"reward": {
"discountValue": "15"
}
}
},
"campaignId": "29774",
"clientType": null,
"dateCreated": "2019-06-11T11:18:54+00:00",
"lastUpdated": "2019-06-11T11:18:54+00:00",
"relationships": []
},
"accountId": "16612034",
"properties": [],
"dateCreated": "2019-06-11T11:19:10+00:00",
"lastUpdated": "2019-06-11T11:19:10+00:00",
"balancesAfter": {
"available": 0,
"refundable": 0
},
"balancesBefore": {
"available": 0,
"refundable": 0
},
"transactionDetails": [],
"accountTransactionId": "1887862",
"parentAccountTransactionId": null
},
"operationType": "CREATE"
}
]
}Event Definitions
AIR can trigger Event Notifications as part of a number of the API's endpoints being called. These are all defined in our Event Definitions page.
Updated about 5 hours ago
