# List affiliate

URL: https://docs.hanzo.ai/docs/openapi/affiliate/get-affiliate

> 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.

`GET /v1/affiliate`

> [Affiliate →](https://docs.hanzo.ai/docs/openapi/affiliate) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **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`     | affiliate.affiliateStanding | ok      |
| `default` | problem-details             | refused |

`200` body — 21 fields.

| Field                   | In   | Type                    | Always | Description                                                                                                                 |
| ----------------------- | ---- | ----------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| `accruedCents`          | body | integer (int64)         | —      | AccruedCents is lifetime commission accrued, in cents.                                                                      |
| `code`                  | body | string                  | —      | Code is the minted referral code; empty until staff approve.                                                                |
| `defaultRateBps`        | body | integer (int64)         | —      | 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 (int64)         | —      | MarginBps is the platform gross-margin fraction commission is a rate OF.                                                    |
| `paidCents`             | body | integer (int64)         | —      | PaidCents is lifetime commission already paid out, in cents.                                                                |
| `payouts`               | body | affiliate.remittance\[] | —      | Payouts is the payout history, newest rows bounded.                                                                         |
| `payouts[].amountCents` | body | integer (int64)         | —      | AmountCents is the amount disbursed, in cents.                                                                              |
| `payouts[].createdAt`   | body | integer (int64)         | —      | 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.                                                                                               |
| `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 (int64)         | —      | PendingCents is accrued minus paid — what the platform still owes.                                                          |
| `rateBps`               | body | integer (int64)         | —      | RateBps is the affiliate's own direct commission rate, in basis points.                                                     |
| `referredCount`         | body | integer (int64)         | —      | 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](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo affiliate get
```

**SDK**

**.ts**

```ts
import { Configuration, AffiliateApi } from 'hanzoai';

const api = new AffiliateApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAffiliate();
```

**.py**

```python
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()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AffiliateAPI.GetAffiliate(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
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(&cfg, Default::default()).await?;
```

**.java**

```java
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).getAffiliate();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/affiliate \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

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:

```bash
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](https://docs.hanzo.ai/docs/openapi/affiliate) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
