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.
| Field | Type | Notes |
|---|---|---|
id | integer | Stockaj internal id |
product_id | integer | Reference to the product template |
kind | enum | SERIAL, LOT, SSCC, BULK |
epc | string | Pure Identity URI |
serial | string | For SERIAL (GS1 AI 21) |
lot | string | For LOT (GS1 AI 10) |
produced_at | date | AI 11 |
expires_at | date | AI 17 |
best_before_at | date | AI 15 |
current_location_id | integer | Projection — read-only via API |
current_disposition | string | CBV disposition URI — projection |
current_owning_party_id | integer | Projection |
current_qty | number | For BULK only |
ilmd | object | Per-instance master data (matches product's ilmd_schema) |
EPC formats by kind
| Kind | EPC URI |
|---|---|
SERIAL | urn:epc:id:sgtin:<gcp>.<itemref>.<serial> |
LOT | urn:epc:idpat:sgtin:<gcp>.<itemref>.* + lot field |
SSCC | urn: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.