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.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
idIntegerID of customer to update.Yes
accountStringAccount number for vouchers.NoCurrent value.
address1StringAddress line 1.NoCurrent value.
address2StringAddress line 2.NoCurrent value.
address3StringAddress line 3.NoCurrent value.
address_cityStringAddress city.NoCurrent value.
address_codeStringPost or zip code.NoCurrent value.
address_otherStringAddress other information.NoCurrent value.
address_stateStringAddress state.NoCurrent value.
affiliate_customerIntegerID of affiliate customer. 0 for none.NoCurrent value.
affiliate_percentageIntegerPercentage to give affiliate.NoCurrent value.
affiliate_typeString"revenue", "profit" or empty string for none.NoCurrent value.
auto_topupDecimalRequest auto-topup when balance falls below this amount. Has no effect unless email_low_balance=1.NoCurrent value.
balanceDecimalBalance.NoCurrent value.
bank_account_nameStringBank account name.NoCurrent value.
bank_account_numberStringBank account number.NoCurrent value.
bank_codeStringBank code.NoCurrent value.
bank_nameStringBank name.NoCurrent value.
bill_refStringBilling reference.NoCurrent value.
bill_typeStringBilling type. "callshop", "external", "none", "postpaid", "prepaid", "prepaid_calls", or "prepaid_invoices".NoCurrent value.
bulk_callsIntegerMaximum concurrent bulk dialler calls. -1 for default limit. -2 for rate plan setting.NoCurrent value.
call_maximumDecimalMaximum call spending per day. -1 for no limit. -2 for rate plan setting.NoCurrent value.
calleridStringDefault callerid. Empty string for none.NoCurrent value.
callerid_in_externalIntegerWhether to send external callerid to telephones. 1 for yes, 0 for no. -2 for rate plan setting.NoCurrent value.
common_routingIntegerOther customers to check for call routing. 0 for none. Logical 1 for parent, 2 for siblings and 4 for children.NoCurrent value.
conference_callsIntegerMaximum concurrent conference calls. -1 for no limit. -2 for rate plan setting.NoCurrent value.
contactIntegerID of person who is primary contact. 0 for none.NoCurrent value.
contractStringMinimum 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.NoCurrent value.
cosIntegerID of default class of service. 1 for system COS that allows all calls.NoCurrent value.
countryStringAddress country.NoCurrent value.
creditDecimalMaximum amount customer may go into negative balance.NoCurrent value.
credit_extraDecimalTemporary amount added to credit.NoCurrent value.
credit_extra_timegroupIntegerID of time group when extra credit is active. 0 for always.NoCurrent value.
creditcard_expiry_monthIntegerCredit card expiry month from 1 to 12.NoCurrent value.
creditcard_expiry_yearIntegerCredit card expiry year.NoCurrent value.
creditcard_issueIntegerCredit card issue number.NoCurrent value.
creditcard_nameStringCredit card name.NoCurrent value.
creditcard_numberStringCredit card number. If empty and creditcard_verification is also empty, any existing values for both will be removed.NoCurrent value.
creditcard_start_monthIntegerCredit card start month from 1 to 12.NoCurrent value.
creditcard_start_yearIntegerCredit card start year.NoCurrent value.
creditcard_typeStringCredit card type.NoCurrent value.
creditcard_verificationStringCredit card verification number. If empty and creditcard_number is also empty, any existing values for both will be removed.NoCurrent value.
currencyStringCurrency.NoCurrent value.
descriptionStringDescription.NoCurrent value.
dialplanStringDial plan.NoCurrent value.
digit_namesStringThe order digit names are in. "forename_surname" or "surname_forename".NoCurrent value.
direct_debit_agreedInteger1 if the customer has agreed to pay by direct debit, 0 if they haven't.NoCurrent value.
directoryInteger1 to include in directory, 0 not to.NoCurrent value.
emailStringEmail address.NoCurrent value.
email_low_balanceInteger1 to send customer an email when balance falls below a threshold, 0 not to.NoCurrent value.
events_urlStringURL to send events to. Empty string for none.NoEmpty string.
faxStringFax number.NoCurrent value.
fax_formatStringThe format faxes are saved in. "pdf" or "tiff".NoCurrent value.
google_checkout_idStringGoogle Checkout ID. Affects system owner customer and resellers only.NoCurrent value.
google_checkout_keyStringGoogle Checkout key. Affects system owner customer and resellers only.NoCurrent value.
huntgroup_destsIntegerMaximum destinations per hunt group. -1 for no limit. -2 for rate plan setting.NoCurrent value.
inmaximumIntegerMaximum inbound calls. -1 for no limit. -2 for rate plan setting.NoCurrent value.
invoice_prefixStringA prefix to use on invoices to customers. Affects system owner customer and resellers only.NoCurrent value.
invoicesStringWhat to do with invoices. "plan" for rate plan setting, "queue", "customer", "parent", or empty string.NoCurrent value.
invoice_detailStringThe detail to include in invoices. "plan" for rate plan setting, "summary", "transactions", "cdrs", "direction_cdrs", "group_cdrs", "source_cdrs", "transactions_cdrs", "transactions_direction_cdrs", "transactions_group_cdrs", or "transactions_source_cdrs".NoCurrent value.
invoices_dueIntegerThe number of days after creation invoices are due. -1 for never. -2 for the rate plan setting.NoCurrent value.
invoice_formatStringInvoice format. "plan" for rate plan setting, "pdf", or "xml".NoCurrent value.
lockedInteger1 to lock customer from using web interface, 0 not to.NoCurrent value.
locked_telephonyInteger1 to lock customer from using telephony, 0 not to.NoCurrent value.
low_balanceDecimalLow balance threshold.NoCurrent value.
maxmsgString or integerThe maximum number of messages per mailbox directory. "plan" for rate plan setting.NoCurrent value.
merchant_passwordStringThe password to send to the merchant gateway. Affects system owner customer and resellers only.NoCurrent value.
merchant_typeStringThe merchant gateway to use. Affects system owner customer and resellers only.NoCurrent value.
merchant_usernameStringThe user name to send to the merchant gateway. Affects system owner customer and resellers only.NoCurrent value.
musicIntegerID of default music. 0 for system default.NoCurrent value.
nameStringName.NoCurrent value.
next_invoiceIntegerThe number of the next invoice to send. Affects system owner customer and resellers only.NoCurrent value.
outmaximumIntegerMaximum outbound calls. -1 for no limit. -2 for rate plan setting.NoCurrent value.
on_errorString"hangup" to hang up on error, "message" to play a message.NoCurrent value.
overmaxInteger1 to allow customer to go over maximum calls. 0 not to. -2 for rate plan setting.NoCurrent value.
pagegroup_destsIntegerMaximum destinations per page group. -1 for no limit. -2 for rate plan setting.NoCurrent value.
park_timeoutIntegerParking timeout in seconds.NoCurrent value.
payment_typeStringPayment type. "creditcard", "direct_debit", "external", or "none".NoCurrent value.
paypalStringPayPal account. Affects system owner customer and resellers only.NoCurrent value.
peer1IntegerID of peer to route all outbound calls to. -2 for rate plan setting.NoCurrent value.
planIntegerID of rate plan customer is on.NoCurrent value.
prefixStringPrefix.NoCurrent value.
provision_passwordStringProvisioning password.NoCurrent value.
purge_messagesIntegerWhen 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.NoCurrent value.
queue_callsIntegerMaximum concurrent queue calls. -1 for no limit. -2 for rate plan setting.NoCurrent value.
queue_destsIntegerMaximum destinations per queue. -1 for no limit. -2 for rate plan setting.NoCurrent value.
record_maximumIntegerMaximum number of seconds of record to keep when fees run. -1 for unlimited. -2 for rate plan setting.NoCurrent value.
regionIntegerRegion. 0 for none.NoCurrent value.
seconds_leftIntegerThe number of included seconds the customer has available.NoCurrent value.
tax_numberStringTax number.NoCurrent value.
technical_contactStringTechnical contact email address(es). Separate addresses with spaces.NoCurrent value.
telephoneStringTelephone number.NoCurrent value.
timezoneStringTime zone. Empty string for system default.NoCurrent value.
totalmaximumIntegerMaximum total calls. -1 for no limit. -2 for rate plan setting.NoCurrent value.
virtual_logoutInteger1 to log out virtual phones each night, 0 not to.NoCurrent value.
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
201Input passed validation. Only returned if validation=1.
204Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.
404The 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

VersionChanges
3.14bulk_calls, conference_calls, cos, events_url, huntgroup_dests, pagegroup_dests, queue_calls, and queue_dests input parameters added.
3.13Function added.