AlmondTill/G3N API

On this page

referralReport

query · in the family Billing and the wallet

What it does

How your referrals are performing — every business you referred with its standing, how many months it has paid you, what it earned you, and whether its first-year usage share is still running; plus your lifetime totals (earned, settled against your own bill, reversed), your spendable credit, and the last twelve months of activity month by month.

The caller group's OWN referral performance report: counts of referred businesses by standing (+ gone · earning), lifetime totals by kind (earned ≥ 0 · applied/clawback ≤ 0 — SIGNED like the ledger), the spendable credit, the NEWEST 12 months that carry entries, and one page of referred businesses each with months paid · latest billed cycle · usage-window months left · earned · reversed. SELF-group BY KEY CONSTRUCTION (no target arg); a group that referred nobody answers the zero report. referrals NEWEST-first by the referred group's id — limit clamps [1,200] default 50, before pages backward by that id (the affiliateAccruals grammar); the counts and totals are page-independent. Requires authentication. Template class A16_BILLING (hand-derived v97).

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.

Arguments

NameTypeRequiredNotes
limitIntnoHow many records to answer at most; a page may hold fewer.
beforeIDnoNo further notes.

Returns

ReferralReport ReferralReport! — Your referral program at a glance: counts by standing, lifetime totals by kind (SIGNED like the ledger: earned ≥ 0 · applied/clawback ≤ 0), the spendable credit, the NEWEST 12 months that carry entries, and one page of referred businesses with their figures.

Example request

query ExampleReferralReport($limit: Int) {
  referralReport(limit: $limit) {
    referredCount
    pendingCount
    approvedCount
    deniedCount
    goneCount
    earningCount
    earnedUsdCents
    appliedUsdCents
    clawbackUsdCents
    spendableUsdCents
  }
}

Variables:

{
  "limit": 1
}

Example response

{
  "data": {
    "referralReport": {
      "referredCount": 1,
      "pendingCount": 1,
      "approvedCount": 1,
      "deniedCount": 1,
      "goneCount": 1,
      "earningCount": 1,
      "earnedUsdCents": 1,
      "appliedUsdCents": 1,
      "clawbackUsdCents": 1,
      "spendableUsdCents": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer