AlmondTill/G3N API

TokenAccount

object type

A TokenAccount — **the ONE-per-GROUP token wallet / platform billing unit**. The wallet is a group-scoped singleton enforced by the tokenAccountSingleton uniq marker minted IN the create txn. **Wallet existence IS the metering arm**: no wallet ⇒ the group is unbilled (the dvlp posture); opening one arms the rater. balance = Σ TokenEntry amounts exactly, cached in the same transaction as every ledger append — signed. The auto-top-off block is config this slice (the firing engine + stored-method custody = the rater leg, deferral 5); its budget cap is a lazy month-keyed counter. Platform billing is USD-only. NOT searchable (platform-internal — never merchant search content). Template class A16_BILLING (platform billing ≠ floor work — owner/manager/assoc_mgr; hand-derived v23).

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 human-readable id, shaped like TA-… — stable for the record’s life.
typeString String!The kind of record — always TokenAccount here.
captionString String!The record’s display name — what people see it called.
statusString String!The record’s current state — one of active, inactive or doomed.
parentIdID ID!The parent org group; for a TokenAccount parentId === rootId.
rootIdID ID!The id of your organization group — every record of yours carries the same one.
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 id of the record’s current edit — send it back with a change so an edit made in the meantime is refused instead of overwritten.
refCaptionsRefCaption [RefCaption!]!The captions of the records this one refers to, composed for you — one row per referenced id; see RefCaption.
balanceInt Int!The cached token balance = Σ TokenEntry amounts exactly — signed. Never caller-writable — moves only with ledger appends.
lowBalanceThresholdIntThe low-balance warning threshold (tokens) — absent ⇒ the warning arm is unarmed (the eventDate optional-arm class). The warning ladder is events + readable state now.
dailyBurnThresholdKernelsIntThe daily-burn alert threshold in kernels/day. Absent ⇒ unarmed. Owner-set like lowBalanceThreshold; day rows over it read as breaches on the costs face.
autoTopOffAutoTopOffConfigThe auto-top-off block — absent ⇒ never fires. Config this slice; the firing engine + stored-method custody ride the rater leg. Cap reached ⇒ stop + warn.
autoTopOffMonthStringThe auto-top-off cap window's yyyy-mm month key — server-stamped at fire time.
autoTopOffSpentUsdCentsIntThe month's cumulative auto-top-off spend — server-stamped at fire; compared against the cap before each fire.
autoTopOffDayStringThe auto-top-off DAY window's yyyy-mm-dd key.
autoTopOffSpentDayUsdCentsIntThe DAY's cumulative auto-top-off spend.
autoTopOffPendingMethodStringWhich stored card the in-flight top-off charged — primary | backup.
autoTopOffPrimaryFailedDayStringThe UTC day the primary card last webhook-failed a top-off.
autoTopOffBackupFailedDayStringThe backup twin — both stamps reading today = the cards-failing emergency (nothing fires; the loud lane speaks each tick).
backupBillingMethodBillingMethodFactsThe backup method's readable facts. The charger's top-off falls back to it when the primary declines; stamped by attachTokenAccountBackupBillingMethod, removed whole by its detach.
burn7dKernelsIntComputed at read: the group's total kernel consumption over the last 7 UTC days, summed off the rater's total day lanes (the usageReport engine — exact integers). 0 on a quiet week; null only on the filtered listing lane (vitals ride the plain reads).
runwayDaysFloatComputed at read: the balance scaled to kernels (balance is whole internal tokens — ×1,000,000) ÷ the 7-day daily kernel burn — how many days the balance lasts at the current rate. Null when the burn is 0 (no rate exists to project) or on the filtered listing lane.
microTokenCarryIntThe sub-token usage accrual in µtokens, 0…999,999. Server-stamped — no face carries it; absent = 0. Read-exposed for transparency.
lowBalanceSinceStringWhen the current low-balance episode began. The readable half of the warning ladder — the at.billing.token_account.low_balance.v1 event is its evented twin.
billingMethodBillingMethodFactsThe stored off-session method's readable facts. Present ⟺ custody is armed (the charger's top-off + base-fee arms both require it); stamped by attachTokenAccountBillingMethod, removed whole by detach.
autoTopOffPendingPurchaseIdIDThe in-flight auto-top-off TokenPurchase. Absent = no fire in flight.
topOffCappedSinceStringWhen the current capped episode began. Absent/null = not capped.
baseFeePaidMonthStringThe latest UTC yyyy-mm period the base fee settled for. Absent = never collected.
includedMonthStringThe live included-allowance month, UTC yyyy-mm. Server-stamped by the base-fee settle; absent/null = no allowance ever minted, or the plain-read vitals lane was skipped (the burn7dKernels listing-lane class).
includedGrantedIntWhat the live allowance month minted. Present ⟺ includedMonth is.
includedRemainingIntWhat the live allowance month has NOT yet drawn. The banked balance = balance − this figure while the month lives. Present ⟺ includedMonth is.
affiliateCreditCentsIntYour group’s spendable referral-earnings credit: Σ your AffiliateAccrual entries exactly. When it covers your monthly base fee the cycle credit-settles automatically (no card charge — bill-netting first, the ruled settlement order). Absent/null = never earned a cent, or the filtered listing lane (the burn7dKernels class).
frozenKernelsIntΣ kernels in transfer-FROZEN blocks: your true spendable room = balance − this figure (the exhaustion gate reads it; the transfer face’s pre-submit warning derives from it). Absent/null = nothing frozen, or the filtered listing lane.
storageSnapshotDayStringThe latest UTC yyyy-mm-dd day a storage snapshot emitted for this wallet. Absent = never snapshotted.
currencyString String!Platform billing currency — 'USD' by law.

Used by