When EPCIS events are imported they are also converted to ttData. In ttData the focus is on the history of the EPCs, and it's better suited than event data for certain kinds of queries. In ttData an EPC is represented as a traceable entity, and will be referred to as an Entity throughout the documentation.

There are three classes of entities. Batch, which is used to represent a production, TradeUnit used to represent tradeable items, and Cluster, used to model aggregations.

Entities may have a type, specified in the TRD.

Resources

Use Accept-Language to get alternative localization of the label/description values found in the objects returned by a query.

GET /Object/{epc}

This endpoint is for returning details on a single EPC. It supports most of the parameters supported by the /Object end point, but because of the focus on a single EPC, they are largely irrelevant, and will not be described in detail here. See the /Object end point documtentation for details.

GET /Object

The object endpoint has two operations, GET and HEAD where GET provides a result of entity objects, and HEAD returns the number of objects in the result, not counting aggregations.

The query parameters can be put into two categories. Those that affects which entities will be returned, and those that affects which details will be included in the result set.


The parameters are

Parameter

Default

Description

epcs


Filter on the epc of an entity. Multiple epcs may be specified. Wildcards '*' may be used.

entityClass


Filter on entityClass. Legal values are "batch", "tradeunit" and "tradeunitcluster".

entityTypeIds


Return only the objects that have the specified TRD type.

GE_created


Limit the search on objects with created date after GE_created

LE_created                                  


Limit the search on objects with created date before LE_created

hasProperty_tt:[propertyName]


Used without a parameter value. Return entities that have the specific property set, regardless of value.

notHasProperty_tt:[propertyName]


Used without a prarameter value. Return entities that do not have the property set.

eqProperty_tt:[propertyName]


