Journey Result
Retrieve and handle journey verification results using getJourneyResult() in the IDWise Web SDK.
Overview
Call getJourneyResult() after a journey finishes to retrieve the verification outcome — including the system decision, document and selfie results, and rule evaluations.
When to Call getJourneyResult()
getJourneyResult()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
}
}Sample Response
A complete JourneyResult object looks like this:
{
"isCompleted": true,
"systemDecision": "Rejected",
"referenceNo": "Web SDK Test",
"journeyId": "600000000000000000b9",
"documents": {
"20": {
"step_title": "ID Document",
"step_id": 20,
"has_passed_rules": false,
"document_type": "Identity Card",
"document_subtype": null,
"issuing_country": "Netherlands",
"issuing_country_code": "NLD",
"extracted_fields": {
"Full Name": {
"value": "Willeke Liselotte De Bruijn"
},
"Nationality Native": {
"value": "Nederlandse"
},
"Signature": {
"value": null
}
}
},
"50": {
"step_title": "Proof of Address",
"step_id": 50,
"has_passed_rules": true,
"document_type": "",
"document_subtype": "",
"issuing_country": "",
"issuing_country_code": "",
"extracted_fields": {}
}
},
"selfie": {
"status": "Refer",
"has_passed_rules": false,
"is_live": false,
"liveness_status_code": "FACE_NOT_FOUND"
},
"rules": {
"unrecognized_document": {
"name": "Recognised Document",
"result": "Passed"
},
"document_validation": {
"name": "Authentic Document",
"result": "Failed"
},
"expired_document": {
"name": "Expired Document",
"result": "Failed"
}
}
}Data Models
JourneyResult Object
This is the object returned by getJourneyResult():
| 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 |
|---|---|---|
step_title | string | Title of the journey step that collected the document. |
step_id | number | Numeric identifier of the document step. |
has_passed_rules | boolean | true if the document passed the configured document-level rules. |
document_type | string | Detected document type, such as Identity Card or passport. |
document_subtype | string / null | More specific document classification when available. |
issuing_country | string | Full name of the country that issued the document. |
issuing_country_code | string | Country code for the issuing country. |
extracted_fields | 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. |
has_passed_rules | boolean | true if the selfie passed the configured selfie-related rules. |
is_live | boolean | true if the liveness check detected a live person. |
liveness_status_code | 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"
}Errors 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 | Processing is still underway. Call this only after onJourneyFinished. |
TIMEOUT | Network failure or API timeout. Check the internet connection. |
EMPTY_PARAMETERS | Journey ID is missing. Ensure startJourney was called first. |
POLLING_ALREADY_RUNNING | A verification process is already active. Avoid duplicate calls. |
Implementation Example
This example initializes the SDK, starts a journey, and handles the result based on the systemDecision:
const idwise = await IDWise.initialize({ clientKey: "YOUR_KEY" });
idwise.startJourney({
mount: "#idwise-mount",
journeyDefinitionId: "YOUR_JOURNEY_ID",
eventHandlers: {
onJourneyFinished: async () => {
try {
const result = await idwise.getJourneyResult();
if (!result.isCompleted) {
console.warn("Journey not yet fully processed.");
return;
}
// 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.
break;
case "Rejected":
console.log("Verification rejected for journey:", 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("Manual review needed for journey:", result.journeyId);
// At least one rule failed with an action on failure set to refer.
// Send the journey for manual review before making a final decision.
break;
}
// Inspect individual rule outcomes
for (const [ruleId, rule] of Object.entries(result.rules)) {
if (rule.result === "Failed") {
console.warn(`Rule failed: ${rule.name} (${ruleId})`);
}
}
} catch (error) {
// Handle specific error codes
switch (error.code) {
case "JOURNEY_NOT_COMPLETED":
console.warn("Journey is still processing. Wait for onJourneyFinished.");
break;
case "TIMEOUT":
console.error("Request timed out. Check network connectivity.");
break;
case "EMPTY_PARAMETERS":
console.error("Journey ID is missing. Ensure startJourney was called.");
break;
case "POLLING_ALREADY_RUNNING":
console.warn("A result request is already in progress.");
break;
default:
console.error("Unexpected error:", error.code, error.message);
}
}
}
}
});Updated about 2 hours ago
