Answers the caller org's OWN affiliate standing: status, referral code and…
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…
GET /v1/affiliate
| Address | https://api.hanzo.ai/v1/affiliate |
| Method | GET |
| Operation | get_affiliate |
| Auth | Authorization: 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
| Status | Body | Meaning |
|---|---|---|
200 | affiliateStanding | ok |
200 body — 21 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
accruedCents | body | integer | — | AccruedCents is lifetime commission accrued, in cents. |
code | body | string | — | Code is the minted referral code; empty until staff approve. |
defaultRateBps | body | integer | — | DefaultRateBps is the direct rate a new affiliate would get, answered only to a caller that has not applied. |
handle | body | string | — | Handle is the opt-in public leaderboard name; empty means opted out. |
id | body | string | — | ID is the affiliate's server-minted handle, "aff_"-prefixed — what staff approve, suspend, re-rate and pay against. |
isAffiliate | body | boolean | — | IsAffiliate says whether the caller org has an affiliate record at all. |
link | body | string | — | Link is the shareable ?aff URL; empty until a code is minted. |
marginBps | body | integer | — | MarginBps is the platform gross-margin fraction commission is a rate OF. |
paidCents | body | integer | — | PaidCents is lifetime commission already paid out, in cents. |
payouts | body | remittance[] | — | Payouts is the payout history, newest rows bounded. |
payouts[].amountCents | body | integer | — | AmountCents is the amount disbursed, in cents. |
payouts[].createdAt | body | integer | — | CreatedAt is when the payout was recorded, Unix seconds UTC — when the balance moved, not necessarily when the cash landed. |
payouts[].id | body | string | — | ID is the payout row's server-minted handle, "apo_"-prefixed. |
payouts[].method | body | string | — | Method is how it was settled. "credits" issued a commerce grant into the affiliate org's own wallet; any other value (wire, paypal, check, …) is a RECORD of… |
payouts[].reference | body | string | — | Reference is the operator's settlement note — a bank id, a ledger ref. |
payouts[].txn | body | string | — | Txn is the commerce ledger transaction id, set ONLY where a "credits" payout actually issued the grant. |
pendingCents | body | integer | — | PendingCents is accrued minus paid — what the platform still owes. |
rateBps | body | integer | — | RateBps is the affiliate's own direct commission rate, in basis points. |
referredCount | body | integer | — | ReferredCount is how many orgs this affiliate has referred. |
requestedCode | body | string | — | RequestedCode is the vanity code asked for at apply time — a request, not an allocation. |
status | body | string | — | Status is "applied", "approved" or "suspended". |
Failure carries the platform error shape — see Errors.
Examples
hanzo affiliates getimport { 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 := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.AffiliateAPI.GetAffiliate(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new AffiliateApi(client).getAffiliate();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/affiliate \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches affiliate through the affiliates tool, which names its 17 operations with its own verbs — this one among them, under a name only the door 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_admin_affiliates"
}
}
}'How is this guide?