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

# Customers

> Customer accounts and profiles for an 86d store: a Customer record per Shopper, sign-in flows, and admin search.

<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 Customers [Module](/docs/concepts/modules) manages the [Customer](/docs/resources/glossary#customer) record that backs every authenticated [Shopper](/docs/resources/glossary#shopper). Customers can read and update their profile, change their email, and change their password. You can search, filter, and edit Customer records through the admin endpoints. `@86d-store/loyalty`, `@86d-store/saved-addresses`, `@86d-store/customer-groups`, and most engagement Modules depend on it.

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

## Installation

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

Then run `86d generate`.

## Configuration

The Customers Module takes no configuration options. Initialize it with no arguments:

```ts theme={null}
import customers from "@86d-store/customers";
import { createModuleClient } from "@86d-store/core";

const client = createModuleClient([customers()]);
```

## Store endpoints

| Method   | Path                            | Description                                    |
| -------- | ------------------------------- | ---------------------------------------------- |
| `GET`    | `/customers/me`                 | Get the authenticated customer's profile       |
| `PUT`    | `/customers/me`                 | Update profile (name, phone, marketing opt-in) |
| `POST`   | `/customers/me/change-email`    | Request an email change (sends verification)   |
| `POST`   | `/customers/me/change-password` | Change the password                            |
| `DELETE` | `/customers/me`                 | Soft-delete the account                        |

All store endpoints require an authenticated session.

## Admin endpoints

| Method   | Path                              | Description                                               |
| -------- | --------------------------------- | --------------------------------------------------------- |
| `GET`    | `/admin/customers`                | List customers (paginated, filterable by `status`, `tag`) |
| `GET`    | `/admin/customers/search`         | Full-text search by name, email, or phone                 |
| `GET`    | `/admin/customers/:id`            | Get a customer record                                     |
| `PUT`    | `/admin/customers/:id`            | Update fields                                             |
| `POST`   | `/admin/customers/:id/suspend`    | Suspend account                                           |
| `POST`   | `/admin/customers/:id/reactivate` | Reactivate account                                        |
| `DELETE` | `/admin/customers/:id`            | Hard-delete (use with care)                               |

## Components

| Component             | Purpose                                                               |
| --------------------- | --------------------------------------------------------------------- |
| `<AccountPage />`     | Full customer self-service page (profile, addresses, orders, loyalty) |
| `<CustomerDetails />` | Editable name and contact form                                        |
| `<EmailChangeForm />` | Inline email-change form with verification                            |

## Types

```ts theme={null}
type CustomerStatus = "active" | "suspended" | "closed";

interface Customer {
  id: string;
  email: string;
  firstName?: string;
  lastName?: string;
  phone?: string;
  status: CustomerStatus;
  marketingOptIn: boolean;
  tags: string[];
  metadata: Record<string, unknown>;
  createdAt: Date;
  updatedAt: Date;
}
```

## Related pages

* [Saved addresses](/docs/modules/saved-addresses)
* [Customer groups](/docs/modules/customer-groups)
* [Loyalty](/docs/modules/loyalty)
* [Wishlist](/docs/modules/wishlist)
* [How commerce records relate](/docs/concepts/commerce-model)
* [86d glossary](/docs/resources/glossary#customer)
* [Versioning and maturity](/docs/resources/versioning)
