List earnings

Answers the caller's own commission ledger: per period, the margin it earned against and the commission taken from that margin; and per referred org, that referral's aggregate contribution.

GET /v1/affiliate/me/earnings

Addresshttps://api.hanzo.ai/v1/affiliate/me/earnings
MethodGET
Operationget_affiliate_me_earnings
AuthAuthorization: Bearer $HANZO_API_KEY

Answers the caller's own commission ledger: per period, the margin it earned against and the commission taken from that margin; and per referred org, that referral's aggregate contribution. Integer cents throughout.

The per-org view deliberately carries the affiliate's OWN earned share and NOT the referred org's spend or margin. An affiliate is entitled to what it earned, not to a restatement of its customer's usage — the period view is where the margin base appears, aggregated across every referral.

Scoped server-side to the validated caller's affiliate; a caller that is not one gets isAffiliate:false.

Request

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

Response

StatusBodyMeaning
200affiliate.affiliateEarningsok
defaultproblem-detailsrefused

200 body — 12 fields.

FieldInTypeAlwaysDescription
accruedCentsbodyinteger (int64)—AccruedCents is lifetime commission accrued, in cents.
byPeriodbodyaffiliate.periodEarningView[]—ByPeriod is the per-period ledger: the margin earned against and the commission taken from it.
byPeriod[].commissionCentsbodyinteger (int64)—CommissionCents is what the caller earned that period, in cents: the sum over each referred org and upline level of margin × that level's rate.
byPeriod[].marginCentsbodyinteger (int64)—MarginCents is the margin Hanzo earned in that period on the spend of every org the caller referred, in cents — the base commission is a rate OF.
byPeriod[].periodbodystring—Period is the accrual bucket: the UTC year-month, "YYYY-MM".
byReferredOrgbodyaffiliate.orgEarningView[]—ByReferredOrg is each referral's aggregate contribution — the affiliate's OWN share, never the referred org's spend.
byReferredOrg[].commissionCentsbodyinteger (int64)—CommissionCents is what the caller earned from that org across ALL periods, in cents.
byReferredOrg[].referredOrgbodystring—ReferredOrg is the org slug this contribution came from — one the caller referred, directly or up to three levels down.
isAffiliatebodyboolean—IsAffiliate says whether the caller org has an affiliate record.
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.
pendingCentsbodyinteger (int64)—PendingCents is accrued minus paid — what the platform still owes.

Failure carries the platform error shape — see Errors.

Examples

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

const api = new AffiliateApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAffiliateMeEarnings();
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_earnings()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AffiliateAPI.GetAffiliateMeEarnings(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_me_earnings(&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).getAffiliateMeEarnings();
curl https://api.hanzo.ai/v1/affiliate/me/earnings \
  -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?