AlmondTill/G3N API

attachTokenAccountBillingMethod

mutation · in the family Billing and the wallet

What it does

Attach a payment method to your group’s kernel wallet — how top-ups get paid.

A wallet already carrying a method refuses CONFLICT/REF_STATE. Custody arms the charger's auto-top-off + base-fee lanes (the merchant consents to off-session charges by storing the method). Requires the unrestricted capability. Template class A16_BILLING (hand-derived v24).

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Billing and the wallet — Your platform bill, token purchases and the usage and cost reads.

Roles that may call it:

Careful

A real card on file for platform billing.

Arguments

NameTypeRequiredNotes
inputAttachTokenAccountBillingMethodInput AttachTokenAccountBillingMethodInput!yesCustody attach input.

Returns

TokenAccount TokenAccount! — 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).

Example request

graphql
mutation ExampleAttachTokenAccountBillingMethod($input: AttachTokenAccountBillingMethodInput!) {
  attachTokenAccountBillingMethod(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    balance
    lowBalanceThreshold
    dailyBurnThresholdKernels
    autoTopOffMonth
    autoTopOffSpentUsdCents
    autoTopOffDay
    autoTopOffSpentDayUsdCents
    autoTopOffPendingMethod
    autoTopOffPrimaryFailedDay
    autoTopOffBackupFailedDay
    burn7dKernels
    runwayDays
    microTokenCarry
    lowBalanceSince
    autoTopOffPendingPurchaseId
    topOffCappedSince
    baseFeePaidMonth
    includedMonth
    includedGranted
    includedRemaining
    affiliateCreditCents
    frozenKernels
    storageSnapshotDay
    currency
  }
}

Variables:

json
{
  "input": {
    "methodRef": "<method ref>"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "attachTokenAccountBillingMethod": {
      "id": "01900000-0000-7000-8000-b0839b1d0000",
      "sysId": "TA-EXMP-0000-000F",
      "type": "TokenAccount",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "balance": 1,
      "lowBalanceThreshold": 1,
      "dailyBurnThresholdKernels": 1,
      "autoTopOffMonth": "<auto top off month>",
      "autoTopOffSpentUsdCents": 1,
      "autoTopOffDay": "2027-01-31",
      "autoTopOffSpentDayUsdCents": 1,
      "autoTopOffPendingMethod": "<auto top off pending method>",
      "autoTopOffPrimaryFailedDay": "2027-01-31",
      "autoTopOffBackupFailedDay": "2027-01-31",
      "burn7dKernels": 1,
      "runwayDays": 1.5,
      "microTokenCarry": 1,
      "lowBalanceSince": "<low balance since>",
      "autoTopOffPendingPurchaseId": "01900000-0000-7000-8000-396e6d060000",
      "topOffCappedSince": "<top off capped since>",
      "baseFeePaidMonth": "<base fee paid month>",
      "includedMonth": "<included month>",
      "includedGranted": 1,
      "includedRemaining": 1,
      "affiliateCreditCents": 1,
      "frozenKernels": 1,
      "storageSnapshotDay": "2027-01-31",
      "currency": "USD"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in