Getting the Journey Result
Retrieve and handle journey verification results using getJourneyResult() in the IDWise Web SDK.
Call getJourneyResult() after a journey finishes to retrieve the verification outcome — including the system decision, document and selfie results, and rule evaluations.
Call getJourneyResult() inside the onJourneyFinished callback. This callback fires after the user completes all steps and the journey finishes processing. Calling it before this point returns a JOURNEY_NOT_COMPLETED error.
eventHandlers: {
onJourneyFinished: async () => {
const result = await idwise.getJourneyResult();
// result is now available
}
}Full Sample Response
{
"isCompleted": true,
"systemDecision": "Rejected",
"referenceNo": "ABC1234",
"journeyId": "69e00000000000001304",
"documents": {
"20": {
"stepTitle": "ID Document",
"stepId": "20",
"hasPassedRules": false,
"documentType": "Identity Card",
"documentSubtype": null,
"issuingCountry": "Netherlands",
"issuingCountryCode": "NLD",
"extractedFields": {
"Full Name": {
"value": "Willeke Liselotte De Bruijn"
},
"First Name": {
"value": "Willeke Liselotte"
},
"Last Name": {
"value": "De Bruijn"
},
"Sex": {
"value": "Female"
},
"Sex Native": {
"value": "V"
},
"Birth Date": {
"value": "1965-03-10"
},
"Issue Date": {
"value": "2014-03-09"
},
"Expiry Date": {
"value": "2024-03-09"
},
"Document Number": {
"value": "SPECI2014"
},
"Nationality": {
"value": "ABW"
},
"Nationality Native": {
"value": "Nederlandse"
},
"Signature": {
"value": null
}
}
},
"50": {
"stepTitle": "Proof of Address",
"stepId": "50",
"hasPassedRules": true,
"documentType": "",
"documentSubtype": "",
"issuingCountry": "",
"issuingCountryCode": "",
"extractedFields": {}
}
},
"selfie": {
"status": "Refer",
"hasPassedRules": false,
"isLive": true,
"livenessStatusCode": null
},
"rules": {
"unrecognized_document": {
"name": "Recognised Document",
"result": "Passed"
},
"document_validation": {
"name": "Authentic Document",
"result": "Failed"
},
"expired_document": {
"name": "Expired Document",
"result": "Failed"
},
"user_confirmation": {
"name": "Confirmed Data Mismatch",
"result": "Passed"
},
"document_quality": {
"name": "Document Quality",
"result": "Failed"
},
"no_duplicate_documents": {
"name": "Unique Document",
"result": "Passed"
},
"no_duplicate_applicant": {
"name": "Unique Applicant",
"result": "Failed"
},
"same_subject": {
"name": "Same Person",
"result": "Failed"
},
"selfie_liveness": {
"name": "Selfie Liveness",
"result": "Passed"
},
"behavioural_checks": {
"name": "Behavioural Checks",
"result": "Failed"
}
}
}Data Models
JourneyResult Object
getJourneyResult() returns an object with these fields:
| Field | Type | Description |
|---|---|---|
isCompleted | boolean | true if the journey has finished processing |
systemDecision | string | Complete, Rejected, Refer. Check the table below for details. |
journeyId | string | Unique identifier for the journey |
referenceNo | string | Reference number provided during initialization |
documents | Record<string, DocumentResult> | Dictionary of document results keyed by step ID. Check the table below for details. |
selfie | Record<string, SelfieResult> | Selfie verification results. Check the table below for details. |
rules | Record<string, RuleDetail> | Dictionary of rule results. Check the table below for details. |
System Decision Values
The systemDecision field indicates the overall verification outcome:
| Decision | Meaning | Recommended Action |
|---|---|---|
Complete | All verification checks passed. | Allow the user to proceed. |
Rejected | One or more checks failed and the user did not pass verification. | Block the user and display a rejection message. |
Refer | The system could not make a definitive decision. Manual review is required. | Queue the journey for manual review by your compliance team. |
DocumentResult Object
Each entry in the documents dictionary describes the result for one document step:
| Field | Type | Description |
|---|---|---|
stepTitle | string | Title of the journey step that collected the document. |
stepId | string | Identifier of the document step. |
hasPassedRules | boolean | true if the document passed the configured document-level rules. |
documentType | string | Detected document type, such as Identity Card or passport. |
documentSubtype | string / null | More specific document classification when available. |
issuingCountry | string | Full name of the country that issued the document. |
issuingCountryCode | string | Country code for the issuing country. |
extractedFields | Record<string, ExtractedField> | OCR-extracted fields returned for the document, keyed by field name. |
ExtractedField Object
Each entry in extracted_fields represents one OCR-extracted field from the document:
The key is the field name returned by OCR, such as Full Name, Nationality Native, or Signature.
| Field | Type | Description |
|---|---|---|
value | string / null | Extracted value for the field. This is null when the field is present but no value could be extracted. |
Example:
{
"Full Name": {
"value": "Willeke Liselotte De Bruijn"
},
"Signature": {
"value": null
}
}SelfieResult Object
The selfie object describes the selfie and liveness verification outcome:
| Field | Type | Description |
|---|---|---|
status | string | Overall selfie verification result, such as Refer. |
hasPassedRules | boolean | true if the selfie passed the configured selfie-related rules. |
isLive | boolean | true if the liveness check detected a live person. |
livenessStatusCode | string | Detailed liveness result code, such as FACE_NOT_FOUND. |
RuleDetail Object
Each entry in the rules dictionary describes a single verification rule and its outcome:
| Field | Type | Description |
|---|---|---|
name | string | Human-readable name of the rule (e.g., "Document Expiry Check") |
result | string | Passed, Failed, or CouldNotApply |
Result values:
Passed— The rule's conditions were met.Failed— The rule's conditions were not met (e.g., the document is expired).CouldNotApply— The rule could not be evaluated, usually because the required data was missing or unreadable.
Example:
{
name: "Document Expiry Check",
result: "Passed" // "Passed" | "Failed" | "CouldNotApply"
}Error Handling
If the request cannot be fulfilled, the SDK returns an error object:
{
"code": "STRING",
"message": "STRING"
}| Field | Type | Description |
|---|---|---|
code | string | Identify the failure type and handle it programmatically. |
message | string | Explanation of the error that describes what went wrong and what you should check next. |
Error Codes
| Error Code | Description |
|---|---|
journey_not_completed | The journey is not completed yet. Please call getJourneyResult after the onJourneyFinished callback. |
timeout | Request timed out. Please check your internet connection and try again. |
no_active_journey | There is no active journey. Ensure you call startJourney or resumeJourney. |
duplicate_call | A getJourneyResult request is already in progress. You can only call this method once at a time. |
Implementation Example
This example initializes the SDK, starts a journey, and handles the result based on the systemDecision:
const idwise = await IDWise.initialize({ clientKey: "CLIENT_KEY" });
idwise.startJourney({
mount: "#idwise-mount",
flowId: "FLOW_ID",
// Unique identifier for this user on your system
referenceNumber: "ABC1234",
eventHandlers: {
onJourneyFinished: async () => {
try {
const result = await idwise.getJourneyResult();
// Route based on the system decision
switch (result.systemDecision) {
case "Complete":
console.log("Verification passed for journey:", result.journeyId);
// All checks in the journey passed, so you can continue onboarding.
// You can get Step ID by selecting the step in Flow Builder
const ID_DOCUMENT_STEP_ID = "20"
const identityDocument = result.documents[ID_DOCUMENT_STEP_ID]
const fullNameField = identityDocument.extractedFields["Full Name"]
if (fullNameField != null) {
// Use fullNameField.value
}
// Handle other fields that you need
break;
case "Rejected":
console.log("Sorry we are unable to open an account for you at this time", result.journeyId);
// At least one rule failed with an action on failure set to reject.
// The user did not pass verification, so you should stop the flow.
break;
case "Refer":
console.log("Thanks for completing the verification steps. We are reviewing your submissions and will get back to you soon", result.journeyId);
// On your backend you can handle Finished Journey webhook so any journey with
// a Refer system decision gets pushed to your Review team to make a decision
// then you may inform your user of the decision based on your requirements and logic
break;
}
} catch (error) {
// Handle specific error codes
switch (error.code) {
case "journey_not_completed":
// You should call getJourneyResult only after onJourneyFinished callback is triggered
console.warn("Please call getJourneyResult after onJourneyFinished callback handler");
break;
case "timeout":
// The journey is still processing. Check your flow configuration.
console.error("Request timed out. Check network connectivity.");
break;
case "no_active_journey":
console.error("There is no active journey. Ensure you call startJourney or resumeJourney");
break;
case "duplicate_call":
console.warn("A getJourneyResult request is already in progress. You can only call this method once at a time");
break;
default:
console.error("Unexpected error:", error.code, error.message);
}
}
}
}
});Updated 14 days ago
