Class: CoreAPI

CoreAPI(apikey, region)

new CoreAPI(apikey, region)

Initialize Core API with an API key and optional region (US, EU)
Parameters:
Name Type Default Description
apikey string You API key
region string US US/EU
Source:
Throws:
Error

Methods

enableAMLCheck(enabled)

Check document holder's name and document number against ID Analyzer AML Database for sanctions, crimes and PEPs.
Parameters:
Name Type Default Description
enabled boolean false Enable or disable AML/PEP check
Source:

enableAMLStrictMatch(enabled)

By default, entities with identical name or document number will be considered a match even though their birthday or nationality may be unknown. Enable this parameter to reduce false-positives by only matching entities with exact same nationality and birthday.
Parameters:
Name Type Default Description
enabled boolean false Enable or disable AML strict match mode
Source:

enableAuthentication(enabled, module)

Validate the document to check whether the document is authentic and has not been tampered, and set authentication module
Parameters:
Name Type Default Description
enabled boolean false Enable or disable Document Authentication
module * 2 Module: 1, 2 or quick
Source:
Throws:
Error

enableBarcodeMode(enabled)

Disable Visual OCR and read data from AAMVA Barcodes only
Parameters:
Name Type Default Description
enabled boolean false Enable or disable Barcode Mode
Source:

enableDualsideCheck(enabled)

Check if the names, document number and document type matches between the front and the back of the document when performing dual-side scan. If any information mismatches error 14 will be thrown.
Parameters:
Name Type Default Description
enabled boolean false
Source:

enableImageOutput(cropDocument, cropFace, outputFormat)

Generate cropped image of document and/or face, and set output format [url, base64]
Parameters:
Name Type Default Description
cropDocument boolean false Enable or disable document cropping
cropFace boolean false Enable or disable face cropping
outputFormat string url "url" or "base64", defaults to "url"
Source:
Throws:
Error

enableVault(enabled, saveUnrecognized, noDuplicateImage, autoMergeDocument)

Save document image and parsed information in your secured vault. You can list, search and update document entries in your vault through Vault API or web portal.
Parameters:
Name Type Default Description
enabled boolean true Enable or disable Vault
saveUnrecognized boolean false Save document image in your vault even if the document cannot be recognized.
noDuplicateImage boolean false Prevent duplicated images from being saved.
autoMergeDocument boolean false Automatically merge images with same document number into a single entry inside vault.
Source:

generateContract(templateId, format, prefillData)

Generate legal document using data from user uploaded ID
Parameters:
Name Type Default Description
templateId string Contract Template ID displayed under web portal
format string PDF Output file format: PDF, DOCX or HTML
prefillData object Object or JSON string, to autofill dynamic fields in contract template.
Source:
Throws:
Error

resetConfig()

Reset all API configurations except API key and region.
Source:

restrictCountry(countryCodes)

Check if the document was issued by specified countries, if not error code 10 will be thrown. Separate multiple values with comma. For example "US,CA" would accept documents from United States and Canada.
Parameters:
Name Type Default Description
countryCodes string US,CA,UK ISO ALPHA-2 Country Code separated by comma
Source:

restrictState(states)

Check if the document was issued by specified state, if not error code 11 will be thrown. Separate multiple values with comma. For example "CA,TX" would accept documents from California and Texas.
Parameters:
Name Type Default Description
states string CA,TX State full name or abbreviation separated by comma
Source:

restrictType(documentType)

Check if the document was one of the specified types, if not error code 12 will be thrown. For example, "PD" would accept both passport and drivers license.
Parameters:
Name Type Default Description
documentType string DIP P: Passport, D: Driver's License, I: Identity Card
Source:

scan() → {object}

Scan an ID document with Core API, optionally specify document back image, face verification image, face verification video and video passcode
Parameters:
Name Type Description
options.document_primary string Front of Document (File path, base64 content or URL)
options.document_secondary string Back of Document (File path, base64 content or URL)
options.biometric_photo string Face Photo (File path, base64 content or URL)
options.biometric_video string Face Video (File path, base64 content or URL)
options.biometric_video_passcode string Face Video Passcode (4 Digit Number)
Source:
Throws:
Error
Returns:
Type
object

setAccuracy(accuracy)

Set OCR Accuracy
Parameters:
Name Type Default Description
accuracy number 2 0 = Fast, 1 = Balanced, 2 = Accurate
Source:

setAMLDatabase(databases)

Specify the source databases to perform AML check, if left blank, all source databases will be checked. Separate each database code with comma, for example: un_sc,us_ofac. For full list of source databases and corresponding code visit AML API Overview.
Parameters:
Name Type Default Description
databases string au_dfat,ca_dfatd,ch_seco,eu_fsf,fr_tresor_gels_avoir,gb_hmt,ua_sfms,un_sc,us_ofac,eu_cor,eu_meps,global_politicians,interpol_red Database codes separated by comma
Source:

setBiometricThreshold(threshold)

Set the minimum confidence score to consider faces being identical
Parameters:
Name Type Default Description
threshold number 0.4 float between 0 to 1
Source:
Throws:
Error

setOCRImageResize(maxScale)

Scale down the uploaded image before sending to OCR engine. Adjust this value to fine tune recognition accuracy on large full-resolution images. Set 0 to disable image resizing.
Parameters:
Name Type Default Description
maxScale number 2000 0 or 500~4000
Source:
Throws:
Error

setParameter(parameterKey, parameterValue)

Set an API parameter and its value, this function allows you to set any API parameter without using the built-in functions
Parameters:
Name Type Description
parameterKey string Parameter key
parameterValue string Parameter value
Source:
Returns:
void

setVaultData(data1, data2, data3, data4, data5)

Add up to 5 custom strings that will be associated with the vault entry, this can be useful for filtering and searching entries.
Parameters:
Name Type Description
data1 string Custom data field 1
data2 string Custom data field 2
data3 string Custom data field 3
data4 string Custom data field 4
data5 string Custom data field 5
Source:

verifyAddress(address)

Check if supplied address matches with document.
Parameters:
Name Type Default Description
address string 123 Sample St, California, US Address requiring validation
Source:

verifyAge(ageRange)

Check if the document holder is aged between the given range.
Parameters:
Name Type Default Description
ageRange string 18-99 Age range, example: 18-40
Source:
Throws:
Error

verifyDOB(dob)

Check if supplied date of birth matches with document.
Parameters:
Name Type Default Description
dob string 1990/01/01 Date of birth in YYYY/MM/DD
Source:
Throws:
Error

verifyDocumentNumber(documentNumber)

Check if supplied document or personal number matches with document.
Parameters:
Name Type Default Description
documentNumber string X1234567 Document or personal number requiring validation
Source:
Throws:
Error

verifyExpiry(enabled)

Check if the document is still valid based on its expiry date.
Parameters:
Name Type Default Description
enabled boolean false Enable or disable expiry check
Source:

verifyName(fullName)

Check if supplied name matches with document.
Parameters:
Name Type Default Description
fullName string ELON MUSK Full name requiring validation
Source:
Throws:
Error

verifyPostcode(postcode)

Check if supplied postcode matches with document.
Parameters:
Name Type Default Description
postcode string 90001 Postcode requiring validation
Source: