Overview
You can retrieve the properties of a customer with this request. Use the customer’s ID to specify which customer’s details you need to retrieve.
The Method
Type | Request | Method |
---|---|---|
REST | REST | https://[Your URL]/api/2.0/customers/:id |
XML-RPC | Call | GetCustomer |
Your URL is the address of your install.
Your method must be structured as follows:
GetCustomer(integer $id) : object
Parameters
You must include the customer’s ID in order for this request to return the correct details.
Property | Type | Description | Required |
---|---|---|---|
$id | integer | The id of the customer you want to retrieve. | yes |
Responses
Type | Description |
---|---|
object | The customer object. |
Code Samples
PHP (using the REST API)
$url = '(Your URL)/api/2.0/customers/:customer_id; $method = 'GET'; $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_HTTPHEADER, $headers); $result = curl_exec($cSession); curl_close($cSession);