attachTokenAccountBackupBillingMethod
mutation · in the family Billing and the wallet
What it does
Attach a BACKUP payment method — used automatically when the primary card declines a top-up.
Attach a backup off-session method to the caller-group's wallet. The charger's auto-top-off falls back to it when the primary declines (a fresh purchase per intent — never a double charge). Refuses without a primary (CONFLICT/REF_STATE — a backup exists only as its fallback) and over a standing backup. Requires the unrestricted capability. Template class A16_BILLING (the custody-pair class).
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:
- Owner
- Manager
- Associate Manager
- An API key whose scope allows
api:attachTokenAccountBackupBillingMethod
Careful
A second real card on file for platform billing.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | AttachTokenAccountBillingMethodInput AttachTokenAccountBillingMethodInput! | yes | Custody 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
mutation ExampleAttachTokenAccountBackupBillingMethod($input: AttachTokenAccountBillingMethodInput!) {
attachTokenAccountBackupBillingMethod(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:
{
"input": {
"methodRef": "<method ref>"
}
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"attachTokenAccountBackupBillingMethod": {
"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
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)