# Update Customer

**Endpoint**

`PATCH/v2/customer/{customerId}`

**Link**

{% embed url="<https://stagep.tst-apidmndelss.com/openapi/v2.html#/operations/Customer_Update>" %}

### **Request**

#### **Path Parameters**

| Parameter        | Type     | Description                | Required | Example                 |
| ---------------- | -------- | -------------------------- | -------- | ----------------------- |
| **`customerId`** | `string` | **Customer ID** to update. | Yes      | `"DqCsgSE-4e95-ViYbNI"` |

#### **Headers**

| Key             | Value              | Required |
| --------------- | ------------------ | -------- |
| `Authorization` | `Bearer <JWT>`     | Yes      |
| `Content-Type`  | `application/json` | Yes      |
| `Accept`        | `application/json` | Yes      |

#### **Request Body (JSON)**

All fields are optional - only include the fields you want to update.

| Field          | Type     | Description & Values                                                                                                                                                                                                                    | Example                   |
| -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| **`name`**     | `string` | **First name** or **company name**.                                                                                                                                                                                                     | `"John"` or `"Acme Inc."` |
| **`lastname`** | `string` | **Last name** (individuals only).                                                                                                                                                                                                       | `"Smith"`                 |
| **`comment`**  | `string` | **Internal notes/comments**.                                                                                                                                                                                                            | `"Updated contact info"`  |
| **`company`**  | `string` | **Company name** (if corporate).                                                                                                                                                                                                        | `"Acme Corporation"`      |
| **`status`**   | `string` | <p><strong>Customer status</strong>:<br>- <code>NEW</code><br>- <code>READY\_FOR\_MODERATION</code><br>- <code>MODERATED</code><br>- <code>VERIFY</code><br>- <code>ACCEPT</code><br>- <code>REJECT</code><br>- <code>BANNED</code></p> | `"ACCEPT"`                |
| **`type`**     | `string` | <p><strong>Customer type</strong>:<br>- <code>CORPORATE</code><br>- <code>INDIVIDUAL</code></p>                                                                                                                                         | `"INDIVIDUAL"`            |

**Example Request Body:**

json

```
{
  "name": "John",
  "lastname": "Smith",
  "status": "ACCEPT",
  "comment": "Verified customer"
}
```

***

### **Response (200 OK)**

Returns the updated customer object with all current values.

#### **Response Fields**

| Field             | Type     | Description                       | Example                                  |
| ----------------- | -------- | --------------------------------- | ---------------------------------------- |
| **`cuid`**        | `string` | Customer ID (unchanged).          | `"DqCsgSE-4e95-ViYbNI"`                  |
| **`puid`**        | `string` | Partner ID (unchanged).           | `"127c9ea7-3ea7-4063-9fa4-c69e796c55e4"` |
| **`status`**      | `string` | Updated status.                   | `"ACCEPT"`                               |
| **`createAt`**    | `string` | Original creation timestamp.      | `"2024-01-15T10:30:00Z"`                 |
| **`updateAt`**    | `string` | **New update timestamp**.         | `"2024-05-21T09:15:00Z"`                 |
| **`name`**        | `string` | Updated name.                     | `"John"`                                 |
| **`lastname`**    | `string` | Updated last name.                | `"Smith"`                                |
| **`comment`**     | `string` | Updated comment.                  | `"Verified customer"`                    |
| **`company`**     | `string` | Updated company name.             | `""`                                     |
| **`type`**        | `string` | Customer type.                    | `"INDIVIDUAL"`                           |
| **`balance`**     | `object` | Current balance (unchanged).      | -                                        |
| **`balanceHold`** | `object` | Current held balance (unchanged). | -                                        |

**Money Object**

| Field              | Type      | Description       | Example               |
| ------------------ | --------- | ----------------- | --------------------- |
| **`currencyCode`** | `string`  | Currency code.    | `"USD"`               |
| **`units`**        | `string`  | Whole units.      | `"1500"`              |
| **`nanos`**        | `integer` | Fractional units. | `500000000` (= $0.50) |

**Example Response:**

json

```
{
  "item": {
    "cuid": "DqCsgSE-4e95-ViYbNI",
    "puid": "127c9ea7-3ea7-4063-9fa4-c69e796c55e4",
    "status": "ACCEPT",
    "createAt": "2024-01-15T10:30:00Z",
    "updateAt": "2024-05-21T09:15:00Z",
    "name": "John",
    "lastname": "Smith",
    "comment": "Verified customer",
    "company": "",
    "type": "INDIVIDUAL",
    "balance": {
      "currencyCode": "USD",
      "units": "1500",
      "nanos": 500000000
    },
    "balanceHold": {
      "currencyCode": "USD",
      "units": "250",
      "nanos": 0
    }
  }
}
```

***

### **Examples**

#### **Request**

bash

```
curl -X PATCH 'https://stagep.tst-apidmndelss.com/v2/customer/cust_12345' \
  -H 'Authorization: Bearer eyJhbGci...wNLGA' \
  -H 'Content-Type: application/json' \
  -d '{
    "status": "ACCEPT",
    "comment": "Completed verification"
  }'
```

#### **Corporate Customer Update**

**Request:**

json

```
{
  "company": "Tech Solutions Global",
  "status": "ACCEPT",
  "comment": "Enterprise account approved"
}
```

***

### **Error Responses**

1. **Customer Not Found**:

   json

   ```
   { "error": "Customer not found: cust_99999" }
   ```
2. **Invalid Status**:

   json

   ```
   { "error": "Invalid status transition from BANNED to ACCEPT" }
   ```
3. **Validation Error**:

   json

   ```
   { "error": "Company name required for CORPORATE type" }
   ```

***

### **Notes**

* **Partial Updates**: Only included fields are modified.
* **Status Restrictions**: Some status changes may be restricted (e.g., `BANNED` → `ACCEPT`).
* **Type Changes**: Changing from `INDIVIDUAL` to `CORPORATE` may require additional company fields.

Real request Example

```postman_json
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYxNTcxMTI5LCJrZXkiOiI1Y2ZiOGZjN2RmYjk4ZjVkYmIyZTgwNTVkZWFhN2U2Zjk4MzEyYmE3Iiwib3RwX3ZlcmlmaWVkIjpmYWxzZX0.bC-UKwBwV1qJhkP3dBbU_-Wr0xaLCL-bHXOO0CIP5Cs
customerId*: D7k3xbc-ERrj-lde9k1t3XuaE

```

```postman_json
{
  "name": "SIRIUS SOLUTIONS LTD",
  "lastname": "string",
  "comment": "string",
  "company": "SIRIUS SOLUTIONS LTD",
  "status": "ACCEPT",
  "type": "CORPORATE"
}
```

Real response example

200 OK

```postman_json
{
  "item": {
    "customerId": "D7k3xbc-ERrj-lde9k1t3XuaE",
    "partnerId": "3354815d-1a23-4b1c-81ec-306388cddfa4",
    "status": "ACCEPT",
    "createAt": "2025-09-16T11:33:11Z",
    "updateAt": "2025-10-27T13:13:57Z",
    "name": "SIRIUS SOLUTIONS LTD",
    "lastname": "string",
    "comment": "string",
    "company": "SIRIUS SOLUTIONS LTD",
    "type": "CORPORATE",
    "balance": null,
    "balanceHold": null
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.delos.financial/customer/update-customer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
