Skip to main content

Customer Info

This section refers to CustomerDetail and CustomerInfo modules.

Getting the Detailed Customer Information​

To get the latest updated details about the customer, you can call getCustomerDetail method.

Amani.sharedInstance().CustomerDetail().getCustomerDetail(object : CustomerDetailObserver { 
override fun result(customerDetail: CustomerDetailResult?, throwable: Throwable?) {

if (customerDetail != null) {
//Customer detail fetched successfully
}

if (throwable != null) {
//Error happened during fetch process
}
}
})

πŸ“„ CustomerDetailResult Fields​

Property NameData TypeDescription
addressAny?Customer's address; can be various types (String, Map, etc.)
birthdateString?Date of birth (format: YYYY-MM-DD)
emailAny?Email address; type may vary
genderAny?Gender of the customer; flexible type
idString?Unique identifier of the customer
idCardNumberString?National ID or card number
nameString?Full name of the customer
nationalityAny?Nationality; can be different formats
occupationAny?Customer’s job or profession
phoneAny?Phone number; may be String or other
photoString?Customer’s photo (URL or base64 encoded)
rejectReasonAny?Reason for verification rejection
riskString?Risk level (e.g., "NORMAL", "HIGH", "VERY_HIGH" )
rulesList<Rule>?List of applied verification rules
statusString?Current status (e.g., "PENDING", "APPROVED", "REJECTED")
amlStatusBoolean?AML (Anti-Money Laundering) check result
verificationStepsList<String?>?Steps taken during verification
missingRulesList<MissingRule?>?Verification rules that are missing or failed
emailVerifiedBoolean? = falseWhether the email address has been verified
phoneVerifiedBoolean? = falseWhether the phone number has been verified
bioMatchEnabledBoolean? = nullWhether biometric verification is enabled

Updating the Customer​

You can just call the setInfo method as shown in the example below.

Amani.sharedInstance().CustomerInfo().setInfo(
city = "New York",
province = "New York",
address = "123 Main Street, Manhattan",
occupation = "Software Developer",
phoneNumber = "+1 212 555 7890",
email = "john.doe@example.com",
fullName = "John Doe",
birthDate = "1988-07-22"
)
note

All the fields in this function are optionals. If you give them null and call upload it'll remove those fields from our side.

If you don't call the upload method, it won't update.

Uploading the Updated Customer Data​

After calling the setInfo, you must call the `upload to reflect the changes to our system.

Amani.sharedInstance().CustomerInfo().upload { isSuccess ->  
if (isSuccess) {
// Uploading CustomerInfo is successful.
}
}

βœ… Enable PIN​

  • If the bioMatchEnabled parameter is returned as true from the getCustomerDetail function, you can use it to check in advance whether PIN authentication is active.

Use enablePin() to activate a PIN for the current customer.

Amani.sharedInstance().CustomerInfo().enablePin(
pin = "4444", // 4-digit numeric PIN
callback = object : PINCallback {
override fun onSuccess() {
// PIN successfully enabled
}

override fun onError(exception: Exception) {
Log.e(TAG, "PIN enabling failed! $exception")
}
}
)

🚫 Disable PIN​

You can disable the previously enabled customer PIN using the disablePin() function in the Amani SDK.

Amani.sharedInstance().CustomerInfo().disablePin(
callback = object : PINCallback {
override fun onSuccess() {
// PIN successfully disabled
}

override fun onError(exception: Exception) {
Log.e(TAG, "PIN disabling failed! $exception")
}
}
)