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

# Affiliate Program

> Let your customers promote your store for a commission you set

Your store's affiliate program lets customers earn a commission for referring buyers. It is available on **every plan, including Free**. You set the commission rate and the discount referred buyers receive, Komerza tracks attribution and accrues balances, and you settle up with affiliates directly.

## Setting it up

Go to **Settings → Affiliates** (sections: Commission, Permissions, Management) and switch on **Enable affiliate program**. Then configure:

| Setting                                      | What it does                                                                 |
| -------------------------------------------- | ---------------------------------------------------------------------------- |
| **Default Commission Rate (%)**              | The affiliate's cut of referred sales                                        |
| **Default Customer Discount (%)**            | The discount buyers get when they use an affiliate's code                    |
| **Allow public registration**                | Customers can join as affiliates from your store's customer dashboard        |
| **Allow affiliates to edit referral links**  | Otherwise each affiliate's link and code is fixed                            |
| **Allow balance conversion to store credit** | Affiliates can convert their commission balance into store credit themselves |

Per product you can override the customer discount on the product editor's **Affiliate** tab: use the store default, disable the discount (the affiliate still earns commission), or set a custom percentage.

## How attribution works

An affiliate shares your storefront link with `?ref=<code>` appended. Attribution lasts **30 days**, and the code can also be entered directly at checkout.

<Note>
  The [Embed SDK](/guides/embed-sdk) handles this automatically. A visitor
  arriving at your own site with `?ref=` is attributed without any setup, the
  affiliate cookie is read if present, and you can override it per checkout by
  passing `affiliateCode` to `Komerza.open()`.
</Note>

## How commission accrues

Commission is a percentage of the money **actually collected**, credited once the order reaches delivery. Three consequences worth knowing before an affiliate asks:

* A pending or unpaid order earns nothing yet.
* The amount is based on what the buyer actually paid, after the affiliate's own discount.
* **Refunding an order reverses the commission automatically.**

If an affiliate says their balance hasn't moved, walk that list in order - it is almost always the first item.

## Managing affiliates

Manage them under **Customers → Affiliates**, which requires the View and Update Affiliates permissions. The page shows Total Affiliates, Commissions Paid, Referral Revenue, Avg. Commission and your top earner, and lets you **Invite Affiliate** by email, search, delete or blacklist.

Affiliates see their own rate, referral link, balance and referred orders on your store's customer dashboard under **Affiliates**.

## Paying affiliates

<Warning>
  There is no automatic cash payout. Komerza tracks balances; it does not move
  money to your affiliates.
</Warning>

When you settle up, open the affiliate's detail page under **Customers → Affiliates** and **record a payout** against their balance. The actual transfer - PayPal, bank, whatever you agree - happens outside Komerza. A recorded payout can be **voided**, which restores the balance.

If you enabled balance conversion, affiliates can instead convert their balance into store credit and spend it with you, which costs you nothing in cash and keeps the money in your store. See [Customers & Store Credit](/guides/customers-and-store-credit).

## Doing this by API

The affiliate endpoints cover the whole lifecycle: create, invite, update, blacklist, delete, list referred orders, and record, void or list payouts.

<CardGroup cols={2}>
  <Card title="Affiliates API" icon="code" href="/api-reference/endpoint/affiliates/get-list">
    List, search and manage affiliate profiles.
  </Card>

  <Card title="Record a payout" icon="money-bill-transfer" href="/api-reference/endpoint/affiliates/record-payout">
    Log a settlement against an affiliate's balance.
  </Card>
</CardGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Customers & Store Credit" icon="wallet" href="/guides/customers-and-store-credit">
    Where converted affiliate balances end up.
  </Card>

  <Card title="Coupons & Discounts" icon="tag" href="/guides/coupons-and-discounts">
    How affiliate discounts differ from coupon codes.
  </Card>
</CardGroup>
