getCustomer

❗️

Deprecated

JSON-RPC getCustomer method is deprecated. Use GET /3.1/customers/{customerId} instead.

Returns data about customer identified by given token.

Parameters

NameTypeDescription
customerToken*stringToken that identifies the customer (see Must know about API).

Result Parameters

NameTypeDescription
idstringCustomer ID
emailstringCustomer email
displayNamestringName to call the customer. Usually it's a full name, but also might be an email when name is missing
firstNamestringCustomer name
lastNamestringCustomer surname
currencystringCustomer currency: USD, EUR, GBP, CAD, AUD, NZD, SEK, DKK, NOK, TRL, ZAR, XOF
localestringDefines language and text formatting for the user. E.g. "en_US", "fr_FR"
countrystring2-letter country code
externalIdstringExternal 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

CodeDescription
1Invalid customer token