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

# Customers

> Customer profiles, wallet credits, and affiliates.

Every buyer who completes an order on your shop gets a customer profile that shows their
order history, lifetime value, and wallet balance.

From the **Customers** tab, you can view this history and contact a buyer through the inbox.
You can also credit their wallet, promote them to an affiliate, or block them.

## What is on a customer profile

* Order history with status and amount per order.
* Lifetime value across all gateways combined.
* Contact details: email, name, phone, country, city, postal code, and linked Discord ID.
* Current wallet balance and transaction history.
* Affiliate status (if enrolled) with referral count and commission earnings.

## Store credit

Store credit is a balance you add to a customer's wallet, and the customer spends it on a
future order in your shop.

### Crediting a customer's wallet

Credit a customer's wallet from the customer detail page. Common reasons to add credit:

* A promotional gift, a win-back campaign, or an apology credit after a bad experience.
* An affiliate commission paid out as store credit instead of crypto.

### Refunds as store credit

Instead of refunding an order to the original payment method, you can credit the buyer's
wallet for the same amount. The buyer then spends that balance on a future order.

<Note>
  Refunding an order as credit happens from the order itself. See [Refunds](/payments/refunds) for that flow.
</Note>

### The wallet ledger

Every change to a wallet balance creates a ledger entry. You cannot change the ledger: past entries
never change, and a correction adds a new entry instead of editing an old one.

The ledger records one of seven transaction types:

| Type         | Meaning                                            |
| ------------ | -------------------------------------------------- |
| `CREDIT`     | Balance added manually or through a promotion      |
| `DEBIT`      | Balance removed manually                           |
| `REFUND`     | An order refunded as credit instead of cash        |
| `PROMO`      | A promotional or win-back credit                   |
| `ADJUSTMENT` | A manual correction to the balance                 |
| `PAYMENT`    | Balance spent on an order                          |
| `EXPIRED`    | Balance removed because it reached its expiry date |

### Store credit settings

Configure shop-wide behavior at **Settings → Payments → Store Credit**:

* **Allow refunds as credit** — turns on the option to refund an order as wallet credit instead of cash.
* **Default expiry** — the number of days new credit stays valid, or never.
* **Balance cap** — the maximum wallet balance a single customer can hold.

<Note>
  Expiry is off by default. When you turn it on, new credit expires after the number of days you set.
</Note>

## Affiliates

Any customer can become an affiliate of your shop, earning a share of the sales they refer
through a personal link.

### Turning on the affiliate program

Configure affiliates at **Marketing → Rewards**, or directly from a customer's profile under
**Customers → Affiliate**. Three settings control the program:

| Setting              | Effect                                                                              |
| -------------------- | ----------------------------------------------------------------------------------- |
| Affiliate revenue    | The percent affiliates earn on sales they refer, once turned on.                    |
| Customer discount    | The percent off a referred buyer gets through the affiliate's link, once turned on. |
| Custom link approval | Whether you manually approve a custom affiliate link before it goes live.           |

### How referrals work

A buyer who arrives through an affiliate's link gets attributed to that affiliate for their
purchase. When Customer discount is on, the buyer sees the discount applied automatically at
checkout.

### Payouts

An affiliate requests a payout from their own customer account. You approve or reject the
request from the **Affiliates** section of your dashboard.

An approved payout settles in one of two ways:

* **Crypto** — sent to the wallet address the affiliate provides.
* **Store credit** — converted into a wallet balance on your store. See [Store credit](#store-credit) above for how that balance works.

<Note>
  If you want a fully branded affiliate dashboard instead of the built-in customer account, build it against the Dev API. See [Headless affiliate and customer portals](/customers/overview).
</Note>

## Blocking customers

If a customer is fraudulent or abusive, block them from **Security → Blocked**
(`/security/blocked`), or directly from the customer's row action menu. Block by:

* Email
* IP / IP range
* Country
* Domain (in their email)
* ASN
* ISP
* City
* Crypto wallet address

Use the narrowest match that catches the abuse. Whole-country bans are blunt. ASN or
IP-range bans usually work better for a repeat offender.

See [Support inbox](/customers/inbox) for how the support inbox works.
