Class: DocuPass

DocuPass(apikey, companyName, region)

new DocuPass(apikey, companyName, region)

Initialize DocuPass API with an API key, company name and optional region (US, EU)
Parameters:
Name Type Default Description
apikey string You API key
companyName string My Company Name Your company name
region string US US/EU
Source:
Throws:
Error

Methods

createIframe() → {Promise.<object>}

Create a DocuPass session for embedding in web page as iframe
Source:
Throws:
Error
Returns:
Type
Promise.<object>

createLiveMobile() → {Promise.<object>}

Create a DocuPass Live Mobile verification session for users to open on mobile phone
Source:
Throws:
Error
Returns:
Type
Promise.<object>

createMobile() → {Promise.<object>}

Create a DocuPass session for users to open on mobile phone, or embedding in mobile app
Source:
Throws:
Error
Returns:
Type
Promise.<object>

createRedirection() → {Promise.<object>}

Create a DocuPass session for users to open in any browser
Source:
Throws:
Error
Returns:
Type
Promise.<object>

createSignature(templateId, format, prefillData) → {Promise.<object>}

Create a DocuPass signature session for user to review and sign legal document without identity verification
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
Returns:
Type
Promise.<object>

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, minimum_score)

Validate the document to check whether the document is authentic and has not been tampered
Parameters:
Name Type Default Description
enabled boolean false Enable or disable Document Authentication
module * 2 Authentication Module: "1", "2" or "quick"
minimum_score number 0.3 Minimum score to pass verification
Source:
Throws:
Error

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 Enable or disable dual-side information check
Source:

enableFaceVerification(enabled, verification_type, threshold)

Whether users will be required to submit a selfie photo or record selfie video for facial verification.
Parameters:
Name Type Default Description
enabled boolean false Enable or disable Facial Biometric Verification
verification_type number 1 1 for photo verification, 2 for video verification
threshold number 0.4 Minimum confidence score required to pass verification, value between 0 to 1
Source:
Throws:
Error

enablePhoneVerification(enabled)

Whether to ask user to enter a phone number for verification, DocuPass supports both mobile or landline number verification. Verified phone number will be returned in callback JSON.
Parameters:
Name Type Default Description
enabled boolean false Enable or disable user phone verification
Source:

enableVault(enabled)

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
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
Hide all branding logo
Parameters:
Name Type Default Description
hide boolean false
Source:

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)

Only accept document of specified types. 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:

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:

setCallbackImage(return_documentimage, return_faceimage, return_type)

Enable or disable returning user uploaded document and face image in callback, and image data format.
Parameters:
Name Type Default Description
return_documentimage boolean true Return document image in callback data
return_faceimage boolean true Return face image in callback data
return_type number 1 Image type: 0=base64, 1=url
Source:

setCallbackURL(url)

Set server-side callback/webhook URL to receive verification results
Parameters:
Name Type Default Description
url string https://www.example.com/docupass_callback.php Callback URL
Source:
Throws:
Error

setCustomHTML(url)

Replace DocuPass page content with your own HTML and CSS, you can download the HTML/CSS template from DocuPass API Reference page
Parameters:
Name Type Description
url string URL pointing to your own HTML page
Source:

setCustomID(customID)

Set a custom string that will be sent back to your server's callback URL, and appended to redirection URLs as a query string. It is useful for identifying your user within your database. This value will be stored under docupass_customdata under Vault.
Parameters:
Name Type Default Description
customID string 12345 A string used to identify your customer internally
Source:

setLanguage(language)

DocuPass automatically detects user device language and display corresponding language. Set this parameter to override automatic language detection.
Parameters:
Name Type Description
language string Check DocuPass API reference for language code
Source:
Replace footer logo with your own logo
Parameters:
Name Type Default Description
url string https://docupass.app/asset/logo1.png Logo URL
Source:

setMaxAttempt(max_attempt)

Set max verification attempt per user
Parameters:
Name Type Default Description
max_attempt number 1 1 to 10
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

setQRCodeFormat(foregroundColor, backgroundColor, size, margin)

Configure QR code generated for DocuPass Mobile and Live Mobile
Parameters:
Name Type Default Description
foregroundColor string 000000 Image foreground color HEX code
backgroundColor string FFFFFF Image background color HEX code
size number 5 Image size: 1 to 50
margin number 1 Image margin: 1 to 50
Source:
Throws:
Error

setRedirectionURL(successURL, failURL)

Redirect client browser to set URLs after verification. DocuPass reference code and customid will be appended to the end of URL, e.g. https://www.example.com/success.php?reference=XXXXXXXX&customid=XXXXXXXX
Parameters:
Name Type Default Description
successURL string https://www.example.com/success.php Redirection URL after verification succeeded
failURL string https://www.example.com/failed.php Redirection URL after verification failed
Source:
Throws:
Error

setReusable(reusable)

Enabling this parameter will allow multiple users to verify their identity through the same URL, a new DocuPass reference code will be generated for each user automatically.
Parameters:
Name Type Default Description
reusable boolean false Set true to allow unlimited verification for a single DocuPass session
Source:

setWelcomeMessage(message)

Display a custom message to the user in the beginning of verification
Parameters:
Name Type Description
message string Plain text string
Source:

signContract(templateId, format, prefillData)

Have user review and sign autofilled legal document after successful identity verification
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
DocuPass will send SMS to this number containing DocuPass link to review and sign legal document.
Parameters:
Name Type Default Description
mobileNumber string +1333444555 Mobile number should be provided in international format such as +1333444555
Source:
DocuPass will send SMS to this number containing DocuPass link to perform identity verification, the number provided will be automatically considered as verified if user completes identity verification. If an invalid or unreachable number is provided error 1050 will be thrown. You should add your own thresholding mechanism to prevent abuse as you will be charged 1 quota to send the SMS.
Parameters:
Name Type Default Description
mobileNumber string +1333444555 Mobile number should be provided in international format such as +1333444555
Source:

validate(reference, hash) → {Promise.<boolean>}

Validate a data received through DocuPass Callback against DocuPass Server to prevent request spoofing
Parameters:
Name Type Description
reference string DocuPass reference
hash string DocuPass callback hash
Source:
Throws:
Error
Returns:
Type
Promise.<boolean>

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

verifyPhone(phoneNumber)

DocuPass will attempt to verify this phone number as part of the identity verification process, both mobile or landline are supported, users will not be able to enter their own numbers or change the provided number.
Parameters:
Name Type Default Description
phoneNumber string +1333444555 Mobile or landline number should be provided in international format such as +1333444555
Source:

verifyPostcode(postcode)

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