Billing types
Type definitions referenced by Billing queries and mutations.
AppSubscription
Section titled “AppSubscription”Object. A third-party app-store subscription mirrored from the developers service. Active rows add an APP line to the org’s monthly invoice; paid APP lines are reported back to developers as partner revenue (minus the platform fee).
| Field | Type | Description |
|---|---|---|
uuid |
ID! |
— |
installUuid |
ID! |
— |
appKey |
String! |
— |
appName |
String! |
— |
planKey |
String! |
— |
planName |
String! |
— |
priceMonthMinor |
Int! |
Monthly price snapshot in integer minor units. |
currency |
String! |
— |
status |
String! |
One of: active, canceled. |
startedAt |
String! |
— |
canceledAt |
String |
— |
AutoRechargeInput
Section titled “AutoRechargeInput”Input object.
| Field | Type | Description |
|---|---|---|
enabled |
Boolean! |
— |
threshold_minor |
Int! |
Fire auto-recharge once the balance drops below this (minor units). |
amount_minor |
Int! |
How much to buy per auto-recharge (minor units). |
BillingStatus
Section titled “BillingStatus”Object. Whether an organization is billed (see the billingStatus query). Only the suite operator org is exempt.
| Field | Type | Description |
|---|---|---|
organization_id |
ID! |
— |
suite_operator |
Boolean! |
True for the suite operator org (GistLink’s own account). |
billed |
Boolean! |
False = never billed: no plan charges, invoices, card payments or credit charges. |
message |
String |
Short English explanation when not billed (clients translate their own copy); null otherwise. |
Boolean
Section titled “Boolean”Scalar. The Boolean scalar type represents true or false.
ConsumeCreditsInput
Section titled “ConsumeCreditsInput”Input object.
| Field | Type | Description |
|---|---|---|
amount_minor |
Int! |
Credits to debit, in minor units (already marked up by the caller). |
idempotency_key |
String! |
Caller-generated unique key; redeliveries with the same key are no-ops. |
description |
String |
Human-readable description, e.g. “Claude Sonnet 4.5 · 1,240 tokens”. |
source |
String |
Reporting-source tag, e.g. “agentworkforce”. |
metadata |
JSON |
Free-form audit metadata (model, tokens, raw cost, markup …). |
ConsumeCreditsResult
Section titled “ConsumeCreditsResult”Object. Result of consumeCredits.
| Field | Type | Description |
|---|---|---|
allowed |
Boolean! |
False = the caller is out of credits and must hard-stop. |
balance |
Money! |
Wallet balance after the debit (and any auto-recharge). |
charged |
Money! |
Credits actually debited for this report. |
recharged |
Boolean! |
True when this consume triggered a successful auto-recharge top-up. |
CreditBalance
Section titled “CreditBalance”Object. Lightweight balance view for the cross-service hard-stop check.
| Field | Type | Description |
|---|---|---|
organization_id |
ID! |
— |
balance |
Money! |
— |
has_credits |
Boolean! |
False = the product app must stop billable AI work (out of credits). |
auto_recharge_enabled |
Boolean! |
— |
CreditPurchaseResult
Section titled “CreditPurchaseResult”Object. Result of purchaseCredits: the updated wallet, the raised top-up invoice, and the charge outcome.
| Field | Type | Description |
|---|---|---|
wallet |
CreditWallet! |
— |
invoice |
Invoice |
The credit-category invoice raised for this top-up (null only if no card was on file). |
status |
String! |
One of: paid (credited now), pending (awaiting 3-D Secure), failed (declined). |
CreditTransaction
Section titled “CreditTransaction”Object. One movement on the prepaid-credit ledger.
| Field | Type | Description |
|---|---|---|
uuid |
String! |
— |
type |
String! |
One of: purchase, auto_recharge, consumption, adjustment, refund. |
amount |
Money! |
Signed: positive = credited, negative = debited. |
balance_after |
Money! |
Wallet balance immediately after this movement. |
description |
String! |
— |
source |
String |
— |
invoice_number |
String |
Linked top-up invoice number for purchase/auto_recharge rows. |
invoice_uuid |
String |
— |
created_at |
String! |
— |
CreditWallet
Section titled “CreditWallet”Object. An organization’s prepaid AI-credit wallet. Credits are money paid to GistLink up front; product apps spend them down as they report metered AI usage, and work hard-stops once they run out. All amounts are Money (integer minor units + currency).
| Field | Type | Description |
|---|---|---|
uuid |
String! |
— |
organization_id |
ID! |
— |
balance |
Money! |
Current spendable balance. |
has_credits |
Boolean! |
True while balance > 0. |
auto_recharge_enabled |
Boolean! |
— |
auto_recharge_threshold |
Money! |
Auto-recharge fires once the balance drops below this. |
auto_recharge_amount |
Money! |
How much is bought per auto-recharge. |
auto_recharge_failed_at |
String |
Set when the last auto-recharge attempt failed (declined/no card); null otherwise. |
lifetime_purchased |
Money! |
Lifetime credits ever purchased. |
lifetime_consumed |
Money! |
Lifetime credits ever consumed. |
recent_transactions |
[CreditTransaction!]! |
Newest-first recent ledger movements (up to 20). |
created_at |
String! |
— |
updated_at |
String! |
— |
EntitlementResult
Section titled “EntitlementResult”Object.
| Field | Type | Description |
|---|---|---|
organization_id |
ID! |
— |
plan_key |
String! |
The resolved plan’s key (the org’s own plan, or “free” as the fallback). |
entitlement_keys |
[String!]! |
Empty while gated (full lockout). |
status |
String! |
One of: trialing, active, past_due, suspended (gated), “none” (free-plan fallback), or operator (the never-billed suite operator org: never gated, entitlement_keys = the union across all active plans, plan_key = its own plan or else the highest-priced active plan). |
gated |
Boolean! |
True while the org is locked out for non-payment; apps must block entirely. |
Scalar. The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
Scalar. The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
Invoice
Section titled “Invoice”Object. One of: draft, open, paid, void.
| Field | Type | Description |
|---|---|---|
uuid |
String! |
— |
number |
String! |
— |
status |
String! |
— |
category |
String! |
Which billing rail raised this invoice: “subscription” (monthly close) or “credit” (AI-credit top-up). |
amount |
Money! |
— |
line_items |
[InvoiceLine!]! |
Typed line items (BASE / SEATS / USAGE) — the invoice’s service breakdown. |
lines |
JSON! |
Legacy free-form lines (JSON); superseded by line_items. |
period_start |
String |
— |
period_end |
String |
— |
due_at |
String |
— |
paid_at |
String |
— |
created_at |
String! |
— |
updated_at |
String! |
— |
InvoiceConnection
Section titled “InvoiceConnection”Object.
| Field | Type | Description |
|---|---|---|
edges |
[InvoiceEdge!]! |
— |
pageInfo |
PageInfo! |
— |
totalCount |
Int! |
— |
InvoiceEdge
Section titled “InvoiceEdge”Object.
| Field | Type | Description |
|---|---|---|
node |
Invoice! |
— |
cursor |
String! |
— |
InvoiceLine
Section titled “InvoiceLine”Object.
| Field | Type | Description |
|---|---|---|
uuid |
String! |
— |
kind |
InvoiceLineKind! |
— |
app_key |
String! |
Product app the charge belongs to (“suite” for BASE/SEATS). |
meter_key |
String |
Meter key snapshot for USAGE lines. |
description |
String! |
— |
quantity |
Int! |
— |
unit_price |
Money! |
— |
per_quantity |
Int! |
— |
amount |
Money! |
— |
InvoiceLineKind
Section titled “InvoiceLineKind”Enum. BASE = plan base price, SEATS = extra seats, USAGE = metered overage.
| Value | Description |
|---|---|
BASE |
— |
SEATS |
— |
USAGE |
— |
TRIAL |
Negative credit line zeroing an invoice fully covered by the 30-day free trial. |
APP |
A third-party app-store subscription charge (revenue-shared with the partner). |
CREDIT |
A prepaid AI-credit top-up (manual purchase or auto-recharge). |
Scalar. Arbitrary JSON value (objects, arrays, scalars). Serialized as-is.
LimitBehavior
Section titled “LimitBehavior”Enum. What happens at the limit: BLOCK (checkLimit refuses the action) or OVERAGE (allowed and billed).
| Value | Description |
|---|---|
BLOCK |
— |
OVERAGE |
— |
LimitCheck
Section titled “LimitCheck”Object.
| Field | Type | Description |
|---|---|---|
meter_key |
String! |
— |
used |
Int! |
Aggregated usage in the current period. |
included |
Int! |
Included in the plan’s base price. |
limit |
Int |
Effective hard ceiling (null = uncapped). |
remaining |
Int |
Units left before the ceiling (null = uncapped). |
allowed |
Boolean! |
False = the app must refuse the billable action. |
behavior |
LimitBehavior |
BLOCK or OVERAGE; null when the plan has no config for this meter (unlimited) or the org is gated. |
MeterAggregation
Section titled “MeterAggregation”Enum. How a meter’s UsageRecords aggregate over a period: SUM (events) or MAX (gauges like storage).
| Value | Description |
|---|---|
SUM |
— |
MAX |
— |
Object. Integer minor units alongside a 3-letter ISO 4217 currency code. Never a float.
| Field | Type | Description |
|---|---|---|
amount_minor |
Int! |
— |
currency |
String! |
— |
PageInfo
Section titled “PageInfo”Object.
| Field | Type | Description |
|---|---|---|
hasNextPage |
Boolean! |
— |
hasPreviousPage |
Boolean! |
— |
startCursor |
String |
— |
endCursor |
String |
— |
PaymentAttempt
Section titled “PaymentAttempt”Object. One of: pending, succeeded, failed.
| Field | Type | Description |
|---|---|---|
uuid |
String! |
— |
status |
String! |
— |
psp_ref |
String |
— |
failure_reason |
String |
— |
created_at |
String! |
— |
PaymentMethodCard
Section titled “PaymentMethodCard”Object. Display-only card snapshot — never raw card data.
| Field | Type | Description |
|---|---|---|
brand |
String |
— |
last4 |
String |
— |
exp_month |
Int |
— |
exp_year |
Int |
— |
PaymentMethodSetup
Section titled “PaymentMethodSetup”Object. Everything the billing frontend needs to render an embedded card form.
| Field | Type | Description |
|---|---|---|
setup_ref |
String! |
Charge-rail setup reference — pass back to completePaymentMethodSetup. |
client_secret |
String! |
PSP client secret for the embedded payment element. |
publishable_key |
String! |
Browser-safe PSP key (e.g. Stripe publishable key). |
provider |
String! |
Processor code, e.g. stripe. |
PeriodEstimate
Section titled “PeriodEstimate”Object.
| Field | Type | Description |
|---|---|---|
period_start |
String! |
— |
period_end |
String! |
— |
days_elapsed |
Int! |
— |
days_total |
Int! |
— |
plan_key |
String! |
— |
plan_name |
String! |
— |
base |
Money! |
The plan’s monthly base charge. |
seats |
SeatCharge! |
Seat charges at the period’s high-watermark. |
services |
[ServiceEstimate!]! |
Per-app usage breakdown (one entry per product app with configured meters). |
total |
Money! |
Month-to-date accrued total (base + seats + usage). |
forecast_total |
Money! |
Linear month-end forecast: fixed charges + usage extrapolated across the period. |
billed |
Boolean! |
False for the never-billed suite operator org: every amount is zero, usage quantities are still shown. |
Object.
| Field | Type | Description |
|---|---|---|
key |
String! |
Stable identifier, e.g. “free”, “starter”, “pro”, “business”. Used as the GraphQL ID. |
name |
String! |
— |
description |
String |
— |
price_month |
Money! |
— |
price_year |
Money! |
— |
seat_price_month |
Money! |
Price per seat per month beyond included_seats. |
included_seats |
Int! |
Seats covered by the base price. |
machine_api_rate_per_minute |
Int! |
Org-wide machine (IAM/service) API budget, GraphQL requests per minute. Always finite. |
user_api_rate_per_minute |
Int! |
Human API budget contributed by EACH seat, requests per minute (org total = rate × seats). |
meter_configs |
[PlanMeterConfig!]! |
Per-meter usage pricing/limits. Meters absent here are unlimited + free. |
features |
JSON! |
Arbitrary display/feature metadata (marketing copy, limits, …). |
entitlement_keys |
[String!]! |
Entitlement keys this plan grants, e.g. [“support.standard”, “teams.standard”]. |
active |
Boolean! |
— |
is_custom |
Boolean! |
Custom (enterprise) plans are configured per deal by a super admin and cannot be self-served through selectPlan — they are assigned via assignPlan after a sales conversation. |
created_at |
String! |
— |
updated_at |
String! |
— |
PlanInput
Section titled “PlanInput”Input object.
| Field | Type | Description |
|---|---|---|
key |
String |
Required on createPlan (the new plan’s stable key); ignored on updatePlan. |
name |
String! |
— |
description |
String |
— |
price_month_minor |
Int! |
— |
price_year_minor |
Int! |
— |
currency |
String! |
— |
seat_price_month_minor |
Int |
— |
included_seats |
Int |
— |
machine_api_rate_per_minute |
Int |
Org-wide machine API budget, requests/minute. Must be a positive integer — no unlimited plans. |
user_api_rate_per_minute |
Int |
Per-seat human API budget, requests/minute. Must be a positive integer — no unlimited plans. |
features |
JSON |
— |
entitlement_keys |
[String!] |
— |
active |
Boolean |
— |
is_custom |
Boolean |
— |
PlanMeterConfig
Section titled “PlanMeterConfig”Object.
| Field | Type | Description |
|---|---|---|
meter |
UsageMeter! |
— |
included_quantity |
Int! |
Quantity included in the plan’s base price each period. |
unit_price |
Money! |
Price per per_quantity units beyond included (e.g. 10¢ per 1000 emails). |
per_quantity |
Int! |
— |
limit_quantity |
Int |
Optional hard cap. BLOCK: cap defaults to included_quantity; OVERAGE: null = uncapped. |
limit_behavior |
LimitBehavior! |
— |
PlanMeterConfigInput
Section titled “PlanMeterConfigInput”Input object.
| Field | Type | Description |
|---|---|---|
included_quantity |
Int! |
— |
unit_price_minor |
Int! |
— |
per_quantity |
Int |
— |
limit_quantity |
Int |
— |
limit_behavior |
LimitBehavior! |
— |
RateLimitResult
Section titled “RateLimitResult”Object. Resolved API rate-limit budgets for one organization (see the rateLimits query). Budgets are suite-wide per-organization requests/minute; auth multiplies user_per_minute_per_seat by the org’s live seat count (identity and memberships live in auth, not billing).
| Field | Type | Description |
|---|---|---|
organization_id |
ID! |
— |
plan_key |
String! |
— |
machine_per_minute |
Int! |
Org-wide machine (IAM/service) budget, override-resolved. Always finite. |
user_per_minute_per_seat |
Int! |
Human budget contributed by each seat (from the plan). |
human_total_per_minute_override |
Int |
Absolute enterprise override of the org’s TOTAL human budget; null = per-seat × seats. |
RecordUsageInput
Section titled “RecordUsageInput”Input object.
| Field | Type | Description |
|---|---|---|
meter_key |
String! |
Meter key, e.g. “mail.emails_sent”. |
quantity |
Int! |
Units consumed (negative quantities are corrections). |
idempotency_key |
String! |
Caller-generated unique key; redeliveries with the same key are no-ops. |
occurred_at |
String |
When the usage occurred (ISO-8601). Defaults to now. |
source |
String |
Optional reporting-source tag for audit, e.g. “mail-api”. |
RecordUsageResult
Section titled “RecordUsageResult”Object.
| Field | Type | Description |
|---|---|---|
created |
Boolean! |
False when the idempotency key had already been recorded (no double-bill). |
meter_key |
String! |
— |
quantity |
Int! |
— |
organization_id |
ID! |
— |
RefundCreditsInput
Section titled “RefundCreditsInput”Input object.
| Field | Type | Description |
|---|---|---|
idempotency_key |
String! |
The idempotency_key of the ORIGINAL consumeCredits call being reversed. |
amount_minor |
Int |
Partial refund in minor units; omit to refund everything still unrefunded. |
reason |
String |
Human-readable reason recorded on the ledger row. |
refund_key |
String |
Only for a SECOND+ partial refund of the same consumption: a distinct caller key per refund. Omit for the usual single refund. |
RefundCreditsResult
Section titled “RefundCreditsResult”Object. Result of refundCredits.
| Field | Type | Description |
|---|---|---|
refunded |
Money! |
Credits returned to the wallet by this refund. |
balance |
Money! |
Wallet balance after the refund. |
SeatCharge
Section titled “SeatCharge”Object.
| Field | Type | Description |
|---|---|---|
count |
Int! |
Seat high-watermark observed this period. |
included |
Int! |
— |
billable |
Int! |
max(0, count - included). |
unit_price |
Money! |
— |
amount |
Money! |
— |
ServiceEstimate
Section titled “ServiceEstimate”Object.
| Field | Type | Description |
|---|---|---|
app_key |
String! |
Product app key, e.g. “mail”. |
amount |
Money! |
This app’s month-to-date usage charges. |
lines |
[UsageLine!]! |
— |
String
Section titled “String”Scalar. The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
SyncAppSubscriptionInput
Section titled “SyncAppSubscriptionInput”Input object. Service-only (developers): app install projection for invoicing.
| Field | Type | Description |
|---|---|---|
installUuid |
ID! |
— |
organizationId |
ID! |
Paying customer organization. |
appKey |
String! |
— |
appName |
String! |
— |
planKey |
String! |
— |
planName |
String! |
— |
priceMonthMinor |
Int! |
— |
currency |
String! |
— |
partnerOrganizationId |
ID! |
Partner (developer) organization earning the revenue share. |
UsageLine
Section titled “UsageLine”Object.
| Field | Type | Description |
|---|---|---|
meter_key |
String! |
— |
meter_name |
String! |
— |
unit |
String! |
— |
quantity |
Int! |
Aggregated usage this period. |
included_quantity |
Int! |
— |
billable_quantity |
Int! |
max(0, quantity - included) for OVERAGE meters; 0 for BLOCK meters. |
unit_price |
Money! |
— |
per_quantity |
Int! |
— |
amount |
Money! |
— |
limit_quantity |
Int |
— |
limit_behavior |
LimitBehavior! |
— |
UsageMeter
Section titled “UsageMeter”Object.
| Field | Type | Description |
|---|---|---|
key |
String! |
Stable identifier, “<app>.<metric>”, e.g. “mail.emails_sent”. |
app_key |
String! |
The product app this meter bills under, e.g. “mail”. |
name |
String! |
— |
unit |
String! |
Display unit, e.g. “emails”, “GB”, “minutes”. |
aggregation |
MeterAggregation! |
— |
active |
Boolean! |
— |
created_at |
String! |
— |
updated_at |
String! |
— |
UsageMeterInput
Section titled “UsageMeterInput”Input object.
| Field | Type | Description |
|---|---|---|
key |
String |
Required on createUsageMeter; ignored on updateUsageMeter. |
app_key |
String! |
— |
name |
String! |
— |
unit |
String! |
— |
aggregation |
MeterAggregation! |
— |
active |
Boolean |
— |