# TokenPurchase

object type

A TokenPurchase — buying platform tokens with real money (\*\*Stripe primary\*\*; ACH/wire/invoiced = deferral 7): $ → tokens at the volume tier (tier_1 | tier_2 | tier_3 — SERVER-computed, never client-asserted), loaded into the GROUP's TokenAccount as a purchase TokenEntry when the webhook settles. \*\*AT/stack charging the MERCHANT\*\* — the platform account's OWN PaymentIntent (distinct from the merchant's customer Payments and the Connect plane). \*\*NON-REFUNDABLE\*\*. The FSM is the ratified 3-STATE table VERBATIM: created(i) → succeeded ▣ / failed ✦, BOTH edges system:stripe_webhook — NO caller transitions and NOTHING mutable between birth and settlement ⇒ the wire realizes {create:true, update:false, transitions:false} (a NEW suppression combination — the webhook-settled document). The birth op mints the TEST PaymentIntent api-side with the LOAD-BEARING metadata {at_kind, tokenPurchaseId, rootId} (ruling — the lesson: PI metadata IS the join key; the EXISTING platform 8-event endpoint roster covers the lane — payment_intent.succeeded/payment_failed/canceled; canceled settles failed). The real-money gate = classification × Stripe MODE (ruling: live-mode charges require a production-classified group; test-mode is legal for ANY classification — that is how the goldens run; the mode derives from the custodied key, never asserted). Purchase-abandon reconciliation beyond canceled = deferral 14a. NOT searchable. Template class A16_BILLING (hand-derived v23).

## Fields

| Field | Type | Notes |
| --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
| `sysId` | [String](/types/#scalars) `String!` | The group-scoped human-facing system id (TP-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `TokenPurchase` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `String!` | The FSM state: created \| succeeded \| failed. |
| `parentId` | [ID](/types/#scalars) `ID!` | The parent TokenAccount; rootId = the org group; parentId!== rootId always. |
| `rootId` | [ID](/types/#scalars) `ID!` | The org-group family root. |
| `createdAt` | [String](/types/#scalars) `String!` | When the record was created, as a UTC timestamp. |
| `updatedAt` | [String](/types/#scalars) `String!` | When the record last changed, as a UTC timestamp. |
| `revisionNum` | [Int](/types/#scalars) `Int!` | How many times this record has been edited; the first save is 0. |
| `revision` | [ID](/types/#scalars) `ID!` | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
| `refCaptions` | [RefCaption](/types/RefCaption/) `[RefCaption!]!` | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
| `usdAmountCents` | [Int](/types/#scalars) `Int!` | The charge magnitude, USD cents (platform billing is USD). 500..10000000. |
| `tokensPurchased` | [Int](/types/#scalars) `Int!` | The SERVER-computed token load at the volume tier. |
| `volumeTierCode` | [String](/types/#scalars) `String!` | tier_1 \| tier_2 \| tier_3 — the tier that priced it (replayability with rateCardVersion). |
| `rateCardVersion` | [Int](/types/#scalars) `Int!` | The rate-card/tier config version in force at birth. |
| `stripePaymentIntentId` | [String](/types/#scalars) `String!` | The platform Stripe PaymentIntent (pi_… — SERVER-stamped at birth; the webhook join key, ruling). |
| `settledAt` | [String](/types/#scalars) | When the webhook settled it (stamped at succeeded/failed; absent while created). |

## Used by

- [createTokenPurchase](/reference/token-purchase/createTokenPurchase/)
- [purchaseTokensNow](/reference/billing-and-the-wallet/purchaseTokensNow/)
- [tokenPurchase](/reference/token-purchase/tokenPurchase/)
