Egress Message Format


Egress message schema

FieldTypeOptionalDescription
transactionIdStringNoUnique identifier for the transaction.
accountIdStringNoUnique identifier for the account.
userIdStringYesUnique identifier for the customer/user.
accountTypeStringNoThe account type. Permitted values: cash, card, savings, investment, loan, mortgage, pension.
txCodeStringNoThe transaction code. The code is defined by the provider to describe the transaction type.
dateStringNoThe date and time of the transaction in ISO 8601 format.
descriptionStringNoThe transaction description which is commonly a combination of the merchant name and merchant location.
amountNumberNoThe transaction amount in major units of the currency.
currencyStringNoThe currency of the transaction, e.g. GBP, EUR. Defaults to GBP.
statusStringYesThe status of the transaction: either pending or posted.
merchantCategoryCodeStringYesMCC code for the merchant's primary activities. A maximum 4 digit string.
metaObjectYesAdditional data for storage/pass-through.
mhInsightsObjectYesContains the insights from Moneyhub's Data Enrichment Engine. See mhInsights fields below.

mhInsights Fields

FieldTypeOptionalDescription
l1CategoryGroupIdStringNoThe level 1 category group to which the category belongs.
l1CategoryGroupNameStringNoThe name of the level 1 category group.
l1CategoryTypeStringNoThe type of the level 1 category group. One of: expense, income, investment, transfer, pension, transfer_savings, uncategorize.
l2CategoryIdStringNoThe ID of the level 2 category.
l2CategoryNameStringNoThe name of the level 2 category.
l3CounterpartyCounterpartyYesThe L3 counterparty of the transaction. See Counterparty Schema.
geotagsArray<Geotag>YesArray of geotags for the transaction. Geotags for up to 3 candidate locations where the transaction could have taken place are ordered from most likely to least likely. See Geotag Schema.
cardPresentBooleanYesIndicates if the cardholder was present when the transaction occurred. Note that, online purchases are considered card holder not present. Only card holder present transactions are eligible for geotagging. We estimate this field from the transaction data.
timestampCreatedStringYesTimestamp of when message containing the transaction was created on the Kafka raw ingest topic i.e. the topic that the Data Enrichment Engine retrieves messages from. For the API interface, this is effectively when the transaction was sent to the API.
timestampIngressStringYesTimestamp of when a transaction started being processed.
timestampEgressStringYesTimestamp set on transaction when processing has finished and it is about to be sent to the egress topic, and in the API case, sent back as the response.

Example

Based on the example ingress message.

{
  "transactionId": "123456",
  "accountId": "5382358854398",
  "userId": "5382358854398",
  "accountType": "cash",
  "txCode": ")))",
  "date": "1970-01-01T00:00:00Z",
  "description": "Tesco BriLL 293484 SS",
  "amount": -10.99,
  "currency": "GBP",
  "status": "posted",
  "merchantCategoryCode": "5411",
  "meta": {
    "sourceSystem": "hex",
    "authorisedBy": "PStibbons",
    "yearOfCreation": "Year of the Luminous Lemur"
  },
  "mhInsights": {
    "l1CategoryGroupId": "4",
    "l1CategoryGroupName": "shopping",
    "l1CategoryType": "expense",
    "l2CategoryId": "22",
    "l2CategoryName": "groceries",
    "l3Counterparty": {
      "l3CounterpartyId": "030a7556-e17d-432d-8afb-7a9f71128152",
      "l3CounterpartyName": "Tesco Express - Redcliffe, Bristol",
      "parentId": "b3e0c142-1377-4e7d-b434-37b64d34a008",
      "parentName": "Tesco Groceries",
      "fullCompanyName": "Tesco Stores Limited",
      "logoUrl": "examplelogo.com",
      "website": "example.com",
      "registeredLocation": null,
      "l2CategoryName": "groceries",
      "l3CounterpartyCategory": "convenience-shop",
      "l4LoanType": null
    },
    "geotags": [
      {
        "geotagId": "39828184-5334-4ec5-ba65-8985912542dc",
        "counterpartyName": "",
        "counterpartyLabel": "",
        "houseNumber": "",
        "street": "",
        "neighbourhood": "",
        "locality": "",
        "city": "",
        "county": "",
        "region": "",
        "postcode": "",
        "latitude": "",
        "longitude": "",
        "l3CounterpartyCategory": "",
        "postcodeEstimated": "",
        "postcodeErrorKm": ""
      },
      {
        "geotagId": "b4a9bf43-2b54-45d9-9bbd-a0aa1286e302",
        "counterpartyName": "",
        "counterpartyLabel": "",
        "houseNumber": "",
        "street": "",
        "neighbourhood": "",
        "locality": "",
        "city": "",
        "county": "",
        "region": "",
        "postcode": "",
        "latitude": "",
        "longitude": "",
        "l3CounterpartyCategory": "",
        "postcodeEstimated": "",
        "postcodeErrorKm": ""
      },
      {
        "geotagId": "669c42a7-632c-43e4-b9f8-7f2b9f797e5e",
        "counterpartyName": "",
        "counterpartyLabel": "",
        "houseNumber": "",
        "street": "",
        "neighbourhood": "",
        "locality": "",
        "city": "",
        "county": "",
        "region": "",
        "postcode": "",
        "latitude": "",
        "longitude": "",
        "l3CounterpartyCategory": "",
        "postcodeEstimated": "",
        "postcodeErrorKm": ""
      }
    ],
    "cardPresent": true,
    "timestampCreated": "1970-01-01T00:00:00Z",
    "timestampIngress": "1970-01-01T00:00:01Z",
    "timestampEgress": "1970-01-01T00:00:02Z"
  }
}