On this page
affiliateAccruals
query · in the family Billing and the wallet
What it does
Your referral earnings ledger — subscription-share and usage-share rows for the businesses you introduced, months your own bill was settled from earnings, and any reversals, with the rate and basis on every row.
The caller group's OWN platform referral earnings, NEWEST-FIRST + bounded. SELF-group BY CONSTRUCTION. Each entry snapshots rate + basis — the earnings transparency surface; the wallet's affiliateCreditCents is the live spendable Σ. Requires authentication. Template class A16_BILLING (hand-derived v23).
What happens
Reads only.
Who may call it
Capability area: Billing and the wallet — Your platform bill, token purchases and the usage and cost reads.
- Owner
- Manager
- Associate Manager
- An API key whose scope allows
api:affiliateAccruals
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
limit | Int | no | How many records to answer at most; a page may hold fewer. |
before | ID | no | No further notes. |
Returns
AffiliateAccrual [AffiliateAccrual!]! — One platform referral-earnings fact. accrue (+, the SUBSCRIPTION line — 20% of each referred group's collected base-fee overhead, LIFETIME both-in-good-standing) · usage (+, the CONSUMPTION line — 10% of the referred group's monthly consumed paid-kernel value, its first 12 billed months) · applied (−, bill-netting — YOUR OWN base fee credit-settled against earnings) · clawback (−, a dispute reversal). Each entry snapshots its rate + basis (self-auditing at every parse).
Example request
query ExampleAffiliateAccruals($limit: Int) {
affiliateAccruals(limit: $limit) {
id
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
entryType
ownerOrgGroupId
periodMonth
cycle
ratePercent
collectedUsdCents
usageBasisCents
amountUsdCents
billingChargeId
}
}
Variables:
{
"limit": 1
}
Example response
{
"data": {
"affiliateAccruals": [
{
"id": "01900000-0000-7000-8000-37386ae00000",
"type": "<type>",
"caption": "Blue jeans",
"status": "<status>",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"entryType": "<entry type>",
"ownerOrgGroupId": "01900000-0000-7000-8000-0af354680000",
"periodMonth": "<period month>",
"cycle": 1,
"ratePercent": 1,
"collectedUsdCents": 1,
"usageBasisCents": 1,
"amountUsdCents": 1,
"billingChargeId": "01900000-0000-7000-8000-34d522a50000"
}
]
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. (NOT_FOUND)