Update an Event
Overrides an existing event using the complete documented Receive event payload.
curl -X POST "https://connect.wholechain.com/Integration/Events" \
-H "Content-Type: application/json" \
-H "X-API-KEY: example_string" \
-d '{
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "supplier_location_001",
"Details": {
"TradePartner": {
"Id": "supplier_001",
"Name": "Supplier Name",
"ConnectionType": "SUPPLIER",
"Duns": "123456789"
},
"Name": "Supplier Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"ContactInformation": {
"Name": "Supplier Contact",
"Phone": "+1234567890",
"Email": "supplier@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Supplier Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [
{
"Quantity": 190.75,
"LotSerial": "lot_001",
"Product": {
"Id": "product_001",
"Details": {
"ProductIdentifierType": "Lot",
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"SharingPolicy": "Open",
"UnitDescriptor": "Cases",
"UnitQuantity": 10.5,
"Gtin": "12345678912343",
"Plu": "4001",
"MasterData": [
{
"name": "Gear Type",
"namespace": "custom",
"value": "GEAR TYPE_VALUE"
}
]
}
}
}
],
"Id": "receive_lot_001",
"ShipEventId": "ship_lot_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
}'
import requests
import json
url = "https://connect.wholechain.com/Integration/Events"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "example_string"
}
data = {
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "supplier_location_001",
"Details": {
"TradePartner": {
"Id": "supplier_001",
"Name": "Supplier Name",
"ConnectionType": "SUPPLIER",
"Duns": "123456789"
},
"Name": "Supplier Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"ContactInformation": {
"Name": "Supplier Contact",
"Phone": "+1234567890",
"Email": "supplier@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Supplier Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [
{
"Quantity": 190.75,
"LotSerial": "lot_001",
"Product": {
"Id": "product_001",
"Details": {
"ProductIdentifierType": "Lot",
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"SharingPolicy": "Open",
"UnitDescriptor": "Cases",
"UnitQuantity": 10.5,
"Gtin": "12345678912343",
"Plu": "4001",
"MasterData": [
{
"name": "Gear Type",
"namespace": "custom",
"value": "GEAR TYPE_VALUE"
}
]
}
}
}
],
"Id": "receive_lot_001",
"ShipEventId": "ship_lot_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://connect.wholechain.com/Integration/Events", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "example_string"
},
body: JSON.stringify({
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "supplier_location_001",
"Details": {
"TradePartner": {
"Id": "supplier_001",
"Name": "Supplier Name",
"ConnectionType": "SUPPLIER",
"Duns": "123456789"
},
"Name": "Supplier Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"ContactInformation": {
"Name": "Supplier Contact",
"Phone": "+1234567890",
"Email": "supplier@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Supplier Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [
{
"Quantity": 190.75,
"LotSerial": "lot_001",
"Product": {
"Id": "product_001",
"Details": {
"ProductIdentifierType": "Lot",
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"SharingPolicy": "Open",
"UnitDescriptor": "Cases",
"UnitQuantity": 10.5,
"Gtin": "12345678912343",
"Plu": "4001",
"MasterData": [
{
"name": "Gear Type",
"namespace": "custom",
"value": "GEAR TYPE_VALUE"
}
]
}
}
}
],
"Id": "receive_lot_001",
"ShipEventId": "ship_lot_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "supplier_location_001",
"Details": {
"TradePartner": {
"Id": "supplier_001",
"Name": "Supplier Name",
"ConnectionType": "SUPPLIER",
"Duns": "123456789"
},
"Name": "Supplier Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"ContactInformation": {
"Name": "Supplier Contact",
"Phone": "+1234567890",
"Email": "supplier@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Supplier Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [
{
"Quantity": 190.75,
"LotSerial": "lot_001",
"Product": {
"Id": "product_001",
"Details": {
"ProductIdentifierType": "Lot",
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"SharingPolicy": "Open",
"UnitDescriptor": "Cases",
"UnitQuantity": 10.5,
"Gtin": "12345678912343",
"Plu": "4001",
"MasterData": [
{
"name": "Gear Type",
"namespace": "custom",
"value": "GEAR TYPE_VALUE"
}
]
}
}
}
],
"Id": "receive_lot_001",
"ShipEventId": "ship_lot_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
}`)
req, err := http.NewRequest("POST", "https://connect.wholechain.com/Integration/Events", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-KEY", "example_string")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://connect.wholechain.com/Integration/Events')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-KEY'] = 'example_string'
request.body = '{
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "supplier_location_001",
"Details": {
"TradePartner": {
"Id": "supplier_001",
"Name": "Supplier Name",
"ConnectionType": "SUPPLIER",
"Duns": "123456789"
},
"Name": "Supplier Location",
"Gln": "9506000140445",
"Extension": "SomeExtension",
"ContactInformation": {
"Name": "Supplier Contact",
"Phone": "+1234567890",
"Email": "supplier@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "123 Supplier Street",
"AddressLine2": "Building 2",
"PostalCode": "8001",
"GeoCoordinates": {
"Latitude": -33.9249,
"Longitude": 18.4241
}
}
}
},
"ShipToLocation": {
"Id": "warehouse_001",
"Details": {
"TradePartner": {
"Id": "my_company",
"Name": "My Company",
"ConnectionType": "SELF",
"Duns": "987654321"
},
"Name": "Main Warehouse",
"Gln": "9506000140446",
"Extension": "WarehouseExtension",
"DunsPlus4": "1234",
"ContactInformation": {
"Name": "Warehouse Contact",
"Phone": "+1234567891",
"Email": "warehouse@example.com"
},
"Address": {
"City": "Cape Town",
"State": "Western Cape",
"Country": "South Africa",
"AddressLine1": "456 Warehouse Road",
"AddressLine2": "Building 2",
"PostalCode": "8002",
"GeoCoordinates": {
"Latitude": -33.925,
"Longitude": 18.425
}
}
}
},
"ProductInstances": [
{
"Quantity": 190.75,
"LotSerial": "lot_001",
"Product": {
"Id": "product_001",
"Details": {
"ProductIdentifierType": "Lot",
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"SharingPolicy": "Open",
"UnitDescriptor": "Cases",
"UnitQuantity": 10.5,
"Gtin": "12345678912343",
"Plu": "4001",
"MasterData": [
{
"name": "Gear Type",
"namespace": "custom",
"value": "GEAR TYPE_VALUE"
}
]
}
}
}
],
"Id": "receive_lot_001",
"ShipEventId": "ship_lot_001",
"PurchaseOrder": "PO-12345",
"InvoiceNumber": "INV-12345",
"EventTime": "2024-03-30T18:00:00",
"EventTimeZone": "-05:00",
"CustomProperties": [
{
"Name": "quality_grade",
"Namespace": "custom",
"Value": "A"
}
],
"CertificationList": [
{
"Type": "urn:gdst:certType:harvestCoC",
"Standard": "MSC Chain of Custody",
"Agency": "MSC",
"Value": "YES",
"Identification": "MSC-C-12345"
}
]
}
]
}'
response = http.request(request)
puts response.body
{
"message": "Events processed successfully",
"result": [
{
"id": "01a0d877-7871-79a5-a8c8-a2f45673633d",
"externalEventId": "receive_lot_001",
"type": "Receive",
"status": "Overridden",
"eventDate": "2024-03-30T18:00:00+00:00",
"productInstances": [
{
"quantity": 190.75,
"lotSerial": "lot_001",
"status": "Overridden",
"id": "01a0d877-7871-7426-b365-3a587ad4f893",
"name": "Raw Goods",
"urn": "urn:gdst:wholechain.com:product:lot:class:raindropsolutions.rawgoods-1.lot_001"
}
],
"containers": [],
"directShipFallback": null,
"externalShipmentFailure": null
}
],
"locations": [
{
"id": "01a0d877-76de-7e96-ac8c-962a914952bf",
"status": "Created"
}
],
"products": [
{
"id": "01a0d877-7719-720e-8fd8-224e3fec0602",
"status": "Created"
}
],
"errors": [],
"validations": []
}
/Integration/Events
Target server for requests. Edit to use your own host.
The media type of the request body
API key used to authenticate the request.
Required. events.
Request Preview
Response
Response will appear here after sending the request
Responses
Optional. message.
Optional. result.
Optional. locations.
Optional. products.
Optional. errors.
Optional. validations.
Introduction
Wholechain allows events to be updated after they have been submitted through the API. This is done by resubmitting the original event payload with the same event ID and including a special flag in the payload that instructs Wholechain whether the event should be updated.
This mechanism ensures that integrations can correct or adjust previously submitted data while maintaining the integrity of the traceability chain.
Required Account Settings
Before events can be edited, the account must allow event overwriting.
Editing events requires:
- Blockchain to be disabled
- Event overwriting to be enabled
How to Configure This
- Navigate to Settings
- Select Account
- Toggle Enable Blockchain → OFF
- Toggle Event Overwriting → ON
Once these settings are configured, events can be updated through the API.
Important: Events that were originally created before blockchain was disabled cannot be edited.
Those events remain immutable because they were committed while blockchain was enabled.
How Event Updates Work
Updating an event is done by resending the entire event payload using the same eventId as the original event.
How Wholechain processes an update:
- The existing event is completely deleted
- The new payload replaces the previous event entirely
This means that Wholechain does not merge or append data to the existing event.
Important Implication
You must resend the full event payload, including all items and data you want associated with the event.
If certain fields or items are omitted in the new payload, they will not exist in the updated event.
Example Workflow
Original Event Submission
{
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "shipFrom_000"
},
"ShipToLocation": {
"Id": "shipTo_000"
},
"ProductInstances": [
{
"Quantity": 190.75,
"LotSerial": "123",
"Product": {
"Id": "raw_goods_000"
}
}
],
"Id": "0004",
"EventTime": "2024-03-30T16:00:00",
"EventTimeZone": "-05:00"
}
]
}
Updating the Event
To update the event, resend the payload with the same event Id and set updates to true.
In the example below, the lot number and product are changed.
{
"Events": [
{
"$type": "receive",
"ShipFromLocation": {
"Id": "shipFrom_000"
},
"ShipToLocation": {
"Id": "shipTo_000"
},
"ProductInstances": [
{
"Quantity": 190.75,
"LotSerial": "789",
"Product": {
"Id": "finished_goods_002"
}
}
],
"Id": "0004",
"EventTime": "2024-03-30T16:00:00",
"EventTimeZone": "-05:00",
}
]
}
In this case:
- The original event with Id
0004is deleted - The new event payload replaces it entirely
Constraints When Updating Events
Event updates are subject to traceability chain validation.
Wholechain will only allow an event to be updated if the change does not break subsequent events that reference it.
Example Scenario
A Receive Event records: - Lot 456 - Quantity: 50 lbs
A Ship Event later ships: - 30 lbs from Lot 456
Attempted Update
If you attempt to update the receive event to:
- Change the lot number, or
- Reduce the quantity below 30 lbs
the update will not be allowed.
Why?
Subsequent events (such as ship or transform events) depend on the original event.
If the original event were changed in a way that invalidates those references, the traceability chain would break.
Since the update process replaces the original event, those downstream references would effectively point to an event that no longer exists or no longer satisfies the requirements of the downstream event.
For this reason, Wholechain prevents updates that would invalidate downstream events.
However, if one tried to update the receive event to instead recieve 30 pounds, the system would allow this as the ship event can still run without problems.
Summary
- Updates require resending the full payload with the same
eventId. - Wholechain replaces the old event entirely, rather than merging data.
- Updates are only permitted if they do not invalidate subsequent events in the traceability chain.
This approach preserves both data correction flexibility and supply chain traceability integrity.