Skip to content

Data Changed Event

Data changed events are triggered when any modifying operation is carried out on an entity. This is the most common event an integration to the THG Connect platform will be required to handle, this will allow workflows to be triggered on entities being created, updated or deleted.

Example

{
"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
}
}

Breakdown

Metadata

KEYDESCRIPTION
methodThis is the operation carried out on the entity to trigger the data changed event, e.g. create, update, delete
ownerThe organisation who owns the data, this is the base of the URL when accessing the entity
entityIdUnique ID of the entity
parentEntityIdIf the entity has a parent then it’ll be referenced here
entityTypeThe entity type the data conforms to
entityTypeVersionVersion of the entity type the data conforms to
productProduct the entity is under, e.g. Inventory in an entity under THG Fulfil product
createdAtThis is the created datetime of the entity (NOT created time of the event)
consumerList of consumer organisation (within your partnership) who can access the entity. * represents any
providerList of providers organisations (within your partnership) who can access the entity. * represents any
referenceThis is URI for the entity the data changed event is for, this can be used in ReferenceStr types to reference the entity

Data

This is the payload of the entity after the operation was carried out. The payload will conform to the entity type and version defined in the metadata.