Overview

You can use this request to update a specific customer’s properties. Use the customer’s ID to specify which customer to update, and submit the properties to update in a table.

The Method

TypeRequestMethod
RESTPUThttps://[Your URL]/api/2.0/customers/:id
XML-RPCCallGetCustomer

Your method must be structured as follows:

Parameters

Required Parameters

You must specify the ID of the customer you want to update.

Property TypeDescriptionRequired
$id integerThe ID of the customer you need to update.yes
$propertiesstructarray The properties of the customer which need to be updated.
Required properties are:
hash
name
email
(See Properties table below for more details.)
yes
Properties

You can update the following properties using this request:

PropertyTypeDescriptionDefaultRequiredRead Only
namestringNameemptyyesno
status stringStatus
Possible values: on / off / suspended / deleted
emptynono
emailstringEmailemptyyesno
email_package_idintegerPackage identifieremptynono
email_quotaintegerPrepaid email quota emptynono
sms_quotaintegerPrepaid SMS quota emptynono
transactions_package_idintegerPackage Identifieremptynono
transactions_quotaintegerTransactions prepaid quota.emptynono
deletedstringCustomer deleted Possible values: yes / noemptynono
addressstringAddressemptynono
state_provincesstringState or Province emptynono
postal_codestringPostal or Zip code.emptynono
telephonestringTelephone number.emptynono
website_urlstringWebsite URL.emptynono
countrystringTwo-character country code.emptynono
industrystringCustomer industry.
Possible values: Personal Use, Agriculture & Environmental, Automotive, Business & Consulting Services, E-commerce, Education & Training, Financial Institutions, Governmental Organisations, Hospitality, Travel & Tourism, Industry, Trade & Manufacture, Lifestyle, Arts & Entertainment, Logistic Services, Publishing & Media, Agencies & Marketing, Medical & Healthcare, Non Governmental Organisations, Property & Real Estate, Retail & Wholesale, Technology & Science.
emptynono
unique_idstringUnique customer identifier.emptynono

Responses

TypeDescription
objectThe properties of the created customer.

Code Samples

PHP (using the REST API)

$json = '
{
"email":"[email protected]"
}
';
$url = '(Your URL)/api/2.0/customers/:customer_id;
$method = 'PUT';
$cSession = curl_init();
$headers = array();
$auth = base64_encode($username . ':' . $apikey);
$headers[] = 'Authorization: Basic ' . $auth;
curl_setopt($cSession, CURLOPT_URL, $url);
curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cSession, CURLOPT_HEADER, false);
curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method));
curl_setopt($cSession, CURLOPT_POSTFIELDS, $json);
$headers[] = 'Content-Type: application/json';
curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($cSession);
curl_close($cSession);