EventsDelete an event

Delete an Event

curl -X DELETE "https://connect.wholechain.com/Integration/Events/commissioning_123ABC" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: example_string" \
  -H "accept: text/plain"
{
  "message": "Event id commissioning_123ABC deleted successfully",
  "result": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "externalEventId": "commissioning_123ABC",
      "type": "Event",
      "status": "Deleted",
      "eventDate": "",
      "productInstances": [],
      "containers": [],
      "directShipFallback": null,
      "externalShipmentFailure": null,
      "documentsNotAttached": null
    }
  ],
  "locations": [],
  "products": [],
  "errors": [],
  "validations": []
}
DELETE
/Integration/Events/{eventId}
DELETE
Base URLstring

Target server for requests. Edit to use your own host.

path
eventIdstring
Required

Identifier of the event to remove.

header
X-API-KEYstring
Required

Your Wholechain API key.

header
acceptstring
Required

Response content type.

Options: text/plain
Request Preview
Response

Response will appear here after sending the request

Responses

Event removed.

Introduction

To delete a Wholechain event from your traceability history, call the Remove Event endpoint and provide:

  • The Event ID of the event you want to remove (the same eventId you used when you originally ran the event)
  • Your API key (for authentication)

Removing an event deletes that event record so you can re-run it with corrected values if needed.


Key rule: you can only remove an event that no later event depends on

If other events used the inventory created or moved by this event, delete those dependent events first (most recent first), then delete this event.


Required inputs

InputWhere it goesExample
EVENT_IDURL path parametercommissioning_123ABC
API keyRequest header (X-API-KEY)your-api-key-here

Request example

{
  "method": "DELETE",
  "url": "https://connect.wholechain.com/Integration/Events/{EVENT ID}",
  "headers": {
    "accept": "text/plain",
    "X-API-KEY": "{API KEY}"
  }
}

Example: remove a commission event

If you created and ran a commission event with the Event ID commissioning_123ABC, remove it by calling the Remove Event endpoint with that eventId.

DELETE https://connect.wholechain.com/Integration/Events/commissioning_123ABC
X-API-KEY: YOUR_API_KEY

Example: fix a mistake in the middle of a chain (remove in reverse order)

Imagine you ran these events in order: 1. receive (older) 2. transform (mistake here) 3. ship (most recent)

You cannot remove the transform event because the ship event depends on it — the ship used inventory created or moved by the transform. That means you must: 1. Remove the ship event first (it depends on the transform) 2. Then remove the transform event 3. Re-run the corrected transform event 4. Re-run the ship event

Step 1 — remove the ship event

If the ship event ID is ship_ABC123:

DELETE https://connect.wholechain.com/Integration/Events/ship_ABC123
X-API-KEY: YOUR_API_KEY

Step 2 — remove the transform event

If the transform event ID is transform_ABC456

DELETE https://connect.wholechain.com/Integration/Events/transform_ABC456
X-API-KEY: YOUR_API_KEY

Step 3 — re-run your corrected events

After the incorrect event is removed, re-run

  • the corrected transform using transform_ABC456 (or your chosen eventId) with the correct values
  • then re-run ship using ship_ABC123 (or your chosen eventId) with the correct values

⸻

Responses

200 — Event removed

{"message":"Event id commissioning_123ABC deleted successfully","result":[{"id":"00000000-0000-0000-0000-000000000000","externalEventId":"commissioning_123ABC","type":"Event","status":"Deleted","eventDate":"","productInstances":[],"containers":[],"directShipFallback":null,"externalShipmentFailure":null,"documentsNotAttached":null}],"locations":[],"products":[],"errors":[],"validations":[]}

409 — Event has subsequent events and cannot be deleted

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.10",
  "title": "Event has subsequent events and cannot be deleted.",
  "status": 409,
  "traceId": "…"
}

404 — Event not found

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.5",
  "title": "Event not found: <eventId>",
  "status": 404,
  "traceId": "…"
}

Important note: removing an event affects all lots in that event

Events in Wholechain are atomic. If you want to correct one specific lot within an event, you must remove the entire event.

This means:

  • You cannot remove, edit, update, or delete an individual lot within an event.
  • When an event is removed, all lots that were created or manipulated in that event are also removed.
  • Any changes made to other lots in the same event—such as quantity updates, splits, merges, or transformations—will be fully rolled back.

What this means in practice

If an event included multiple lot operations (for example, creating several lots, transforming multiple inputs, or adjusting quantities across lots), and you only need to correct one of those lots:

  • You must remove the entire event.
  • All lots affected by that event will be reverted as if the event never occurred.
  • You must then re-run the event with all correct values, including:
  • the corrected lot data, and
  • any other lot manipulations that were originally part of that event.

Example scenario

If a transform event:

  • created Lot A,
  • updated Lot B, and
  • incorrectly adjusted Lot C,

you cannot remove or fix only Lot C. Removing the transform event will also remove the creation of Lot A and the update to Lot B. You will need to re-run the transform event with all intended lot changes correctly defined.

This behavior ensures data integrity and preserves a consistent, auditable traceability chain.