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

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

Your method must be structured as follows:

Parameters

You must include the customer’s ID in order for this request to return the correct details.

Property TypeDescriptionRequired
$idintegerThe id of the customer you want to retrieve.yes

Responses

TypeDescription
objectThe 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);