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

# Affiliates & Referrals

> How referral codes attach to checkout and embed orders.

# Affiliates & Referrals

Join Markt tracks referrals on orders. There is no dedicated `/api/affiliates*` CRUD surface — configuration lives on the store and buyer referral data surfaces in customer UI.

## Store settings

* `affiliateEnabled`
* `affiliatePercentage`

Configured in the dashboard Affiliate section (saved with store settings).

## Capture paths

| Source          | How                                                          |
| --------------- | ------------------------------------------------------------ |
| Embed           | `?ref=` → cookie `markt_affiliate` → `affiliateCode` on open |
| Checkout start  | `referralCode` body field                                    |
| Customer portal | GET /api/customer/referrals (customer session)               |

Stored on the order as `referralCode`.

## Integrator rules

1. Prefer letting the SDK read `?ref=` automatically.
2. Override with `affiliateCode` only when you own attribution logic.
3. Do not invent a public affiliates admin API — use the dashboard until one ships.

See Embed SDK and Start Checkout.
