Class: Docupass

Docupass(apiKeyopt)

Docupass API client. Creates, lists, retrieves and deletes Docupass verification sessions (hosted ID verification links/forms).

Constructor

new Docupass(apiKeyopt)

Create a new Docupass API client.
Parameters:
Name Type Attributes Default Description
apiKey string | null <optional>
null Your API key. If omitted, the `IDANALYZER_KEY` environment variable is used.
Source:

Extends

Methods

(async) createDocupass(profileopt, modeopt, contractFormatopt, contractGenerateopt, reusableopt, contractPrefillopt, contractSignopt, customDataopt, languageopt, referenceDocumentopt, referenceDocumentBackopt, referenceFaceopt, userPhoneopt, verifyAddressopt, verifyAgeopt, verifyDOBopt, verifyDocumentNumberopt, verifyNameopt, verifyPostcodeopt) → {Promise.<ApiResponse>}

Create a new Docupass verification session.
Parameters:
Name Type Attributes Default Description
profile string | null <optional>
null KYC Profile ID to apply to the verification. Required.
mode number <optional>
0 Docupass verification mode (e.g. 0=document + face, see API docs for available modes).
contractFormat string <optional>
'pdf' Generated contract format: 'pdf', 'docx' or 'html'.
contractGenerate string <optional>
'' Contract template ID(s) to auto-generate on completion.
reusable boolean <optional>
false Whether the Docupass link can be reused by multiple users.
contractPrefill string <optional>
'' Key-value data used to prefill the generated contract.
contractSign string <optional>
'' Contract signing configuration.
customData string <optional>
'' Arbitrary string to store alongside the resulting transaction.
language string <optional>
'' Display language for the Docupass page (e.g. 'en').
referenceDocument string | null <optional>
null Reference document front image to verify against.
referenceDocumentBack string | null <optional>
null Reference document back image to verify against.
referenceFace string | null <optional>
null Reference face image to verify against.
userPhone string <optional>
'' User phone number.
verifyAddress string <optional>
'' Address to verify against the submitted document.
verifyAge string <optional>
'' Age range (e.g. "18-99") to verify against the submitted document.
verifyDOB string <optional>
'' Date of birth (YYYY/MM/DD) to verify against the submitted document.
verifyDocumentNumber string <optional>
'' Document/ID number to verify against the submitted document.
verifyName string <optional>
'' Full name to verify against the submitted document.
verifyPostcode string <optional>
'' Postcode to verify against the submitted document.
Source:
Throws:
If `profile` is `null`.
Type
InvalidArgumentException
Returns:
The parsed API response.
Type
Promise.<ApiResponse>

(async) deleteDocupass(referenceopt) → {Promise.<ApiResponse>}

Delete a Docupass session by reference.
Parameters:
Name Type Attributes Default Description
reference string <optional>
'' Docupass reference ID.
Source:
Throws:
If `reference` is empty.
Type
InvalidArgumentException
Returns:
The parsed API response.
Type
Promise.<ApiResponse>

getApiKey(customKeyopt) → {string|null}

Resolve the API key, preferring the provided value and falling back to the `IDANALYZER_KEY` environment variable.
Parameters:
Name Type Attributes Default Description
customKey string | null <optional>
null Explicitly supplied API key.
Overrides:
Source:
Returns:
The resolved API key, or `null` if none is available.
Type
string | null

(async) getDocupass(referenceopt) → {Promise.<ApiResponse>}

Retrieve a single Docupass record by reference.
Parameters:
Name Type Attributes Default Description
reference string <optional>
'' Docupass reference ID.
Source:
Throws:
If `reference` is empty.
Type
InvalidArgumentException
Returns:
The parsed API response.
Type
Promise.<ApiResponse>

(async) listDocupass(orderopt, limitopt, offsetopt) → {Promise.<ApiResponse>}

Retrieve a list of Docupass sessions.
Parameters:
Name Type Attributes Default Description
order number <optional>
-1 Sort results by newest(-1) or oldest(1).
limit number <optional>
10 Number of items to be returned per call.
offset number <optional>
0 Start the list from a particular entry index.
Source:
Throws:
If `order` is not 1 or -1, or `limit` is out of range.
Type
InvalidArgumentException
Returns:
The parsed API response.
Type
Promise.<ApiResponse>

setParam(key, value) → {void}

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
key string Parameter key
value * Parameter value
Overrides:
Source:
Returns:
Type
void

throwApiException(swopt) → {void}

Whether an exception should be thrown if API response contains an error message
Parameters:
Name Type Attributes Default Description
sw boolean <optional>
false Set to `true` to throw an APIError when the API response contains an error, or `false` to return the raw error response instead.
Overrides:
Source:
Returns:
Type
void