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:

FieldTypeDescription
isCompletedbooleantrue if the journey has finished processing
systemDecisionstringComplete, Rejected, Refer. Check the table below for details.
journeyIdstringUnique identifier for the journey
referenceNostringReference number provided during initialization
documentsRecord<string, DocumentResult>Dictionary of document results keyed by step ID. Check the table below for details.
selfieRecord<string, SelfieResult> Selfie verification results. Check the table below for details.
rulesRecord<string, RuleDetail>Dictionary of rule results. Check the table below for details.

System Decision Values

The systemDecision field indicates the overall verification outcome:

DecisionMeaningRecommended Action
CompleteAll verification checks passed.Allow the user to proceed.
RejectedOne or more checks failed and the user did not pass verification.Block the user and display a rejection message.
ReferThe 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:

FieldTypeDescription
stepTitlestringTitle of the journey step that collected the document.
stepIdstringIdentifier of the document step.
hasPassedRulesbooleantrue if the document passed the configured document-level rules.
documentTypestringDetected document type, such as Identity Card or passport.
documentSubtypestring / nullMore specific document classification when available.
issuingCountrystringFull name of the country that issued the document.
issuingCountryCodestringCountry code for the issuing country.
extractedFieldsRecord<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.

FieldTypeDescription
valuestring / nullExtracted 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:

FieldTypeDescription
statusstringOverall selfie verification result, such as Refer.
hasPassedRulesbooleantrue if the selfie passed the configured selfie-related rules.
isLivebooleantrue if the liveness check detected a live person.
livenessStatusCodestringDetailed liveness result code, such as FACE_NOT_FOUND.

RuleDetail Object

Each entry in the rules dictionary describes a single verification rule and its outcome:

FieldTypeDescription
namestringHuman-readable name of the rule (e.g., "Document Expiry Check")
resultstringPassed, 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"
}
FieldTypeDescription
codestringIdentify the failure type and handle it programmatically.
messagestringExplanation of the error that describes what went wrong and what you should check next.

Error Codes

Error CodeDescription
journey_not_completedThe journey is not completed yet. Please call getJourneyResult after the onJourneyFinished callback.
timeoutRequest timed out. Please check your internet connection and try again.
no_active_journeyThere is no active journey. Ensure you call startJourney or resumeJourney.
duplicate_callA 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);
        }
      }
    }
  }
});