Update a customer
updateCustomer changes a customer that belongs directly to the authenticated customer, the same as saving the customer form in the panel. Send only the parameters you change.
The method supports trusted mode with i_wholesaler, the ID of the customer that owns the one you change.
The authenticated customer needs the right to edit customers (bit 2 of its customers_mgmt).
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_customer |
int | yes | ID of the customer. It must be your direct sub-customer |
ignore_accounts_matching_rule |
boolean | no | True saves a new accounts_matching_rule even when existing accounts do not match it. Default False: the call fails instead |
any parameter of createCustomer |
no | The new value, with the rules below |
balanceandmax_depthcannot be changed and are ignored. Change the balance with payments.i_tariffmust be a tariff in the customer’s base currency.web_passwordcannot repeat the current or a recent previous password.i_routing_groupalso changes the sub-customers below that use the same routing group.dncl_enabledapplies to the customer and all its sub-customers.did_pool_enabled,ivr_apps_enabled,asr_acd_enabled,debit_credit_cards_enabledandconferencing_enabledset toFalseturn the feature off for the customer and all its sub-customers.share_payment_processorsset toFalseremoves the payment processors the customer inherited.
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
Example
Section titled “Example”call("updateCustomer", { "i_customer": 3, "credit_limit": 1000.0, "email": "noc@acme.example",}){"result": "OK"}Errors
Section titled “Errors”| faultCode | faultString | Cause |
|---|---|---|
401 |
You do not have permissions to use this API call. |
You have no right to edit customers |
401 |
Unable to get customer info. |
No customer with this i_customer belongs directly to you |
401 |
Wrong i_tariff parameter. |
The tariff’s currency differs from the customer’s base currency |
400 |
You may not re-use web_password password. |
The new web_password was used recently |
405 |
There are accounts not matching accounts_matching_rule. |
Existing accounts do not match the new rule. Fix the rule or send ignore_accounts_matching_rule |
The other faults of createCustomer apply to the same parameters.
Related
Section titled “Related”- Customers: the customer form
- Get customer information
- Create a customer
- Block and unblock customers