EPCIS Capture & Query Genealogy

EPCIS Capture + Query

Examples for capturing EPCIS events (with GS1 LGTIN and custom brand identifiers) and querying upstream genealogy.

Note: These examples use EPCIS 2.0 JSON-LD with the GS1 EPCIS context. Replace identifiers, timestamps, and business steps with values appropriate for your implementation.

Capture EPCIS event with LGTIN identifier

POST /api/v2/epcis/events

Capture an ObjectEvent using a GS1 LGTIN epcClass.

{
  "@context": [
    "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld"
  ],
  "type": "ObjectEvent",
  "action": "ADD",
  "eventTime": "2005-04-04T20:33:31.116-06:00",
  "eventTimeZoneOffset": "-06:00",
  "quantityList": [
    {
      "epcClass": "urn:epc:class:lgtin:1234567.304664.ABC123",
      "quantity": 50,
      "uom": "EA"
    }
  ],
  "bizStep": "creating_class_instance",
  "disposition": "active",
  "ilmd": {
    "cbvmda:lotNumber": "ABC123"
  }
}
Response Typical: 201 Created

Most EPCIS repositories return an acknowledgment (often with an event ID). Response format varies by implementation.

{
  "status": "created",
  "message": "Event captured successfully"
}

Capture EPCIS event with custom Brand identifier

POST /api/v2/epcis/events

Capture an ObjectEvent using a custom brand identifier in epcClass.

{
  "@context": [
    "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld"
  ],
  "type": "ObjectEvent",
  "action": "ADD",
  "eventTime": "2005-04-04T20:33:31.116-06:00",
  "eventTimeZoneOffset": "-06:00",
  "quantityList": [
    {
      "epcClass": "urn:brandX:productId:batchId:mat123.E2E1ASN9",
      "quantity": 1160,
      "uom": "GRM"
    }
  ],
  "bizStep": "creating_class_instance",
  "disposition": "active",
  "ilmd": {
    "cbvmda:lotNumber": "E2E1ASN9"
  }
}
Response Typical: 201 Created
{
  "status": "created",
  "message": "Event captured successfully"
}

Capture EPCIS TransformationEvent with input materials

POST /api/v2/epcis/events

Capture a TransformationEvent that links input materials to an output product batch.

{
  "@context": [
    "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld"
  ],
  "type": "TransformationEvent",
  "eventTime": "2005-04-05T20:33:31.116-06:00",
  "eventTimeZoneOffset": "-06:00",
  "inputQuantityList": [
    {
      "epcClass": "urn:brandX:productId:batchId:mat123.E2E1ASN9",
      "quantity": 200,
      "uom": "GRM"
    },
    {
      "epcClass": "urn:epc:class:lgtin:1234567.304664.ABC123",
      "quantity": 1,
      "uom": "EA"
    }
  ],
  "outputQuantityList": [
    {
      "epcClass": "urn:brandX:productId:batchId:FP123.FPABC123",
      "quantity": 10,
      "uom": "EA"
    }
  ],
  "bizStep": "creating_class_instance",
  "disposition": "active",
  "ilmd": {
    "cbvmda:lotNumber": "FPABC123"
  }
}
Response Typical: 201 Created
{
  "status": "created",
  "message": "Event captured successfully"
}

4) Query upstream genealogy

GET /api/v2/epcis/genealogy/graph/epc-classes/urn:brandX:productId:batchId:FP123.FPABC123?direction=UPSTREAM

Query the upstream genealogy graph for the output batch created in step 3.

GET /api/v2/epcis/genealogy/graph/epc-classes/urn:brandX:productId:batchId:FP123.FPABC123?direction=UPSTREAM
Response example 200 OK · nodes + edges
{
  "nodes": [
    {
      "type": "TransformationEvent",
      "eventTime": "2005-04-05T20:33:31.116-06:00",
      "eventTimeZoneOffset": "-06:00",
      "eventID": "ni:///sha-256;e9761ac0ed40ba3dc5a29a120b8049215f75a3d243105fb6b7fbccba301420b2?ver=CBV2.0",
      "inputQuantityList": [
        {
          "epcClass": "urn:brandX:productId:batchId:mat123.E2E1ASN9",
          "quantity": 200.0,
          "uom": "GRM"
        },
        {
          "epcClass": "urn:epc:class:lgtin:1234567.304664.ABC123",
          "quantity": 1.0,
          "uom": "EA"
        }
      ],
      "outputQuantityList": [
        {
          "epcClass": "urn:brandX:productId:batchId:FP123.FPABC123",
          "quantity": 10.0,
          "uom": "EA"
        }
      ],
      "bizStep": "creating_class_instance",
      "disposition": "active",
      "ilmd": {
        "cbvmda:lotNumber": "FPABC123"
      }
    },
    {
      "type": "ObjectEvent",
      "eventTime": "2005-04-04T20:33:31.116-06:00",
      "eventTimeZoneOffset": "-06:00",
      "eventID": "ni:///sha-256;9fecbca3a50398ece0dc26c7bb9f717c776e470d6ea80777b0bc09dd824cfc4d?ver=CBV2.0",
      "action": "ADD",
      "bizStep": "creating_class_instance",
      "disposition": "active",
      "quantityList": [
        {
          "epcClass": "urn:brandX:productId:batchId:mat123.E2E1ASN9",
          "quantity": 1160.0,
          "uom": "GRM"
        }
      ],
      "ilmd": {
        "cbvmda:lotNumber": "E2E1ASN9"
      }
    },
    {
      "type": "ObjectEvent",
      "eventTime": "2005-04-04T20:33:31.116-06:00",
      "eventTimeZoneOffset": "-06:00",
      "eventID": "ni:///sha-256;f087529274dd01b5a14c934b868099f552497041cc0f2e4d661c1e777b4736e3?ver=CBV2.0",
      "action": "ADD",
      "bizStep": "creating_class_instance",
      "disposition": "active",
      "quantityList": [
        {
          "epcClass": "urn:epc:class:lgtin:1234567.304664.ABC123",
          "quantity": 50.0,
          "uom": "EA"
        }
      ],
      "ilmd": {
        "cbvmda:lotNumber": "ABC123"
      }
    }
  ],
  "edges": [
    {
      "source": "ni:///sha-256;e9761ac0ed40ba3dc5a29a120b8049215f75a3d243105fb6b7fbccba301420b2?ver=CBV2.0",
      "target": "ni:///sha-256;9fecbca3a50398ece0dc26c7bb9f717c776e470d6ea80777b0bc09dd824cfc4d?ver=CBV2.0",
      "type": "genealogy",
      "connection": "creating_class_instance",
      "time": "2005-04-04T20:33:31.116-06:00"
    },
    {
      "source": "ni:///sha-256;e9761ac0ed40ba3dc5a29a120b8049215f75a3d243105fb6b7fbccba301420b2?ver=CBV2.0",
      "target": "ni:///sha-256;f087529274dd01b5a14c934b868099f552497041cc0f2e4d661c1e777b4736e3?ver=CBV2.0",
      "type": "genealogy",
      "connection": "creating_class_instance",
      "time": "2005-04-04T20:33:31.116-06:00"
    }
  ]
}

Support

If you need help validating identifier formats, event payloads, or genealogy query behavior, contact support@eon.xyz.