Filter the EPCs on property values. Includes only the entities where the specified property name is equal to the given value. If you have multiple eqProperty_tts with the same property name, they will always be combined using OR otherwise they are combined using the specified operatorType. Example: If you specify several eqProperty_tt with the same propertyName, e.g. eqProperty_tt:myProperty=a&eqProperty_tt:myProperty=b&eqProperty_tt:myProperty=c&operatorType=AND, then they will be concatenated using OR, no matter which operatorType did you specify (because AND wouldn't make any sense in such situation), otherwise (eqProperty_tt:myFirstProperty=a&eqProperty_tt:mySecondProperty=b&eqProperty_tt:myThirdProperty=c&operatorType=AND) operator specified by operatorType parameter is used.

neqProperty_tt:[propertyName]


The same as the parameter above, except that this filters on entities without a specific property value.

geProperty_tt:[propertyName]


Filter on entities with a specific property type with a value greater or equal to the specified value.

leProperty_tt:[propertyName]


Filter on entities with a specific property type with a value value lesser or equal to the specified value.

gtProperty_tt:[propertyName]


Filter on entities with a specific property type with a value value greater than the specified value.

ltProperty_tt:[propertyName]


Filter on entities with a specific property type with a value value lesser than the specified value.

matchAny


Takes a substring as an argument and will match against epcs and property values. If includeAggregated is true, matchAny will also filter on these. If the substring does not contain wildcards, a subtext search will be performed, or else the wildcard '*' will be used as is. This means that matchAny=*foo will be a prefix search, and matchAny=foo* will be a suffix search. The match will be case insensitive.

matchTypes


Used in conjunction with the matchAny parameter. If specified, this will limit the property types searched by the matchAny parameter. Example: if matchTypes is set to "articledescription" then other property types will be ignored when using matchAny. Note that multiple matchTypes parameters may by specified.

matchAny_EPCClass:[attrParam]


A family of parameter that will use pure identity patterns found in the EPCClass vocabulary for looking up EPCs. If this parameter is used, a MasterDataQuery will be run first, looking for the specified attribute and value. The vocabulary elements returned that are identity patterns will be used for matching objects.

If this parameter is used in conjunction with includeAggregated, objects will also be returned if the aggregated objects match the identity patterns.

Examples of legal attrParams:

  • matchAny_EPCClass:EQATTR_quality=supreme    Find objects belonging to the class that has the masterdata property "quality" that has the value "supreme".
  • matchAny_EPCClass:HASATTR=quality  Find objects belonging to the class that has the quality property.
  • matchAny_EPCClass:likeAttr_color=green  Find objects belonging to a class that has the masterdata property color and a value containing the string "green". In other words, this parameter uses substring matching.

Non identity pattern matching may also be performed. If the id of the vocabulary element start with urn:gtnet:idpat:non-schema:*-123-* the suffixed wildcard (*-123-*) will be used to match epcs.

matchAlternateIds


If set to true, the epcs parameters will be matched to alternateIds (external ids that has been exported to HUB). Objects that was matched to alternateId found in the epcs parameter will have the alternateId as an attribute for the object epc element. This parameter is enabled by default when calling with remoteNodeId parameter.

<object>
<epc alternateId="external-id">internal-id</epc>
<lastEventTime>2013-04-04T12:00:00+02:00</lastEventTime>
<lastPropertyTime>2013-04-04T12:00:00+02:00</lastPropertyTime>
</object>


hasOutgoing


If set to true, only return entities that have outgoing transformations. In the graphs, transformations are always viewed left to right. Outgoing transformations originate from the object you're looking at and therefore an outgoing transformation is a transformation where the entity appears on the left side. If set to false, return only entities that do not have any outgoing transformations.

hasIncoming


If set to true, only return entities that have incoming transformations. In the graphs, transformations are always viewed left to right. Incoming transformations are the ones where the object you're looking at is the destination and therefore an incoming transformation is a transformation where the entity appears on the right side. If set to false, return only entities that do not have any incoming transformations.

partialMatch


If true, the matching of the epcs parameters will be performed using substring matching.

includeAggregated


If true, return other entities that may have been inside the returned entities.

includeProperties


If specified, return the properties associated with the resulting entities. Individual property types may also be specified using this parameter.

<object>
-8<------
<!-- Property with TRD type. -->
<Supplier label="Name of Supplier" updated="2013-03-25T10:40:00.000+01:00">TraceTracker AS</Supplier>
<!-- Property with no TRD type. -->
<Surprise label="[Surprise]" updated="2013-03-25T10:40:00.000+01:00">none</Surprise>
-8<------
</object>

Use Accept-Language header to get alternative localization for the labels read from the TRD type. Default localization (English) will be used if the given Accept-Language locale is not defined in the TRD type.

includeTransformations


If true, the transformations of the returned entities will be included in the result set.

includeLinks


If true, the trade unit links of the returned entities will be included in the result set.

<links>
<Incoming eventTime="2013-02-25T13:27:42.188+01:00"
published="2013-02-25T13:32:23.211+01:00">
<Sender type="gan-id">0800000033000013</Sender>
</Incoming>
</links>

includeLinksConfirmTime


If true, the trade unit links returned will include the time when they was confirmed. The time will be included in a linkConfirmed attribute if the link is confirmed. This parameter will only affect the result when includeLinks parameter is true. Note: Client should always check the state of linkChecked attributes when reading the linkConfirmed. The absence of linkConfirmed attribute when linkChecked means the TIX was unable to resolved the confirm time, and the state of the link is unknown. The link is unconfirmed when linkChecked is true and no linckConfirmed attribute exist.

<links>
<Incoming eventTime="2013-02-25T13:27:42.188+01:00"
linkChecked="true" linkConfirmed="2013-02-26T09:27:42.188+01:00"
published="2013-02-25T13:32:23.211+01:00">
<Sender type="gan-id">0800000033000013</Sender>
</Incoming>
</links>

linkAlias


Filter the result to only contain objects that have a link and where the sender or receiver of the link is one of the values of this parameter. When combined with matchAny or matchAny_EPCClass the OR operator will be used when building the query.

isSent


Filter on entities that have been sent to GTNet.

hasSentTo


If true, returns object that are outgoing shipments. If false, returns objects that are not outgoing shipments. Special rules apply when combined with hasReceivedFrom. See details on hasReceivedFrom.

hasReceivedFrom


If true, returns object that are incoming shipments. If false, returns objects that are not incoming shipments.

If combined with hasSentTo, they will return all objects that are incoming or outgoing shipments. If hasSentTo is true and hasReceivedFrom is false, you may still get results with hasReceivedFrom=true but only those that also have hasSentTo=true.

If both are false, only objects that are not incoming shipments and not outgoing shipments will be returned.

GE_receiveTime


If set, return only those objects that are received at the specified time or later. This parameter implies hasReceivedFrom=true. Special rules apply when combined with GE/LE_sendTime. See hasReceivedFrom for details.

LE_receiveTime


If set, return only those objects that are received at the specified time or earlier. This parameter implies hasReceivedFrom=true. Special rules apply when combined with GE/LE_sendTime. See hasReceivedFrom for details.

GE_sendTime


If set, return only those objects that are sent at the specified time or later. This parameter implies hasSentTo=true. Special rules apply when combined with GE/LE_receiveTime. See hasReceivedFrom for details.

LE_sendTime


If set, return only those objects that are sent at the specified time or earlier. This parameter implies hasSentTo=true. Special rules apply when combined with GE/LE_receiveTime. See hasReceivedFrom for details.

GE_lastEventTime


If set, return only those object that are updated at the specified time or later.

LE_lastEventTime


If set, return only those object that are updated at the specified time or earlier.

remoteNodeId


If set, returns the details found in a remote node given the other parameters.

operatorType

OR

When providing property values for searching this parameter specifies the operator type. Legal values are "and" or "or".

orderBy


The field in the query to order by. Legal values are "epc", "created", "linkTime", "lastEventTime", "lastPropertyTime", "property_tt:[propertytype]" or "propertyEventTime_tt:[propertytype]". When ordering on a specific property value, only entities with that property value are returned.

"linkTime" must be combined with hasReceivedFrom=true and or hasSentTo=true

GE_result_time


If set, return the property log for the properties specified in the includeProperties parameter that was updated at the specified time or later. The property log will be sorted in ascending order. Can be combined with LE_result_time.

Example log for property 'geo_location' (?includeProperties=geo_location&GE_result_time=1970-01-01T01:00:00.000+01:00)
<gqi:GQIResult xmlns:gqi="http://www.tracetracker.com/gqiresult" >
<object>
<epc>asset</epc>
<label>Default entity</label>
<description>Default TradeUnit</description>
<created>2013-05-02T20:39:01.950+02:00</created>
<geo_location label="position" updated="2013-05-02T20:25:03.764+02:00">60.3325632,5.0526468</geo_location>
<geo_location label="position" updated="2013-05-02T20:25:06.892+02:00">60.332448,5.0527728</geo_location>
<geo_location label="position" updated="2013-05-02T20:25:07.022+02:00">60.332448,5.0527728</geo_location>
<geo_location label="position" updated="2013-05-02T20:25:09.020+02:00">60.3324096,5.0527744</geo_location>
<geo_location label="position" updated="2013-05-02T20:25:42.140+02:00">60.3325696,5.0525004</geo_location>
</object>
</gqi:GQIResult>


LE_result_time


If set, return the property log for the properties specified in the includeProperties parameter that was updated at the specified time or earlier. The property log will be sorted in ascending order. Can be combined with GE_result_time.

resolveMD


If true and combined with includeProperties then property values starting with "urn:" will result in an MDS query against the EPCClass vocabulary and a vocabulary matching the property value with the last element removed, looking for the element matching the property value.

Any masterdata found will be included as a property in an element named after the original property with an MD suffix.

Example response.
<gqi:GQIResult xmlns:gqi="http://www.tracetracker.com/gqiresult">
<object nodeId="0800000033000013">
<epc>TIX-2564</epc>
<entityClass>TradeUnit</entityClass>
<label>TradeUnit</label>
<description>TU</description>
<created>2013-03-25T10:40:00+01:00</created>
<Field label="[Field]" updated="2013-03-25T10:40:00.000+01:00">urn:tracetracker:0800002873:taco:Field:1</Field>
<FieldMD Description="Plastic green house 8x6m" farmId="urn:tracetracker:0800002873:taco:Farm:1" fieldSize="value" fieldType="urn:tracetracker:0800002873:taco:FieldType:1" geoLocation="value" name="Green house" perimiter="value" soilAnalysis="no" soilType="no" vocabulary="urn:tracetracker:0800002873:taco:Field"/>
<trdType label="TradeUnit" updated="2013-03-25T10:40:00.000+01:00">TU</trdType>
<Farm label="[Farm]" updated="2013-03-25T10:40:00.000+01:00">urn:tracetracker:0800002873:taco:Farm:106</Farm>
<FarmMD address="" city="" contactPerson="" cooperativeId="urn:tracetracker:0800002873:taco:Cooperative:1" country="Kenya" description="" email="123@abc.com" farmCertificate="urn:tracetracker:0800002873:taco:Certificate:2" legalStatus="urn:tracetracker:0800002873:taco:LegalStatus:4" mobile="" name="Test Farm" phone="" picture="" region="" vocabulary="urn:tracetracker:0800002873:taco:Farm" webAddress=""/>
<lastEventTime>2013-03-25T10:40:00+01:00</lastEventTime>
<lastPropertyTime>2013-03-25T10:40:00+01:00</lastPropertyTime>
</object>
</gqi:GQIResult>

includeMasterData


If true, product master data will be queried from the master data server (MDS) and include in the results. An example of the result of this query is

sample response
<gqi:GQIResult xmlns:gtnet-epcis="http://www.globaltraceability.net/schema/epcis" xmlns:epcisq="urn:epcglobal:epcis-query:xsd:1"xmlns:gqi="http://www.tracetracker.com/gqiresult" xmlns:epcismd="urn:epcglobal:epcis-masterdata:xsd:1" xmlns:epcis="urn:epcglobal:epcis:xsd:1"xmlns:sbdh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:ttdata="http://www.tracetracker.com/data">
<object nodeId="0800000015000019">
<epc>
urn:gtnet:id:gsii:0800002873.CropType-1.RedApple-5KilogramsCartons_2013-09-09094303
</epc>
<entityClass>TradeUnit</entityClass>
<readPoint label="[readPoint]" updated="2013-09-09T03:00:00.000+03:00">urn:gtnet:id:gsli:0800002873.Farm-275.Field-324</readPoint>
<bizLocation label="[bizLocation]" updated="2013-09-09T03:00:00.000+03:00">urn:gtnet:id:gsli:0800002873.Farm- 275</bizLocation>
<MasterData>
<VocabularyElement id="urn:gtnet:idpat:gsii:0800002873.CropType-1.*">
<attribute id="urn:tracetracker:asset:mda:asset_catname">Kappe og sveiseutstyr</attribute>
<attribute id="urn:tracetracker:asset:mda:asset_subcat">8361</attribute>
<attribute id="urn:tracetracker:asset:mda:asset_name">Sveiseomformer ARC 165E</attribute>
<attribute id="urn:tracetracker:asset:mda:asset_cat">83</attribute>
<attribute id="urn:tracetracker:asset:mda:inv_price">85</attribute>
<attribute id="urn:tracetracker:asset:mda:objtype">0</attribute>
</VocabularyElement>
</MasterData>
<lastEventTime>2013-09-09T03:00:00+03:00</lastEventTime>
<lastPropertyTime>2013-09-09T03:00:00+03:00</lastPropertyTime>
</object>
</gqi:GQIResult>

includeMetaData


If true, metadata will be included for any master data that may have been queried from the MDS. If "includeMasterData" is set to false, this parameter has no effect. Any ids present in the master data for an object will be attempted resolved against the GTNet Data Dictionary (GDD). This includes both ids for VocabularyElements as well as Attributes. The result from the GDD is included in a separate <MetaData> element on the top level of the document. The metadata is common to all objects in the result.

Example of result with master data and meta data.

Meta data example
<gqi:GQIResult xmlns:gtnet-epcis="http://www.globaltraceability.net/schema/epcis" xmlns:epcisq="urn:epcglobal:epcis-query:xsd:1"xmlns:gqi="http://www.tracetracker.com/gqiresult" xmlns:epcismd="urn:epcglobal:epcis-masterdata:xsd:1" xmlns:epcis="urn:epcglobal:epcis:xsd:1"xmlns:sbdh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:ttdata="http://www.tracetracker.com/data">
<object nodeId="0800000015000019">
<epc>
urn:gtnet:id:gsii:0800002873.CropType-1.RedApple-5KilogramsCartons_2013-09-09094303
</epc>
<entityClass>TradeUnit</entityClass>
<readPoint label="[readPoint]" updated="2013-09-09T03:00:00.000+03:00">urn:gtnet:id:gsli:0800002873.Farm-275.Field-324</readPoint>
<bizLocation label="[bizLocation]" updated="2013-09-09T03:00:00.000+03:00">urn:gtnet:id:gsli:0800002873.Farm- 275</bizLocation>
<MasterData>
<VocabularyElement id="urn:gtnet:idpat:gsii:0800002873.CropType-1.*">
<attribute id="urn:tracetracker:asset:mda:asset_catname">Kappe og sveiseutstyr</attribute>
<attribute id="urn:tracetracker:asset:mda:asset_subcat">8361</attribute>
<attribute id="urn:tracetracker:asset:mda:asset_name">Sveiseomformer ARC 165E</attribute>
<attribute id="urn:tracetracker:asset:mda:asset_cat">83</attribute>
<attribute id="urn:tracetracker:asset:mda:inv_price">85</attribute>
<attribute id="urn:tracetracker:asset:mda:objtype">0</attribute>
</VocabularyElement>
</MasterData>
<lastEventTime>2013-09-09T03:00:00+03:00</lastEventTime>
<lastPropertyTime>2013-09-09T03:00:00+03:00</lastPropertyTime>
</object>
<MetaData>
<VocabularyElement id="urn:tracetracker:asset:mda:asset_name">
<attribute id="dictionary:name">Asset Name</attribute>
<attribute id="dictionary:definition">The name of an asset.</attribute>
<attribute id="dictionary:subtype">CLASS</attribute>
</VocabularyElement>
</MetaData>
</gqi:GQIResult>

asc


Ordering will be ascending if true. Descending if false.

pageNumber

1

Specifies the page number to return. If not specified, the first page is returned.

pageSize

20

Specifies the number of entities to return in the result set.

Downstream Basic (DSB mode)

The object endpoints is limited to only support the following parameters when running in DSB mode. Use of any other object parameters will not affect the result. The object endpoints will only return objects that has been shipped by other parties and every object will include the nodeId for where the object was shipped from.

Parameter

Default

Description

epcs


Filter on the epc of an entity. Multiple epcs may be specified. Wildcards '*' may be used.

GE_created


Limit the search on objects with shipment created date after GE_created

LE_created


Limit the search on objects with shipment created date before LE_created

GE_sendTime


See GE_created, the time created and sent is always the same for an TIX operating in DSB mode. GE_sentTime overrides GE_created parameter.

LE_sendTime


See LE_created, the time created and sent is always the same for an TIX operating in DSB mode. LE_sendTime overrides LE_created parameter.

includeAggregated


If true, return other entities that may have been inside the returned entities.

includeLinks


If true, the trade unit links of the returned entities will be included in the result set.

includeProperties


If specified, return the properties associated with the resulting entities. Individual property types may also be specified using this parameter.

includeTransformations


If true, the transformations of the returned entities will be included in the result set.

pageNumber

1

Specifies the page number to return. If not specified, the first page is returned.

pageSize

20

Specifies the number of entities to return in the result set. The default value is 20.

Example result from object endpoint in DSB mode

<?xml version="1.0" encoding="UTF-8"?>
<gqi:GQIResult xmlns:gqi="http://www.tracetracker.com/gqiresult">
<object nodeId="0800001908000086">
<epc>urn:epc:id:sgtin:0614141.181335.234</epc>
<lastEventTime>2013-02-02T14:00:00+01:00</lastEventTime>
<lastPropertyTime>2013-02-02T14:00:00+01:00</lastPropertyTime>
</object>
</gqi:GQIResult>