Skip to main content

Instance

An Instance is a specific physical or logical thing Stockaj tracks: a serialized unit, a lot of consumables, a logistic unit (pallet), or a bulk bucket of untracked stock.

FieldTypeNotes
idintegerStockaj internal id
product_idintegerReference to the product template
kindenumSERIAL, LOT, SSCC, BULK
epcstringPure Identity URI
serialstringFor SERIAL (GS1 AI 21)
lotstringFor LOT (GS1 AI 10)
produced_atdateAI 11
expires_atdateAI 17
best_before_atdateAI 15
current_location_idintegerProjection — read-only via API
current_dispositionstringCBV disposition URI — projection
current_owning_party_idintegerProjection
current_qtynumberFor BULK only
ilmdobjectPer-instance master data (matches product's ilmd_schema)

EPC formats by kind

KindEPC URI
SERIALurn:epc:id:sgtin:<gcp>.<itemref>.<serial>
LOTurn:epc:idpat:sgtin:<gcp>.<itemref>.* + lot field
SSCCurn:epc:id:sscc:<gcp>.<extension>
BULK(no EPC; aggregated by (product, location) key)

Projections (read-only)

current_* fields are projections computed from the EPCIS event log. The API exposes them for fast reads, but they cannot be written directly — the only way to change an instance's state is to record a new event.