AlmondTill/G3N API

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

FieldTypeNotes
idID ID!The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it.
sysIdString String!The group-scoped human-facing system id (SV-…).
typeString String!The kind of record — always StoredValueInstrument here.
captionString String!The record’s display name — what people see it called.
statusString String!The FSM state: active | inactive | depleted | doomed.
parentIdID ID!The parent org group; for a StoredValueInstrument parentId === rootId (group-scoped — any org in the group redeems it).
rootIdID ID!The org-group family root.
createdAtString String!When the record was created, as a UTC timestamp.
updatedAtString String!When the record last changed, as a UTC timestamp.
revisionNumInt Int!How many times this record has been edited; the first save is 0.
revisionID ID!The OCC revision token — supply it on every mutation of this record; rotates on every write.
refCaptionsRefCaption [RefCaption!]!The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption.
instrumentTypeStoredValueInstrumentType StoredValueInstrumentType!The canned type (SPEC_REGISTRY row 97) — IMMUTABLE at birth.
codeString 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.
reloadableBoolean Boolean!The reload law: true ⟺ a reloadable gift_card; FORCED false on certificate/credit (strict both ways).
balanceMinorInt 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).
currencyString String!The instrument currency — the issuing org default stamped at birth.
customerOrderCustomerThe inline customer binding.

Used by