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.

Add the imports below:

import ai.amani.sdk.Amani
import ai.amani.sdk.model.customer.CustomerDetailResult
import ai.amani.sdk.modules.customer.detail.CustomerDetailObserver

Then fetch the latest customer details as shown below:

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.

Add the imports below:

import ai.amani.sdk.Amani

Then update the customer fields locally as shown 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 optional. 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.

Add the imports below:

import ai.amani.sdk.Amani

Then upload the updated customer data as shown below:

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.

Add the imports below:

import ai.amani.sdk.Amani
import ai.amani.sdk.interfaces.PINCallback

Then enable a PIN for the current customer as shown below:

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")
}
}
)

βœ… Accept Terms & Conditions​

Use acceptTermsConditions() to record the customer's acceptance of the Terms & Conditions.

note

This feature depends on remote configuration. Contact the Amani team to enable it for your account.

Add the imports below:

import ai.amani.sdk.Amani
import ai.amani.sdk.interfaces.TermsConditionsCallback

Then record the customer's Terms & Conditions acceptance as shown below:

Amani.sharedInstance().CustomerInfo().acceptTermsConditions(
callback = object : TermsConditionsCallback {
override fun onSuccess() {
Log.d(TAG, "TermsConditions accept working fine")
}

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

🚫 Disable PIN​

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

Add the imports below:

import ai.amani.sdk.Amani
import ai.amani.sdk.interfaces.PINCallback

Then disable the customer's PIN as shown below:

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")
}
}
)