# Affiliate API

> Read your affiliate profile, referral code, earnings and payouts, and request a payout.

Source: https://xbeast.io/docs/api-affiliate

Affiliate endpoints expose your referral link, commission and earnings, payout history, and the payout request action. Amounts are returned in USD cents, matching Stripe.

> **Paid plans only**
>
> A payout requires an active paid plan, an affiliate profile, a $50 minimum balance and a full-access key.

### Affiliate profile

**`GET /api/v1/affiliate`**

```json
{
  "data": {
    "has_profile": true,
    "referral_code": "YOURCODE",
    "referral_url": "https://xbeast.io/?ref=YOURCODE",
    "commission_rate": 0.3,
    "minimum_payout_usd": 50,
    "currency": "usd",
    "pending_payout": null
  }
}
```

### Earnings and payouts

**`GET /api/v1/affiliate/earnings`**

Returns total earnings, earnings owed, payout history and per-invoice detail. Use `earnings_owed_cents` to check whether the balance reaches the minimum.

### Request a payout

**`POST /api/v1/affiliate/payouts`**

#### Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| amount | number | No | USD amount to request. Defaults to the full available balance. |

```bash
curl -X POST "https://xbeast.io/api/v1/affiliate/payouts" \
  -H "Authorization: Bearer xb_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 50 }'
```

Payouts are sent as USDC on Ethereum or Base. A request is rejected when the balance is below the minimum or a previous request is still pending.

## Related

- [Create the API key used for these calls](https://xbeast.io/docs/api-keys.md)
- [Ask an agent to report affiliate earnings over MCP](https://xbeast.io/docs/mcp.md)
