[POST] .../v1/retailcustomer/edit
Edits customer. Use this method to update an existing retail customer's group, profile data, contacts, referral, region, description, or additional fields. The request requires id and must provide at least one changed standard field or additional field; the method returns row_affected for the updated customer. The method checks the current request user and requires retail customer edit permission; it validates that the customer exists, validates any supplied group, phone, email, string lengths, and tariff access to additional fields, and returns missing id, no changed data, validation, permission, not-found, tariff, and storage failures as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| address | String | Optional | Customer address. |
| date_of_birth | String | Optional | Customer birth date. |
| description | String | Optional | Customer description or note. |
| String | Optional | Customer email address. | |
| fields | Array of FieldValueEdit | Optional | Custom field values. |
| first_name | String | Optional | Customer first name. |
| group_id | Int64 | Optional | Customer group ID in the system. |
| id | Int64 | Required | Customer ID. |
| last_name | String | Optional | Customer last name. |
| main_phone | String | Optional | Customer primary phone. |
| middle_name | String | Optional | Customer middle name. |
| phones | String | Optional | Additional customer phone numbers. |
| refer_id | Int64 | Optional | ID of the customer who referred this customer. |
| region_id | Int64 | Optional | Region ID. |
| sex | String | Optional | Customer gender. Allowed values: none, male, female. |
Request Example
{
"address": "string",
"date_of_birth": "string",
"description": "string",
"email": "string",
"fields": [
{
"deleted": true,
"key": "string",
"value": "string"
}
],
"first_name": "string",
"group_id": 1,
"id": 1,
"last_name": "string",
"main_phone": "string",
"middle_name": "string",
"phones": "string",
"refer_id": 1,
"region_id": 1,
"sex": "none"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Update | Update operation result. |
Response Example
{
"ok": true,
"result": {
"ids": [
null
],
"row_affected": 1
}
}