Product Tracebacks
Product Traceback. A traceback is the process of retrieving all the traceability data for a specific product, including all the traceability data for its child or input products. Within EPCIS, a prodβ¦
Product Traceback
A traceback is the process of retrieving all the traceability data for a specific product, including all the traceability data for its child or input products.
Within EPCIS, a product traceback is not a single query for events, but rather a recursive process that involves querying for the events relevant to a specific product, analyzing the results, querying for additional data as necessary
- Query for the target product's events
- Review the event results
- If Transformation or Aggregation events are found, repeat the traceback for the child or input products on the transformation and aggregation events
- Merge the results of all the events queries into a single EPCIS Query Document
Example
Product Information
Property | Value |
GTIN | urn:gdst:example.org:product:class:example_company_prefix.output |
Lot | A1234 |
EPC | urn:gdst:example.org:product:lot:class:example_company_prefix.output.A1234 |
System Information
Property | Value |
Resolver URL | https://resolver.example.org/ |
Step 1 - Query the Digital Link Resolver
To start the traceback, we first must retrieve the EPCIS URL for the product.
https://resolver.example.org/01/urn:gdst:example.org:product:class:example_company_prefix.output/10/B456
The above request should return a response with the following format:
{
"@context": "https://gs1.org/voc/context.jsonld",
"links": [
{
"rel": "gs1:epcis",
"href": "https://epcis.example.org/service/epcis/2.0/events",
"type": "application/json"
},
{
"rel": "gs1:masterData",
"href": "https://epcis.example.org/masterdata/products/urn:gdst:example.org:product:class:example_company_prefix.output"
}
]
}
Why this step?
EPCIS systems are decentralized. Every system hosts its own EPCIS Query Interface at an endpoint that is appropriate for its own use case. Only the Digital Link Resolver is standardized to provide a consistent endpoint to enable other systems to discover the endpoint for the EPCIS Query Interface.
Step 2 - Query the EPCIS Query Interface for the Target Product
Now that we have the EPCIS Query Interface URL, we can query for all the event data for the related product.
https://epcis.example.org/service/epcis/2.0/events?match_anyEPCClass=urn:gdst:example.org:product:lot:class:example_company_prefix.output.B456
This will return an EPCIS Query Document in JSON-LD format
{
"@context": "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld",
"type": "EPCISDocument",
"schemaVersion": "2.0",
"creationDate": "2025-06-30T10:00:00Z",
"epcisBody": {
"eventList": [
{
"type": "TransformationEvent",
"eventTime": "2025-06-25T08:30:00Z",
"eventTimeZoneOffset": "+00:00",
"inputEPCList": [
"urn:gdst:example.org:product:lot:class:example_company_prefix.input.A123"
],
"outputEPCList": [
"urn:gdst:example.org:product:lot:class:example_company_prefix.output.B456"
],
"bizStep": "commissioning",
"disposition": "in_progress",
"readPoint": "urn:epc:id:sgln:9521111.00001.0",
"bizLocation": "urn:epc:id:sgln:9521111.00001.0"
},
{
"type": "ObjectEvent",
"eventTime": "2025-06-28T12:00:00Z",
"eventTimeZoneOffset": "+00:00",
"epcList": [
"urn:gdst:example.org:product:lot:class:example_company_prefix.output.B456"
],
"action": "OBSERVE",
"bizStep": "shipping",
"disposition": "in_transit",
"readPoint": "urn:epc:id:sgln:9521111.00002.0",
"bizLocation": "urn:epc:id:sgln:9521111.00002.0"
}
]
}
}
Step 3 - Query the EPCIS Query Interface for the Input Product
https://epcis.example.org/service/epcis/2.0/events?match_anyEPCClass=urn:gdst:example.org:product:lot:class:example_company_prefix.input.A123
This will return all the events for the input product.
{
"@context": "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld",
"type": "EPCISDocument",
"schemaVersion": "2.0",
"creationDate": "2025-06-30T10:00:00Z",
"epcisBody": {
"eventList": [
{
"type": "ObjectEvent",
"eventTime": "2025-05-01T12:00:00Z",
"eventTimeZoneOffset": "+00:00",
"epcList": [
"urn:gdst:example.org:product:lot:class:example_company_prefix.input.A123"
],
"action": "OBSERVE",
"bizStep": "shipping",
"disposition": "in_transit",
"readPoint": "urn:epc:id:sgln:9521111.00002.0",
"bizLocation": "urn:epc:id:sgln:9521111.00002.0"
}
]
}
}
Step 4 - Merge the Event Data into a Single EPCIS Query Document
{
"@context": "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld",
"type": "EPCISDocument",
"schemaVersion": "2.0",
"creationDate": "2025-06-30T10:00:00Z",
"epcisBody": {
"eventList": [
{
"type": "TransformationEvent",
"eventTime": "2025-06-25T08:30:00Z",
"eventTimeZoneOffset": "+00:00",
"inputEPCList": [
"urn:gdst:example.org:product:lot:class:example_company_prefix.input.A123"
],
"outputEPCList": [
"urn:gdst:example.org:product:lot:class:example_company_prefix.output.B456"
],
"bizStep": "commissioning",
"disposition": "in_progress",
"readPoint": "urn:epc:id:sgln:9521111.00001.0",
"bizLocation": "urn:epc:id:sgln:9521111.00001.0"
},
{
"type": "ObjectEvent",
"eventTime": "2025-06-28T12:00:00Z",
"eventTimeZoneOffset": "+00:00",
"epcList": [
"urn:gdst:example.org:product:lot:class:example_company_prefix.output.B456"
],
"action": "OBSERVE",
"bizStep": "shipping",
"disposition": "in_transit",
"readPoint": "urn:epc:id:sgln:9521111.00002.0",
"bizLocation": "urn:epc:id:sgln:9521111.00002.0"
},
{
"type": "ObjectEvent",
"eventTime": "2025-05-01T12:00:00Z",
"eventTimeZoneOffset": "+00:00",
"epcList": [
"urn:gdst:example.org:product:lot:class:example_company_prefix.input.A123"
],
"action": "OBSERVE",
"bizStep": "shipping",
"disposition": "in_transit",
"readPoint": "urn:epc:id:sgln:9521111.00002.0",
"bizLocation": "urn:epc:id:sgln:9521111.00002.0"
}
]
}
}
How did we do?
Identifiers
Event-Based Traceability