> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Log a storefront customer in

**Published**: 2026-11-30
**Category**: Commerce

## `POST /customers/login`

**Log a storefront customer in**

Signs a customer in with `email` and `password` and returns a session token, valid for
30 days. Send it as `Authorization: Bearer <token>` on the signed-in customer routes.

Every failure returns the same 401 `CUSTOMER_AUTH_REQUIRED`: an unknown email, a
wrong password, or an account that is not activated. After five failed attempts for
one email, or ten from one client, further attempts return 429 `RATE_LIMIT_EXCEEDED`
with a `Retry-After` header for up to 15 minutes.

Returns 200 with `{ customer, token }`.

> **Note:** Available only on sites with e-commerce enabled.

### Request Body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `email` | string | Yes | Required. Valid email address |
| `password` | string | Yes | Required. 1-100 characters |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Missing or invalid storefront publishable key |
| `402` | The site subscription does not currently permit this operation |
| `403` | The storefront key origin is not allowed |
| `404` | Site, resource, or commerce feature not found |
| `422` | Validation error |


### SDK

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({
  siteId: process.env.LYNKOW_SITE_ID!,
  publishableKey: process.env.LYNKOW_PK,
})

const { customer, token } = await lynkow.customers.login({
  email: 'alice@example.com',
  password: 'a-strong-passphrase',
})
saveToken(token)
```

---