Updates a customer. Only the fields you pass are changed, the rest stay as they were.
v1/customers/edit.php
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| customer_id | int | Yes | Customer ID |
| name | string | No | Name |
| string | No | ||
| phone | string | No | Phone |
| address_legal | string | No | Legal address |
| address_real | string | No | Delivery address |
| agreement | string | No | Agreement |
| manager_name | string | No | Manager |
| manager_post | string | No | Manager's position |
| notes | string | No | Notes |
To clear a field, pass an empty string. Passing null leaves the field unchanged, as if it were not sent.
Example request
{
"customer_id": 512,
"phone": "+1 212 555-0199",
"address_real": "3 Factory St, New York"
}
Example response
{
"success": true
}
Errors
| Error | Reason |
|---|---|
| No customer_id in input | customer_id is missing |
| Customer not found or access denied | Customer not found or deleted |
| Name must not be empty | An empty name was passed |
| Name must be a string | name passed as an array or object |