Answers the richer self-view: the same lifetime accrued, pending and paid…
Answers the richer self-view: the same lifetime accrued, pending and paid commission and payout history, plus the caller's downline broken out by upline…
GET /v1/affiliate/me
| Address | https://api.hanzo.ai/v1/affiliate/me |
| Method | GET |
| Operation | get_affiliate_me |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Answers the richer self-view: the same lifetime accrued, pending and paid commission and payout history, plus the caller's downline broken out by upline LEVEL — direct, second, third — each with the rate paid at that level and how many orgs sit there.
Commission is MULTI-LEVEL: a referred org's spend pays up its referral chain,
three levels deep and no further. The direct level is the affiliate's own
negotiated rate; the second and third are platform-wide switches, read live,
so the schedule shown is the one actually in force rather than one compiled
in. A caller that has not applied still gets that schedule alongside
isAffiliate:false, so the console can show what it would earn.
Scoped to the validated org and nothing else, and refused without a principal. A PURE READ — it reports the downline but accrues nothing.
Request
GET /v1/affiliate/me takes no parameters and no body — the credential is the whole request.
Response
| Status | Body | Meaning |
|---|---|---|
200 | affiliateSelf | ok |
200 body — 28 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, the slug the ?aff link carries. |
defaultRateBps | body | integer | — | DefaultRateBps is the direct rate a new affiliate starts at, in basis points of margin (2000 = 20%). |
downlineTotal | body | integer | — | DownlineTotal counts every org in the caller's downline across the levels. |
handle | body | string | — | Handle is the opt-in public leaderboard name. |
id | body | string | — | ID is the affiliate's server-minted handle, "aff_"-prefixed. |
isAffiliate | body | boolean | — | IsAffiliate says whether the caller org has an affiliate record. |
levels | body | levelView[] | — | Levels is the caller's downline per upline level, with the rate paid there. |
levels[].downlineCount | body | integer | — | DownlineCount is how many orgs sit exactly this many hops below the caller. |
levels[].level | body | integer | — | Level is the upline distance from the org whose spend is being shared: 1 is the direct referrer, 2 and 3 the referrers above it. |
levels[].rateBps | body | integer | — | RateBps is the commission paid at this level, in basis points OF Hanzo's margin (2000 = 20% of margin, never of the customer's bill). |
link | body | string | — | Link is the shareable ?aff URL built from the code. |
marginBps | body | integer | — | MarginBps is the platform gross-margin fraction, in basis points, that every rate here is a rate OF. |
paidCents | body | integer | — | PaidCents is lifetime commission already paid out, in cents — credits grants and record-only cash disbursements alike. |
payouts | body | remittance[] | — | Payouts is the payout history, newest first, bounded to the last 100 rows. |
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, in cents — what the platform still owes and the ceiling on the next payout. |
rateBps | body | integer | — | RateBps is the caller's OWN direct (level 1) commission rate, in basis points of margin. |
schedule | body | levelView[] | — | Schedule is the rate schedule quoted to a caller that has not applied. |
schedule[].downlineCount | body | integer | — | DownlineCount is how many orgs sit exactly this many hops below the caller. |
schedule[].level | body | integer | — | Level is the upline distance from the org whose spend is being shared: 1 is the direct referrer, 2 and 3 the referrers above it. |
schedule[].rateBps | body | integer | — | RateBps is the commission paid at this level, in basis points OF Hanzo's margin (2000 = 20% of margin, never of the customer's bill). |
status | body | string | — | Status is "applied", "approved" or "suspended"; absent for a caller that never applied. |
Failure carries the platform error shape — see Errors.
Examples
hanzo affiliates me getimport { Configuration, AffiliateApi } from 'hanzoai';
const api = new AffiliateApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAffiliateMe();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_me()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.AffiliateAPI.GetAffiliateMe(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_me(&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).getAffiliateMe();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/me \
-H "Authorization: Bearer $HANZO_API_KEY"Tool affiliates, op get_affiliate_me — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "affiliates",
"arguments": {
"op": "get_affiliate_me",
"input": {}
}
}
}'How is this guide?