Event Data Structures

Event Structure

The JSON structure of each event is broken down into the following objects, with an example included.

AttributeTypeMandatoryDescription
headersObjectY(see headersObject)
requestObjectY(see requestObject)
responseObjectY(see responseObject)
atomicOperationsarray of ObjectsY(see atomicOperations)

Headers Object

AttributeTypeMandatoryDescription
eventNameStringYName of the triggered Event
eventDatestringYtimestamp (with microtime) when AIR received a request, that triggered this event (format: YYYY-MM-DDTHH:MM:SS.UUUUUU)(timestamp)
eesEnvironmentTypeStringYEnvironment type (LIVE, STAGING, UAT, QA, DEV, TEST, etc,)
eesSubsystemIdStringYThe ID of the Eagle Eye Subsystem allowing Eagle Eye to identify where this Notification was triggered
callerIPStringYThe IP address from which Request was made
unitIdStringYEagle Eye Unit Id used during authorisation (arisen from clientId used)
unitFriendlyNameStringYUnit Name
clientIdStringYClientId value used for a call that triggered this Event Notification
clientIdFriendlyNameStringYFriendly name of the API key used for Authentication
eesEventIdStringYEvent ID, unique within AIR
eesMasterEventIdStringYMaster Event ID allowing to "chain" Event Notifications, if there is no Master Event, this value will be equal to eesEventId
externalMessageIdStringYExternal System Message ID (if provided to our APIs)
eesAPIVersionStringYAIR API version

Request Object

AttributeTypeMandatoryDescription
resourcestringYAPI endpoint used by the calling application
methodstringYA HTTP method used for a resource above
bodystringYRequest 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.
contentTypestringYHTTP Content-Type used for an API call above (defaults to application/json)
customHeadersobjectYThis JSON object will consist custom headers present in Request above (please note header name has to follow this pattern: X-CUSTOM-*).

Response Object

AttributeTypeMandatoryDescription
codeInt32YHTTP status code returned by AIR to the calling application (documented in referenced document API endpoint documentation)
bodystringYHTTP 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.
contentTypestringYHTTP 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:

AttributeTypeMandatoryDescription
objectTypestringYAIR Object Type (Entity Name). Please refer to the referenced API documentation for each entity definition and structure
operationTypestringYOperation type on mentioned above Entity (CREATE/UPDATE/DELETE)(enum)
objectValueobjectYA 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.