# Change a customer

Source: https://developers.weerom.com/docs/reference/customers/updateCustomer

```http
PATCH https://api.weerom.com/v1/customers/{id}
```

Changes a customer's name or blocks them. Send only the fields to change. There is no endpoint that makes a customer: making a booking makes its customer.

**Keys:** a key that may read and change. Any other key gets 403.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes | The object's id. |
| `Idempotency-Key` | header | string | no | Any unique text, such as a UUID. A retry with the same key and the same request gets the first answer back and changes nothing twice. Kept for 24 hours. At most 255 characters. |

## Request body

JSON, with `Content-Type: application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `blocked` | boolean | no | True stops online bookings from this customer. Bookings they have stay. |
| `name` | string | no | At least 1 characters, at most 120 characters. |

Example:

```json
{
  "blocked": true
}
```

## Responses

### 200

The request worked.

| Field | Type | Description |
| --- | --- | --- |
| `blocked` | boolean | The shop no longer takes online bookings from them. |
| `created_at` | string (date-time) | When the shop first saw this customer. |
| `email` | string or null | Null when the shop has no address for them. |
| `has_account` | boolean | Whether they sign in on the shop's site. |
| `id` | string (uuid) | The customer's id. |
| `locale` | string | The language their mail goes out in. |
| `name` | string | As the customer or staff typed it. |
| `no_show_count` | integer | How many bookings staff marked as not shown up. |
| `object` | `customer` |  |
| `phone` | string | E.164. |
| `postal_code` | string or null | Null when the customer never gave one. |
| `updated_at` | string (date-time) | When the record last changed. |

Example:

```json
{
  "blocked": false,
  "created_at": "2026-04-11T09:05:22.000Z",
  "email": "lotte@example.com",
  "has_account": true,
  "id": "5f0c9d3a-7b2e-4c61-8a4d-9e1f3b6c2d75",
  "locale": "nl",
  "name": "Lotte Peeters",
  "no_show_count": 0,
  "object": "customer",
  "phone": "+32470123456",
  "postal_code": "9000",
  "updated_at": "2026-11-18T14:02:11.000Z"
}
```

### 400

A parameter or a field is missing or malformed.

### 401

No key, an unknown key or a revoked key.

### 403

The shop's plan does not include the API, or this kind of key may not call this.

### 404

No object with this id in the key's shop.

### 409

The time is taken, the booking is closed or past its cut-off, or the Idempotency-Key was used for another request.

### 429

Too many requests. Retry-After says when.

Every error answers `{ "error": { "code", "message", "param", "request_id" } }`. `param` is only on some 400 answers. See [Errors](https://developers.weerom.com/docs/errors).

## Keys

A write key. A read key or a public key answers 403 `key_not_allowed`.

## What it does

- Send `name`, `blocked` or both. A `name` is trimmed, and a name that is empty after trimming is ignored.
- `blocked: true` stops online bookings from the customer. Bookings they already hold stay. `blocked: false` lets them book again.
- A customer change sends no webhook. Read changes with `GET /customers?updated_after=...`.

## Errors

Besides 401 for a missing, unknown or removed key, 403 `plan_required`, 429 `rate_limited` and 500 `internal_error`, which every endpoint can answer:

| Status | `code` | When | What to do |
| --- | --- | --- | --- |
| 400 | `invalid_request` | The body holds nothing to change, or a field is malformed. | Send `name`, `blocked` or both. `param` is `body` when the request held neither. |
| 404 | `not_found` | No object has this id, or the id is not a UUID. | Check the id. Ids are UUIDs from a list or from an earlier answer. |
| 409 | `idempotency_mismatch` | The `Idempotency-Key` was used before for a request with another method, path or body. | Make a new `Idempotency-Key` for a new request. |
| 409 | `request_in_progress` | The first request with this `Idempotency-Key` still runs. | Wait a second and send the same request with the same key again. |
