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

# Referrals

> Customer referral program for 86d. Each Customer gets a unique referral code; both referrer and referee earn a reward on conversion.

<Warning>
  **Experimental.** This Module has no test or production evidence recorded yet. Read it, run it locally, and hold off on real Orders. See [maturity levels](/docs/resources/versioning).
</Warning>

The Referrals [Module](/docs/concepts/modules) gives every [Customer](/docs/resources/glossary#customer) a unique referral code. When a new Customer places their first [Order](/docs/concepts/commerce-model) with that code, both the referrer and the new Customer receive the reward you set per program: a discount, store credit, or loyalty points.

**Source:** [`modules/referrals`](https://github.com/86d-store/86d/tree/main/modules/referrals) · **npm:** [`@86d-store/referrals`](https://www.npmjs.com/package/@86d-store/referrals)

## Installation

```sh theme={null}
86d module add referrals
```

## Configuration

```ts theme={null}
referrals({
  rewardType: "store-credit",      // "store-credit" | "discount" | "loyalty-points"
  referrerRewardAmount: "1000",    // in cents or points
  refereeRewardAmount: "1000",
});
```

## Store endpoints

| Method | Path                | Description                                 |
| ------ | ------------------- | ------------------------------------------- |
| `GET`  | `/referrals/me`     | Get the customer's code and stats           |
| `POST` | `/referrals/redeem` | Apply a referral code at signup or checkout |

## Components

* `<ReferralDashboard />`
* `<ReferralBadge />`

## Related pages

* [Affiliates](/docs/modules/affiliates) for partner programs rather than customer-to-customer referrals
* [Store credits](/docs/modules/store-credits)
* [Loyalty](/docs/modules/loyalty)
* [Discounts](/docs/modules/discounts)
* [Glossary](/docs/resources/glossary)
* [Versioning and maturity](/docs/resources/versioning)
