StoredValueInstrument
object type
A StoredValueInstrument — a balance-bearing money instrument: gift_card (purchasable, reloadable-by-field, bearer) · gift_certificate (fixed-amount) · store_credit (refund/goodwill-born, customer-BOUND, never purchasable as a line). The FSM tracks USABILITY; the StoredValueEntry ledger tracks VALUE — balanceMinor is the cached ledger sum, stamped in the SAME transaction as every entry (the / law), with every decrement CONDITIONED (never negative — CONFLICT/INSUFFICIENT_BALANCE). Dual-birth: immediate active (the issue entry rides the create) or STAGED inactive printed stock (activated at sale via the Order line arm, or directly via activateStoredValueInstrument). Selling/reloading one is an Order LINE (untaxed — basis instrument_sale; engine-invisible); redeeming one is an applyTender step-5 internal tender; store credit from a return mints via refundReturn method=store_credit. Doom is gated by CONFLICT/BALANCE_OUTSTANDING while value remains (zero via reason-coded adjust FIRST — no silent money destruction).
Fields
| Field | Type | Notes |
|---|---|---|
id | ID ID! | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
sysId | String String! | The group-scoped human-facing system id (SV-…). |
type | String String! | The kind of record — always StoredValueInstrument here. |
caption | String String! | The record’s display name — what people see it called. |
status | String String! | The FSM state: active | inactive | depleted | doomed. |
parentId | ID ID! | The parent org group; for a StoredValueInstrument parentId === rootId (group-scoped — any org in the group redeems it). |
rootId | ID ID! | The org-group family root. |
createdAt | String String! | When the record was created, as a UTC timestamp. |
updatedAt | String String! | When the record last changed, as a UTC timestamp. |
revisionNum | Int Int! | How many times this record has been edited; the first save is 0. |
revision | ID ID! | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
refCaptions | RefCaption [RefCaption!]! | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
instrumentType | StoredValueInstrumentType StoredValueInstrumentType! | The canned type (SPEC_REGISTRY row 97) — IMMUTABLE at birth. |
code | String String! | The NORMALIZED code (trim+UPPERCASE; A–Z/0–9 start then A–Z/0–9/_/-, 4..64 — a money key needs collision room) — IMMUTABLE at birth; BURNED at doom. |
reloadable | Boolean Boolean! | The reload law: true ⟺ a reloadable gift_card; FORCED false on certificate/credit (strict both ways). |
balanceMinor | Int Int! | The CACHED ledger sum (minor units) — stamped in the SAME transaction as every StoredValueEntry; NEVER negative; NEVER directly editable (adjust/redeem/reload are the only balance surfaces). |
currency | String String! | The instrument currency — the issuing org default stamped at birth. |
customer | OrderCustomer | The inline customer binding. |