OneSDK for KYC
FrankieOne customers can use the OneSDK for their KYC requirements. OneSDK replaces the need for customers to work with multiple service providers by creating a interface for integrating different vendors consistently.
The following sections will help you setup OneSDK for your KYC implementation needs.
Capturing details from an individual
Each instance of OneSDK is initialized with a session that is associated with the user being onboarded. The user may already be represented by an Entity object in the FrankieOne platform, or it may be a new user that isn't known to FrankieOne yet. When initializing OneSDK with an existing entity, OneSDK will load any information that was previously submitted, allowing you to build continuous application experiences across multiple user sessions.
Initialize OneSDK for a new user
When onboarding a new user, you can define a customer reference when creating the OneSDK session object. This customer reference will be associated with the entity to be created.
The following example creates a session object for a user using a customer reference.
ENCODED_CREDENTIAL=$(echo -ne "$YOUR_CUSTOMER_ID:$API_KEY" | base64);
curl https://backend.demo.frankiefinancial.io/auth/v2/machine-session \
-X POST \
-H "Authorization: machine $ENCODED_CREDENTIAL"
-H 'Content-Type: application/json' \
-d '{
"permissions": {
"preset": "one-sdk",
"reference": "YOUR_CUSTOMER_REFERENCE",
}
}';
Initialize OneSDK for an existing user
You can also create the entity in FrankieOne upfront, and use the resulting entity ID to instantiate OneSDK.
ENCODED_CREDENTIAL=$(echo -ne "$YOUR_CUSTOMER_ID:$API_KEY" | base64);
curl https://backend.demo.frankiefinancial.io/auth/v2/machine-session \
-X POST \
-H "Authorization: machine $ENCODED_CREDENTIAL"
-H 'Content-Type: application/json' \
-d '{
"permissions": {
"preset": "one-sdk",
"entityId": "ENTITY_ID_FROM_FRANKIE_ONE",
}
}';
Access the user's information
Obtain the individual
object from the initialized root object.
const config = {
dummy: true // remove this in production
}
const oneSdk = await OneSdk(config);
const individual = oneSdk.individual();
Personal information about the user can be accessed using the access(fieldName)
method. This method returns accessors for the given field.
Get and set values
You can obtain a getter and setter for each field using the individual.access(fieldName)
method.
The following example obtains the name field getter and setter, then updates the values.
const { getValue, setValue } = individual.access('name');
// Get the current values
const { givenName, familyName } = getValue()
// Update the user with new values
setValue({
givenName: "Albert",
familyName: "Einstein",
middleName: "J"
})
Subscribe to changes
The access(fieldName)
method also returns an RXJS.Observable object that allows you to subscribe to changes to the field's value for building reactive applications.
const { observable } = individual.access("name");
observable.subscribe(newName => {
// update your interface with the new value
});
All fields
The supported field names are:
Field name | Description |
---|---|
'entityId' | string |
'name' | { givenName, middleName, familyName } |
'dateOfBirth' | string |
'consentsGiven' | Array of consent keywords string[] that need to be provided before submission |
'addresses' | Array of Address objects associated with the individual. See table below. |
'documents' | ocrResult?: {Described later}, scans: Scan[] }` |
'hasLoaded' | boolean |
The Address
object:
Address
object:Property | Type |
---|---|
addressId | string |
postalCode | string |
state | string |
town | string |
suburb | string |
country | Char3CountryCode |
The Document
object:
Document
object:Property | Type |
---|---|
documentId | string |
idType | 'PASSPORT' or 'DRIVERS_LICENCE' |
country | Char3CountryCode |
idNumber | string |
extraData | Hash of document specific fields. |
ocrResult | OCRResult object (optional) |
scans | Array of Scan objects |
The OCRResult
object
OCRResult
objectThe OCRResult object describes the data that could be extracted from a document image. It consists of fixed and variable properties according to what was extracted.
Fixed properties:
Property | Type |
---|---|
ocrDatetime | DateTimeString |
status | OCRStatus |
mismatch | OCRExtractedFields[] |
documentType | 'PASSPORT' | 'DRIVERS_LICENSE' |
Variable properties:
The OCRResult object will vary based on what was extracted. For example:
{
...,
documentTypeInternal: "DRIVERS_LICENCE",
dateOfExpiry: "2031-05-28",
dateOfIssue: "2021-05-28",
documentType: "DRIVERS_LICENCE",
documentNumber: "999999999",
dateOfBirth: "1990-01-01",
issuingCountry: "AUS",
state: "VIC",
postcode: "3000",
town: "Melbourne",
street: "80 Collins Street",
firstName: "PETER",
lastName: "TESTTHIRTEEN",
}
The Scan
object:
Scan
object:The Scan object represents a captured image of a document.
Property | Type |
---|---|
scanId | string |
mimeType | string |
scanName | string |
side | 'F' or 'B' |
scanCreated | DateTime string |
Submit changes to an individual's details
When you update the details of an individual using OneSDK, the changes are stored locally but are not submitted automatically.
Use the submit()
method to persist the details in the FrankieOne platform.
await individual.submit();
Verify an individual
You may also request checks to be run with the optional parameter { verify: true }
. The submit method will return a CheckSummary
object in this case.
const checkResults = await oneSdkIndividual.submit({
verify: true
});
The CheckSummary
object
CheckSummary
objectObject containing different data regarding check results. More complete details can be retrieved by direct API calls.
Property | Type | Description |
---|---|---|
checkTypes | string[] | An array of strings describing the types of checks that were performed. |
checkDate | DateTimeString | |
status | object | An object describing the entity's overall status. |
status.type | 'failed' , 'passed' , 'fail_manual' , 'pass_manual' , 'refer' , 'wait' , 'unchecked' , 'archived' or 'inactive' | |
risk | object | An object containing the risk level. |
risk.level | number | The entity's overall risk level. |
alertList | Array of Issue objects. | |
checkCounts | ||
checkCounts.name | Array of Source | |
checkCounts.dob | Array of Source | |
checkCounts.address | key is an address ID and each value is the address check count. | |
checkCounts.address[addressId] | Array of Source | |
checkCounts.document | key is a document ID and each value is the document check count. | |
checkCounts.document[documentId] | Array of Source | |
personalChecks | object | |
personalChecks.name | boolean | null | |
personalChecks.dateOfBirth | boolean | null | |
personalChecks.phoneNumber | boolean | null | |
personalChecks.email | boolean | null | |
personalChecks.addresses | object | A hash, where each key is an address ID and each value is the address check result. |
personalChecks.addresses[addressId] | boolean | null |
The Issue
object
Issue
objectThe issue object represents an issue found during the entity verification process.
Property | Type | |
---|---|---|
type | 'warning' , 'alert' , 'success' , 'action' | |
term | '404' , 'partial' , 'duplicate' | A short word used to describe the issue. One of '404' , 'partial' , 'duplicate' |
Updated 10 months ago