JSON API » customers » customers/update
Updates an existing customer.
Input parameters
Requires authentication and the administrator, commerce, or wholesale role privileges. If you don't have the commerce role privilege, you may only update your own customer.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
id | Integer | ID of customer to update. | Yes | |
account | String | Account number for vouchers. | No | Current value. |
address1 | String | Address line 1. | No | Current value. |
address2 | String | Address line 2. | No | Current value. |
address3 | String | Address line 3. | No | Current value. |
address_city | String | Address city. | No | Current value. |
address_code | String | Post or zip code. | No | Current value. |
address_other | String | Address other information. | No | Current value. |
address_state | String | Address state. | No | Current value. |
affiliate_customer | Integer | ID of affiliate customer. 0 for none. | No | Current value. |
affiliate_percentage | Integer | Percentage to give affiliate. | No | Current value. |
affiliate_type | String | "revenue", "profit" or empty string for none. | No | Current value. |
auto_topup | Decimal | Request auto-topup when balance falls below this amount. Has no effect unless email_low_balance=1. | No | Current value. |
balance | Decimal | Balance. | No | Current value. |
bank_account_name | String | Bank account name. | No | Current value. |
bank_account_number | String | Bank account number. | No | Current value. |
bank_code | String | Bank code. | No | Current value. |
bank_name | String | Bank name. | No | Current value. |
bill_ref | String | Billing reference. | No | Current value. |
bill_type | String | Billing type. "callshop", "external", "none", "postpaid", "prepaid", "prepaid_calls", or "prepaid_invoices". | No | Current value. |
bulk_calls | Integer | Maximum concurrent bulk dialler calls. -1 for default limit. -2 for rate plan setting. | No | Current value. |
call_maximum | Decimal | Maximum call spending per day. -1 for no limit. -2 for rate plan setting. | No | Current value. |
callerid | String | Default callerid. Empty string for none. | No | Current value. |
callerid_in_external | Integer | Whether to send external callerid to telephones. 1 for yes, 0 for no. -2 for rate plan setting. | No | Current value. |
common_routing | Integer | Share features with parent and related customers. 1 for yes. 0 for no. | No | Current value. |
conference_calls | Integer | Maximum concurrent conference calls. -1 for no limit. -2 for rate plan setting. | No | Current value. |
contact | Integer | ID of person who is primary contact. 0 for none. | No | Current value. |
contract | String | Minimum contract. "plan" for rate plan setting, "1_month", "3_month", "6_month", "1_year", "18_month", "2_year", "3_year", or empty string for none. | No | Current value. |
cos | Integer | ID of default class of service. 1 for system COS that allows all calls. | No | Current value. |
country | String | Address country. | No | Current value. |
credit | Decimal | Maximum amount customer may go into negative balance. | No | Current value. |
credit_extra | Decimal | Temporary amount added to credit. | No | Current value. |
credit_extra_timegroup | Integer | ID of time group when extra credit is active. 0 for always. | No | Current value. |
creditcard_expiry_month | Integer | Credit card expiry month from 1 to 12. | No | Current value. |
creditcard_expiry_year | Integer | Credit card expiry year. | No | Current value. |
creditcard_issue | Integer | Credit card issue number. | No | Current value. |
creditcard_name | String | Credit card name. | No | Current value. |
creditcard_number | String | Credit card number. If empty and creditcard_verification is also empty, any existing values for both will be removed. | No | Current value. |
creditcard_start_month | Integer | Credit card start month from 1 to 12. | No | Current value. |
creditcard_start_year | Integer | Credit card start year. | No | Current value. |
creditcard_type | String | Credit card type. | No | Current value. |
creditcard_verification | String | Credit card verification number. If empty and creditcard_number is also empty, any existing values for both will be removed. | No | Current value. |
currency | String | Currency. | No | Current value. |
description | String | Description. | No | Current value. |
dialplan | String | Dial plan. | No | Current value. |
digit_names | String | The order digit names are in. "forename_surname" or "surname_forename". | No | Current value. |
direct_debit_agreed | Integer | 1 if the customer has agreed to pay by direct debit, 0 if they haven't. | No | Current value. |
directory | Integer | 1 to include in directory, 0 not to. | No | Current value. |
String | Email address. | No | Current value. | |
email_low_balance | Integer | 1 to send customer an email when balance falls below a threshold, 0 not to. | No | Current value. |
events_url | String | URL to send events to. Empty string for none. | No | Empty string. |
fax | String | Fax number. | No | Current value. |
fax_format | String | The format faxes are saved in. "pdf" or "tiff". | No | Current value. |
google_checkout_id | String | Google Checkout ID. Affects system owner customer and resellers only. | No | Current value. |
google_checkout_key | String | Google Checkout key. Affects system owner customer and resellers only. | No | Current value. |
huntgroup_dests | Integer | Maximum destinations per hunt group. -1 for no limit. -2 for rate plan setting. | No | Current value. |
inmaximum | Integer | Maximum inbound calls. -1 for no limit. -2 for rate plan setting. | No | Current value. |
invoice_prefix | String | A prefix to use on invoices to customers. Affects system owner customer and resellers only. | No | Current value. |
invoices | String | What to do with invoices. "plan" for rate plan setting, "queue", "customer", "parent", or empty string. | No | Current value. |
invoice_detail | String | The detail to include in invoices. "plan" for rate plan setting, "summary", "transactions", "cdrs", "direction_cdrs", "group_cdrs", "source_cdrs", "group_transactions", "group_transactions_cdrs", "group_transactions_direction_cdrs", "group_transactions_group_cdrs", "group_transactions_source_cdrs", "transactions_cdrs", "transactions_direction_cdrs", "transactions_group_cdrs", or "transactions_source_cdrs". | No | Current value. |
invoices_due | Integer | The number of days after creation invoices are due. -1 for never. -2 for the rate plan setting. | No | Current value. |
invoice_format | String | Invoice format. "plan" for rate plan setting, "pdf", or "xml". | No | Current value. |
locked | Integer | 1 to lock customer from using web interface, 0 not to. | No | Current value. |
locked_telephony | Integer | 1 to lock customer from using telephony, 0 not to. | No | Current value. |
low_balance | Decimal | Low balance threshold. | No | Current value. |
maxmsg | String or integer | The maximum number of messages per mailbox directory. "plan" for rate plan setting. | No | Current value. |
maxsecs | Integer | Maximum message duration in seconds. "plan" for rate plan setting. | No | Current value. |
merchant_password | String | The password to send to the merchant gateway. Affects system owner customer and resellers only. | No | Current value. |
merchant_type | String | The merchant gateway to use. Affects system owner customer and resellers only. | No | Current value. |
merchant_username | String | The user name to send to the merchant gateway. Affects system owner customer and resellers only. | No | Current value. |
music | Integer | ID of default music. 0 for system default. | No | Current value. |
name | String | Name. | No | Current value. |
next_invoice | Integer | The number of the next invoice to send. Affects system owner customer and resellers only. | No | Current value. |
outmaximum | Integer | Maximum outbound calls. -1 for no limit. -2 for rate plan setting. | No | Current value. |
on_error | String | "hangup" to hang up on error, "message" to play a message. | No | Current value. |
overmax | Integer | 1 to allow customer to go over maximum calls. 0 not to. -2 for rate plan setting. | No | Current value. |
pagegroup_dests | Integer | Maximum destinations per page group. -1 for no limit. -2 for rate plan setting. | No | Current value. |
park_timeout | Integer | Parking timeout in seconds. | No | Current value. |
payment_type | String | Payment type. "creditcard", "direct_debit", "external", or "none". | No | Current value. |
paypal | String | PayPal account. Affects system owner customer and resellers only. | No | Current value. |
peer1 | Integer | ID of peer to route all outbound calls to. -2 for rate plan setting. | No | Current value. |
plan | Integer | ID of rate plan customer is on. | No | Current value. |
prefix | String | Prefix. | No | Current value. |
provision_password | String | Provisioning password. | No | Current value. |
purge_messages | Integer | When to purge old voicemails and faxes. "plan" for rate plan setting, "1_day", "1_week", "1_month", "3_months", "6_months", "1_year", or empty string for never. | No | Current value. |
queue_calls | Integer | Maximum concurrent queue calls. -1 for no limit. -2 for rate plan setting. | No | Current value. |
queue_dests | Integer | Maximum destinations per queue. -1 for no limit. -2 for rate plan setting. | No | Current value. |
record_maximum | Integer | Maximum number of seconds of record to keep when fees run. -1 for unlimited. -2 for rate plan setting. | No | Current value. |
region | Integer | Region. 0 for none. | No | Current value. |
seconds_left | Integer | The number of included seconds the customer has available. | No | Current value. |
source | String | Only allow from this IP address. Empty string for any. | No | Current value. |
tax_number | String | Tax number. | No | Current value. |
technical_contact | String | Technical contact email address(es). Separate addresses with spaces. | No | Current value. |
telephone | String | Telephone number. | No | Current value. |
timezone | String | Time zone. Empty string for system default. | No | Current value. |
totalmaximum | Integer | Maximum total calls. -1 for no limit. -2 for rate plan setting. | No | Current value. |
virtual_logout | Integer | 1 to log out virtual phones each night, 0 not to. | No | Current value. |
validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
Code | Description |
---|---|
201 | Input passed validation. Only returned if validation=1. |
204 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
404 | The customer does not exist, or you do not have permission to update it. |
Data returned
No data is returned.
Example: Changing the name
http://enswitch.example.com/api/json/customers/update/?auth_username=user;auth_password=password;id=123;name=example{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
Version | Changes |
---|---|
3.15 | invoice_detail parameter updated to include grouped transactions. maxsecs and source input parameters added. |
3.14 | bulk_calls, conference_calls, cos, events_url, huntgroup_dests, pagegroup_dests, queue_calls, and queue_dests input parameters added. |
3.13 | Function added. |