EventsRetrieve Event Details

Retrieve Event Details

LotSerial and PurchaseOrder are optional filters. You may provide either filter, both filters, or neither filter.

curl -X GET "https://connect.wholechain.com/epcis/Events/details?LotSerial=1357&PurchaseOrder=PO-12345&PageNumber=1&PageSize=20&SortBy=example_string" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: example_string" \
  -H "accept: text/plain"
{
  "totalPages": 1,
  "pageNumber": 1,
  "pageSize": 20,
  "totalItems": 1,
  "results": [
    {
      "id": "0408989b-dc15-4bef-ab85-6591acef657e",
      "eventId": "562feb29-4cf8-4f5a-99c4-00028e89d35f",
      "eventType": "Ship",
      "productName": "Hake",
      "lotSerial": "1357",
      "quantity": 1000,
      "locationName": "Front Loading Dock",
      "companyName": "Oceana Group Ltd",
      "eventDate": "2024-09-25T15:35:52+00:00"
    }
  ]
}
GET
/epcis/Events/details
GET
Base URLstring

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

query
LotSerialstring

Optional lot serial number filter.

query
PurchaseOrderstring

Optional purchase order number filter.

query
PageNumberinteger

Default 1, minimum 1.

Min: 1
query
PageSizeinteger

Default 20, minimum 1.

Min: 1
query
SortBystring

Sort order. eventDate = oldest first, -eventDate = newest first. Default (omitted) = newest first.

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

totalPagesinteger
Required
pageNumberinteger
Required
pageSizeinteger
Required
totalItemsinteger
Required
resultsarray
Required

Introduction

The EPCIS Event Details API allows users to query event information associated with a specific lot or purchase order. Users can view event details related to commissioning, observing, transformation, shipping, and receiving activities within their company. After an external shipment event or a transform event, the user can no longer access event data related to the lot, unless they use the new lot number assigned after a transformation event.

This API supports querying based on:

• Lot Serial Number
• Purchase Order Number

Limitations

  • A user can see all event details for a given lot that took place within their company up to and including an external shipment or a transformation event.
  • Once an external shipment leaves the company, the user cannot access event details for that lot beyond the external shipment.
  • When a transform event occurs, the lot number changes. The new lot number must be used for future queries.

Authentication

The API uses an API key (X-API-KEY) to authenticate requests. Each user has a unique API key that controls access to event details tied to their company. To understand where this can be found, please visit the Authentication page.

Request Headers

HeaderTypeRequiredDescription
acceptStringYesSpecifies the response format (e.g., text/plain).
X-API-KEYStringYesThe user's API key used for authentication.

Request Parameters

ParameterTypeRequiredDescription
LotSerialStringNoThe serial number of the lot to query.
PurchaseOrderStringNoThe purchase order number to filter the results.
PageNumberIntegerNoPage number for paginated results. Default 1, minimum 1.
PageSizeIntegerNoNumber of results per page. Default 20, minimum 1.
SortByStringNoSort order. eventDate = oldest first, -eventDate = newest first. Default (omitted) = newest first.

If PageNumber or PageSize is less than 1, the API returns HTTP 400 with the plain JSON string "PageNumber and PageSize must be greater than 0.".

//example response
{
  "totalPages": 1,
  "pageNumber": 1,
  "pageSize": 20,
  "totalItems": 2,
  "results": [
    {
      "id": "0408989b-dc15-4bef-ab85-6591acef657e",
      "eventId": "562feb29-4cf8-4f5a-99c4-00028e89d35f",
      "eventType": "Ship",
      "productName": "Hake",
      "lotSerial": "1357",
      "quantity": 1000,
      "locationName": "Front Loading Dock",
      "companyName": "Oceana Group Ltd",
      "eventDate": "2024-09-25T15:35:52+00:00"
    },
    {
      "id": "0e6a9845-396c-4d1b-a570-b91b11548359",
      "eventId": "3d1d0d0a-2ba5-4846-adef-4551227ca993",
      "eventType": "Commission",
      "productName": "Hake",
      "lotSerial": "1357",
      "quantity": 1000,
      "locationName": "Oceana House",
      "companyName": "Oceana Group Ltd",
      "eventDate": "2024-09-25T15:34:38+00:00"
    }
  ]
}

Each result also contains additional fields (for example productId, externalIdentifier, unitOfMeasure, businessStep, purchaseOrder, invoiceNumber, shipFrom…/shipTo… location and trade-partner fields, tlcSource, certifications, masterData, productMasterData). The example shows the most commonly used fields.