> ## Documentation Index
> Fetch the complete documentation index at: https://agentref.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started as an Affiliate

> How to join an affiliate program on AgentRef and start earning commissions.

This guide is for **affiliates** – people who promote products and earn commissions on successful referrals.

## How to Join a Program

There are two ways to join an affiliate program on AgentRef:

### 1. Invite Link

If a merchant sent you an invite link, click it to create your affiliate account. You'll be asked to:

1. Enter your name and email
2. Set your preferred referral code (e.g., `jane`, `techreviewer`)
3. Accept the program terms

Depending on the program settings, you'll either be approved immediately or placed in a pending queue for the merchant to review.

### 2. Marketplace

Browse the [AgentRef Marketplace](https://www.agentref.co/marketplace) to discover programs:

1. Browse available programs
2. Click **Apply** on a program that interests you
3. Fill out the application form
4. Wait for the merchant to approve your application

## Your Affiliate Dashboard

Once approved, you'll have access to your affiliate dashboard where you can:

* **View your referral links** – unique URLs to share with your audience
* **Track clicks** – see how many people clicked your links
* **Monitor conversions** – see which clicks converted into sales
* **View commissions** – track your earnings in real-time
* **Use marketing resources** – download merchant-approved assets and render social posts with your link
* **Check payout status** – see when you'll get paid

## Your API Key

If you're an AI agent or developer, you can access your affiliate data programmatically:

1. Go to **Settings → API Keys** in your affiliate dashboard
2. Create a new API key (prefix: `ak_aff_`)
3. Use it with the REST API or [MCP Server](/agent-integration/mcp-server)

The most useful starting endpoints are:

* `GET /me` for your affiliate identity
* `GET /me/overview` for aggregate earnings and program stats
* `GET /me/programs` for the programs you belong to
* `GET /me/clicks` for click stats over a date range
* `GET /me/programs/{programId}/marketing-resources` for merchant-published campaign material

<CodeGroup>
  ```javascript Node.js theme={null}
  const headers = {
    Authorization: 'Bearer ak_aff_YOUR_KEY',
  };

  const me = await fetch('https://www.agentref.co/api/v1/me', { headers }).then((r) => r.json());
  const overview = await fetch('https://www.agentref.co/api/v1/me/overview', { headers }).then((r) => r.json());
  const programs = await fetch('https://www.agentref.co/api/v1/me/programs', { headers }).then((r) => r.json());
  const clicks = await fetch(
    'https://www.agentref.co/api/v1/me/clicks?startDate=START_DATE&endDate=END_DATE',
    { headers }
  ).then((r) => r.json());
  ```

  ```python Python theme={null}
  import httpx

  headers = {"Authorization": "Bearer ak_aff_YOUR_KEY"}

  me = httpx.get("https://www.agentref.co/api/v1/me", headers=headers).json()
  overview = httpx.get("https://www.agentref.co/api/v1/me/overview", headers=headers).json()
  programs = httpx.get("https://www.agentref.co/api/v1/me/programs", headers=headers).json()
  clicks = httpx.get(
      "https://www.agentref.co/api/v1/me/clicks",
      headers=headers,
      params={"startDate": "START_DATE", "endDate": "END_DATE"},
  ).json()
  ```

  ```bash cURL theme={null}
  curl "https://www.agentref.co/api/v1/me" \
    -H "Authorization: Bearer ak_aff_YOUR_KEY"

  curl "https://www.agentref.co/api/v1/me/overview" \
    -H "Authorization: Bearer ak_aff_YOUR_KEY"

  curl "https://www.agentref.co/api/v1/me/programs" \
    -H "Authorization: Bearer ak_aff_YOUR_KEY"

  curl "https://www.agentref.co/api/v1/me/clicks?startDate=START_DATE&endDate=END_DATE" \
    -H "Authorization: Bearer ak_aff_YOUR_KEY"
  ```
</CodeGroup>

## What's Next

<CardGroup cols={2}>
  <Card title="Links & Attribution" icon="link" href="/affiliates/links-attribution">
    Learn how tracking links work
  </Card>

  <Card title="Marketing Resources" icon="images" href="/affiliates/marketing-resources">
    Use merchant-provided campaign assets
  </Card>

  <Card title="Commissions" icon="coins" href="/affiliates/commissions">
    Understand how you earn
  </Card>

  <Card title="Getting Paid" icon="money-bill" href="/affiliates/getting-paid">
    How and when you get paid
  </Card>

  <Card title="FAQ" icon="circle-question" href="/affiliates/faq">
    Common questions answered
  </Card>
</CardGroup>
