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"
import requests
import json
url = "https://connect.wholechain.com/epcis/Events/details?LotSerial=1357&PurchaseOrder=PO-12345&PageNumber=1&PageSize=20&SortBy=example_string"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "example_string",
"accept": "text/plain"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://connect.wholechain.com/epcis/Events/details?LotSerial=1357&PurchaseOrder=PO-12345&PageNumber=1&PageSize=20&SortBy=example_string", {
method: "GET",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "example_string",
"accept": "text/plain"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://connect.wholechain.com/epcis/Events/details?LotSerial=1357&PurchaseOrder=PO-12345&PageNumber=1&PageSize=20&SortBy=example_string", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-KEY", "example_string")
req.Header.Set("accept", "text/plain")
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/epcis/Events/details?LotSerial=1357&PurchaseOrder=PO-12345&PageNumber=1&PageSize=20&SortBy=example_string')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-KEY'] = 'example_string'
request['accept'] = 'text/plain'
response = http.request(request)
puts response.body
{
"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"
}
]
}
"PageNumber and PageSize must be greater than 0."
/epcis/Events/details
Target server for requests. Edit to use your own host.
Optional lot serial number filter.
Optional purchase order number filter.
Default 1, minimum 1.
Default 20, minimum 1.
Sort order. eventDate = oldest first, -eventDate = newest first. Default (omitted) = newest first.
Your Wholechain API key.
Response content type.
Request Preview
Response
Response will appear here after sending the request
Responses
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
| Header | Type | Required | Description |
|---|---|---|---|
accept | String | Yes | Specifies the response format (e.g., text/plain). |
X-API-KEY | String | Yes | The user's API key used for authentication. |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
LotSerial | String | No | The serial number of the lot to query. |
PurchaseOrder | String | No | The purchase order number to filter the results. |
PageNumber | Integer | No | Page number for paginated results. Default 1, minimum 1. |
PageSize | Integer | No | Number of results per page. Default 20, minimum 1. |
SortBy | String | No | Sort 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.