Hanzo
OpenapiAffiliate

Answers the caller's own commission ledger: per period, the margin it earned…

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…

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
200affiliateEarningsok

200 body — 12 fields.

FieldInTypeAlwaysDescription
accruedCentsbodyintegerAccruedCents is lifetime commission accrued, in cents.
byPeriodbodyperiodEarningView[]ByPeriod is the per-period ledger: the margin earned against and the commission taken from it.
byPeriod[].commissionCentsbodyintegerCommissionCents 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[].marginCentsbodyintegerMarginCents 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[].periodbodystringPeriod is the accrual bucket: the UTC year-month, "YYYY-MM".
byReferredOrgbodyorgEarningView[]ByReferredOrg is each referral's aggregate contribution — the affiliate's OWN share, never the referred org's spend.
byReferredOrg[].commissionCentsbodyintegerCommissionCents is what the caller earned from that org across ALL periods, in cents.
byReferredOrg[].referredOrgbodystringReferredOrg is the org slug this contribution came from — one the caller referred, directly or up to three levels down.
isAffiliatebodybooleanIsAffiliate says whether the caller org has an affiliate record.
marginBpsbodyintegerMarginBps is the platform gross-margin fraction commission is a rate OF.
paidCentsbodyintegerPaidCents is lifetime commission already paid out, in cents.
pendingCentsbodyintegerPendingCents is accrued minus paid — what the platform still owes.

Failure carries the platform error shape — see Errors.

Examples

hanzo affiliates me earnings

Affiliate API · All Hanzo APIs · Interactive reference

How is this guide?

On this page