# Affiliate

URL: https://docs.hanzo.ai/docs/cli/affiliate

> The `hanzo affiliate` commands.

Also for this capability: [API](https://docs.hanzo.ai/docs/openapi/affiliate) · **CLI** · [MCP](https://docs.hanzo.ai/docs/mcp-tools/affiliate) · [SDKs](https://docs.hanzo.ai/docs/sdks)

A partner program that pays commission on what your referrals spend.

[API reference →](https://docs.hanzo.ai/docs/openapi/affiliate)

```bash
hanzo affiliate get
```

Every command takes `--json` for the raw response and `--help` for its own flags. Sign in once with `hanzo auth login`; the commands below use that session, and the org they act in is the one it carries.

| Command                       | What it does                                                                                                                                                                                                                                          |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `hanzo affiliate apply`       | Enrolls the caller's OWN org as an affiliate at status `applied`, optionally requesting a vanity code, and answers the record — 201 on the first apply, 200 with `created:false` afterwards.                                                          |
| `hanzo affiliate attribute`   | Records the first-touch edge every later commission is computed from: the caller's org was referred by the affiliate that owns this code.                                                                                                             |
| `hanzo affiliate click`       | Counts a click on a share link.                                                                                                                                                                                                                       |
| `hanzo affiliate get`         | 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. |
| `hanzo affiliate leaderboard` | Answers the top affiliates by lifetime accrued commission, shown by OPT-IN HANDLE with aggregate figures only, plus the caller's own exact rank.                                                                                                      |

### Me

| Command                           | What it does                                                                                                                                                                                                                                                |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `hanzo affiliate me 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.                                                               |
| `hanzo affiliate me get`          | 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. |
| `hanzo affiliate me handle`       | Sets the caller's public leaderboard display name, or clears it.                                                                                                                                                                                            |
| `hanzo affiliate me links create` | Mints a new share link for the caller's own affiliate and answers it with its full URL, 201.                                                                                                                                                                |
| `hanzo affiliate me links get`    | Answers the caller's share links, each with its URL and its funnel: clicks tracked, signups — orgs attributed with that code — and conversions, meaning how many of those signups have actually produced commission.                                        |
