Deprecated
JSON-RPC
getCustomer
method is deprecated. Use GET /3.1/customers/{customerId} instead.
Returns data about customer identified by given token.
Parameters
Name | Type | Description |
---|---|---|
customerToken* | string | Token that identifies the customer (see Must know about API). |
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 |
externalId | string | External ID of customer. |
API Request/Response
Request
{
"method":"getCustomer",
"params":{
"customerToken":"VIJYHWzJEP4mt1DZThD7DV_FinBG0Yo3Q9oHfCFAjqA22jXP"
},
"jsonrpc":"2.0",
"id":1
}
Response
{
"result":{
"id":"761790883",
"email":"[email protected]",
"displayName":"John Doe",
"firstName":"John",
"lastName":"Doe",
"currency":"USD",
"locale":"en_US",
"country":"US",
"externalId": "38523523589UAD"
},
"id":"1",
"jsonrpc":"2.0"
}
PHP Example
<?php
$cleengApi = new Cleeng_Api();
$customerInfo = $cleengApi->getCustomer();
echo $customerInfo->displayName;
?>
ErrorCodes
Code | Description |
---|---|
1 | Invalid customer token |