# Register a customer

URL: /docs/api/storefront/customers/register-a-customer

Returns a bearer token straight away; verification is not required to use it. A queued
verification email linking to the store's storefront verify page is sent once,
or none when the store has not set its verify-email URL in Store settings.

## POST /v1/auth/register

```http
POST https://api.elaraone.app/api/v1/auth/register
```

Returns a bearer token straight away; verification is not required to use it. A queued
verification email linking to the store's storefront verify page is sent once,
or none when the store has not set its verify-email URL in Store settings.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `X-Client-IP` | header | string |  | Optional. IP address of the shopper (one IPv4/IPv6, no port, no list). Honoured only together with a valid X-Tenant-Secret; ignored otherwise. Used for rate limits and recorded with form submissions. |
| `X-Tenant-Secret` | header | string |  | Optional here. Server secret of the store: server-to-server only, never from a browser. Enables X-Client-IP. |
| `X-Session-Id` | header | string |  | Optional. The shopper's `sid` cookie value (8-128 of letters, digits, `.` `_` `:` `-`). Links the choice made in this browser to the new customer, and decides whether the `sign_up` event is kept and the visitor linked to the customer. Read for this request only, compared as a SHA-256 hash, never stored raw. Send it on every write; a malformed value is ignored (never a 422), and leaving it out means "no choice known". |
| `X-Visitor-Id` | header | string |  | Optional. The `vid` cookie value, when the shopper has one. Links the choice made in this browser to the new customer, and decides whether the `sign_up` event is kept and the visitor linked to the customer. Read for this request only, compared as a SHA-256 hash, never stored raw. Send it on every write; a malformed value is ignored (never a 422), and leaving it out means "no choice known". |
| `X-Consent-Token` | header | string |  | Optional. The `consent` cookie value (the `consent_token` from `PUT consent`). Links the choice made in this browser to the new customer, and decides whether the `sign_up` event is kept and the visitor linked to the customer. Read for this request only, compared as a SHA-256 hash, never stored raw. Send it on every write; a malformed value is ignored (never a 422), and leaving it out means "no choice known". |

### Request body (`application/json`)

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes |  |
| `email` | string | yes |  |
| `password` | string | yes |  |
| `password_confirmation` | string | yes |  |

### Responses

- **201**: Success.
- **402**: Payment required. Branch on `error.code`: - `TENANT_PAYMENT_REQUIRED`: this store is on payment hold. Show a "store temporarily unavailable" page; do not retry the request.
- **422**: Validation error