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

# Commissions

> How affiliate commissions are calculated and tracked.

## How Commissions Work

When someone you referred makes a purchase, you earn a commission. The amount depends on the program's commission structure.

## Commission Types

| Type                     | How It Works                                                     | Example                      |
| ------------------------ | ---------------------------------------------------------------- | ---------------------------- |
| **One-time**             | Percentage commission on the initial purchase only               | 30% of a $99 sale = $29.70   |
| **Recurring**            | Percentage commission on each subscription renewal               | 20% of every monthly renewal |
| **Recurring with limit** | Recurring percentage commission capped to a set number of months | 20% for the first 12 months  |

The commission type and rate are set by the merchant for each program.

## Commission Lifecycle

Every commission goes through these stages:

```
Conversion Created → Pending → Approved → Paid
```

| Status               | Description                                                           |
| -------------------- | --------------------------------------------------------------------- |
| `pending`            | Conversion recorded, waiting for approval period                      |
| `approved`           | Commission confirmed, waiting for payout threshold                    |
| `paid`               | Included in a payout, money sent to you                               |
| `partially_refunded` | Customer received a partial refund, commission reduced proportionally |
| `refunded`           | Customer fully refunded, commission reversed                          |

### Why Pending?

Commissions start as **pending** to protect against refunds and fraud. The approval period varies by program – typically 14-30 days. This is standard practice in affiliate marketing.

## Viewing Your Commissions

### Dashboard

Your affiliate dashboard shows:

* Total commissions earned (all time)
* Pending commissions (not yet approved)
* Available for payout (approved, waiting for threshold)
* Commission history with per-conversion detail

### Via API

Use `GET /me/earnings` for the cross-program overview and `GET /me/earnings/{programId}` when you want line-item detail for one program.

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

  const overview = await fetch('https://www.agentref.co/api/v1/me/earnings', { headers }).then((r) => r.json());
  const details = await fetch(
    'https://www.agentref.co/api/v1/me/earnings/PROGRAM_UUID?period=30d',
    { headers }
  ).then((r) => r.json());
  ```

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

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

  overview = httpx.get("https://www.agentref.co/api/v1/me/earnings", headers=headers).json()
  details = httpx.get(
      "https://www.agentref.co/api/v1/me/earnings/PROGRAM_UUID",
      headers=headers,
      params={"period": "30d"},
  ).json()
  ```

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

  curl "https://www.agentref.co/api/v1/me/earnings/PROGRAM_UUID?period=30d" \
    -H "Authorization: Bearer ak_aff_YOUR_KEY"
  ```
</CodeGroup>

## Recurring Commissions

Some programs offer **recurring commissions** on subscription products. If a customer you referred stays subscribed, you earn a commission on each renewal – not just the first payment.

<Info>
  Whether a program offers one-time or recurring commissions is set by the merchant. Check the program details when you join.
</Info>

## Refunds

If a customer receives a partial refund, the commission is reduced proportionally and the conversion can move to `partially_refunded`. If the customer receives a full refund, the conversion status changes to `refunded` and the commission is reversed.

Refunded commissions that were already paid out are deducted from your next payout.
