getCustomer()
Returns data about customer identified by given token.
Parameters
Name | Type | Description |
---|---|---|
customerToken | string | Token that identifies the customer (see Must know about API). |
- required parameter
Result Parameters
Name | Type | Description |
---|---|---|
id | string | Customer ID |
string | Customer email | |
displayName | string | Name to call the customer. Usually it's a full name, but also might be an email when name is missing |
firstName | string | Customer name |
lastName | string | Customer surname |
currency | string | Customer currency: USD, EUR, GBP, CAD, AUD, NZD, SEK, DKK, NOK, TRL, ZAR, XOF |
locale | string | Defines language and text formatting for the user. E.g. "en_US", "fr_FR" |
country | string | 2-letter country code |
API Request/Response
Request
{
"method":"getCustomer",
"params":{
"customerToken":"VIJYHWzJEP4mt1DZThD7DV_FinBG0Yo3Q9oHfCFAjqA22jXP"
},
"jsonrpc":"2.0",
"id":1
}
Response
{
"result":{
"id":"761790883",
"email":"some-customer@email.com",
"displayName":"John Doe",
"firstName":"John",
"lastName":"Doe",
"currency":"USD",
"locale":"en_US",
"country":"US"
},
"id":"1",
"jsonrpc":"2.0"
}
PHP Example
<?php
$cleengApi = new Cleeng_Api();
$customerInfo = $cleengApi->getCustomer();
echo $customerInfo->displayName;
?>
Error codes
Code | Description |
---|---|
1 | Invalid customer token |