Skip to content

Overview

THG Connect Integration Platform utilises Event-based patterns for asynchronous integration to any available product, all changes to data, partnerships, etc. will trigger an event of varying types. These are designed to be consumed by both consumer and providers of a partnership through the use of subscriptions.

Structure

All events created within the platform will conform to a standard model, the model has a eventType and eventTypeVersion these define the schema used for metadata and data.

Example Event Payload:

{
"eventType": "Data_Changed_Event",
"eventTypeVersion": "0",
"metadata": {
"method": "create",
"owner": "mycompany",
"resourceUrl": "/mycompany/inventory/4f2929b5-2512-48da-be97-c362cc452dc8",
"entityId": "4f2929b5-2512-48da-be97-c362cc452dc8",
"parentEntityId": "",
"entityType": "inventory",
"entityTypeVersion": "0",
"product": "thg-fulfil",
"createdAt": "1724321803.378458",
"consumer": "*",
"provider": "mycompany",
"reference": "thg:inventory:mycompany@4f2929b5-2512-48da-be97-c362cc452dc8"
},
"data": {
"sku": "948598f49",
"title": "Demo Title",
"defaultCountryOfOrigin": "GB",
"harmonizedSystemCode": "23498395893",
"hazmatCode": "00",
"barcode": {
"type": "ean",
"barcode": "123456789"
},
"dimensions": {
"height": 1.2,
"width": 1.3,
"depth": 1.4,
"mass": 1.5
},
"batchControlled": true
}
}

The above example is of a Data Changed Event, in the data section is the payload of the data object being changed, in the example its Inventory entity from THG Fulfil Product. Then within the metadata is any platform data associated to the event/entity.

Common Event Types