❗️ JSON-RPC getCustomer method is deprecated . Use GET /3.1/customers/{customerId} instead.
Returns data about customer identified by given token.
Name Type Description customerToken* string Token that identifies the customer (see Must know about API).
Name Type Description id string Customer ID email 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.
JSON
{
"method":"getCustomer",
"params":{
"customerToken":"VIJYHWzJEP4mt1DZThD7DV_FinBG0Yo3Q9oHfCFAjqA22jXP"
},
"jsonrpc":"2.0",
"id":1
}
JSON
{
"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
<?php
$cleengApi = new Cleeng_Api();
$customerInfo = $cleengApi->getCustomer();
echo $customerInfo->displayName;
?>
Code Description 1 Invalid customer token