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.customerInfo().getCustomer()

πŸ“„ 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
idString?Unique identifier of the customer
idCardNumberString?National ID or card number
nameString?Full name of the customer
occupationAny?Customer’s job or profession
phoneString?Phone number; may be String or other
riskString?Risk level (e.g., "NORMAL", "HIGH", "VERY_HIGH" )
rules[KYCRuleModel]?List of applied verification rules
statusString?Current status (e.g., "PENDING", "APPROVED", "REJECTED")
amlStatusBool?AML (Anti-Money Laundering) check result
missingRules[KYCRuleModel]?Verification rules that are missing or failed
emailVerifiedBool?Whether the email address has been verified
phoneVerifiedBool?Whether the phone number has been verified
bioMatchEnabledBool?Whether biometric verification is enabled

Updating the Customer​

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

    var addressInfo:AddressInfo = AddressInfo(city: "City", address: "address", province:  "Province")
Amani.sharedInstance.customerInfo().setInfo(occupation: "Occupation" , address: addressInfo)
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(location: nil){ ([weak self] (uploadSuccess, error) in
if (uploadSuccess != nil) {
// uploadSuccess is a boolean variable
// TODO: handle the upload state
} else if (error != nil) {
// TODO: handle the error
}
)}

βœ… Enable PIN​

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

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

  self.amaniSDK.customerInfo().enablePin("1234") { result in
switch result {
case .success(let model):
print(model)
case .failure(let error):
print(error)
default:
break
}
}

🚫 Disable PIN​

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

    self.amaniSDK.customerInfo().disablePin { result in
switch result {
case .success(let model):
print(model)
case .failure(let error):
print(error)
default:
break
}
}