List affiliate

Answers the caller org's OWN affiliate standing: status, referral code and share link, commission rate, how many orgs it has referred, and its lifetime accrued, still-pending and already-paid commission in integer cents, with its payout history.

GET /v1/affiliate

Addresshttps://api.hanzo.ai/v1/affiliate
MethodGET
Operationget_affiliate
AuthAuthorization: Bearer $HANZO_API_KEY

Answers the caller org's OWN affiliate standing: status, referral code and share link, commission rate, how many orgs it has referred, and its lifetime accrued, still-pending and already-paid commission in integer cents, with its payout history.

An org that never applied gets an honest isAffiliate:false and the default rate rather than a 404 — the console renders the apply form off that answer.

The affiliate is resolved from the VALIDATED org, never from a field, so this can only ever read the caller's own row; without a principal it is refused. It is a PURE READ: nothing accrues until the sweep runs. Commission is earned on Hanzo's MARGIN, never on the referred customer's bill, so nothing here changes what that customer pays.

Request

GET /v1/affiliate takes no parameters and no body — the credential is the whole request.

Response

StatusBodyMeaning
200affiliate.affiliateStandingok
defaultproblem-detailsrefused

200 body — 21 fields.

FieldInTypeAlwaysDescription
accruedCentsbodyinteger (int64)—AccruedCents is lifetime commission accrued, in cents.
codebodystring—Code is the minted referral code; empty until staff approve.
defaultRateBpsbodyinteger (int64)—DefaultRateBps is the direct rate a new affiliate would get, answered only to a caller that has not applied.
handlebodystring—Handle is the opt-in public leaderboard name; empty means opted out.
idbodystring—ID is the affiliate's server-minted handle, "aff_"-prefixed — what staff approve, suspend, re-rate and pay against.
isAffiliatebodyboolean—IsAffiliate says whether the caller org has an affiliate record at all.
linkbodystring—Link is the shareable ?aff URL; empty until a code is minted.
marginBpsbodyinteger (int64)—MarginBps is the platform gross-margin fraction commission is a rate OF.
paidCentsbodyinteger (int64)—PaidCents is lifetime commission already paid out, in cents.
payoutsbodyaffiliate.remittance[]—Payouts is the payout history, newest rows bounded.
payouts[].amountCentsbodyinteger (int64)—AmountCents is the amount disbursed, in cents.
payouts[].createdAtbodyinteger (int64)—CreatedAt is when the payout was recorded, Unix seconds UTC — when the balance moved, not necessarily when the cash landed.
payouts[].idbodystring—ID is the payout row's server-minted handle, "apo_"-prefixed.
payouts[].methodbodystring—Method is how it was settled.
payouts[].referencebodystring—Reference is the operator's settlement note — a bank id, a ledger ref.
payouts[].txnbodystring—Txn is the commerce ledger transaction id, set ONLY where a "credits" payout actually issued the grant.
pendingCentsbodyinteger (int64)—PendingCents is accrued minus paid — what the platform still owes.
rateBpsbodyinteger (int64)—RateBps is the affiliate's own direct commission rate, in basis points.
referredCountbodyinteger (int64)—ReferredCount is how many orgs this affiliate has referred.
requestedCodebodystring—RequestedCode is the vanity code asked for at apply time — a request, not an allocation.
statusbodystring—Status is "applied", "approved" or "suspended".

Failure carries the platform error shape — see Errors.

Examples

hanzo affiliate get
import { Configuration, AffiliateApi } from 'hanzoai';

const api = new AffiliateApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAffiliate();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AffiliateApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AffiliateApi(client).get_affiliate()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AffiliateAPI.GetAffiliate(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, affiliate_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = affiliate_api::get_affiliate(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AffiliateApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AffiliateApi(client).getAffiliate();
curl https://api.hanzo.ai/v1/affiliate \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches affiliate through the affiliate tool, which names its 10 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_affiliates"
         }
       }
     }'

Affiliate API · All Hanzo APIs · Interactive reference

Was this page useful?