IDScan Standalone

Technical Key Concepts

  • When a user has gone through the service, the scanned data and initial results is provided via callbacks in the front-end
    • "data.ocr.data.status": "processing" is the status of the processing of the application
    • "data.ocr.applicationStatus": "approved" is the status of the application
  • Final results are available and can be retrieved via
    • The API https://ocr.regily.com
    • The admin back-office
  • The uploaded documents are available to download in three ways:
    • via links from the callbacks
    • via the ocr.regily.com API
    • manually via the Checkin.com Back-office

Integrating GetID (IDScan) with the Checkin.com SDK

The GetID service is designed to be up and running in minutes and the integration is done in 4 simple steps.

1. Load your Checkin.com library

The library can be loaded as you would any other script or using GTM (or similar services).

<script src="https://[partner].regily.com/[key].js" async></script>

2. Trigger IDScan

The IDScan is triggered via the globally scoped window.checkin.signUp.open method.

window.OnCheckinLoad is used to load the SDK and this is also where you will configure the flow (e.g. setting the language).

window.onCheckinLoad = (checkin) => { // Load the Checkin.com SDK 
  checkin.settings.setLang('de') // Set language and other configurations
 } 

//This should be executed as a call when a "verify" button is pressed
window.checkin.signUp.open()

//Button example
<button onClick='window.checkin.signUp.open()'>Open with button click</button>

3. Save the results

When a user has gone through GetID, the scanned data and documents are provided via a callback in the front-end. This event should be captured using the setOnComplete method.

The setOnComplete will return a JSON structure called data which contains the scanned data and links to the documents.

The following examples shows how you can capture the completed event with the setOnComplete() function.

window.onCheckinLoad = (checkin) => {
  checkin.settings.setLang('de')
  
  checkin.dataFlow.setOnComplete(({ data, normalizedData }) => {
  // you should save all data to your backend here.
    console.log('Complete dataset captured:', data)
    
    // Add your current endpoint for updating the user account
    var url = 'https://localhost:8888/api/verify'
    
    fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: data})
      .then(function (data) {
        if (data.status == 200) {
          console.log('Save successful!', data)
          resolve()
        }
      }).catch(function (err) { 
      	return checkin.generate.dataError.unknown() // In case something goes wrong, display an error
      })
  })
}

This is an example of the data returned in the callback.

data.ocr: {
    "applicationStatus": "approved", // The status of the application
    "resultUrl": "https://ocr.regily.com/verifications/results/b2dce275031c3785ec1b7ac89983c67e1a9f", // Full API link to query
    "id": "b2dce275031c3785ec1b7ac89983c67e1a9f", // SessionID
    "signed": "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJyZXN1bHRVcmwiOiJodHRwOi8vbG9jYWxob3N0OjMwMzAvdmVyaWZpY2F0aW9ucy9yZXN1bHRzL2IyZGNlMjc1MDMxYzM3ODVlYzFiN2FjODk5ODNjNjdlMWE5ZiIsImlkIjoiYjJkY2UyNzUwMzFjMzc4NWVjMWI3YWM4OTk4M2M2N2UxYTlmIiwiaXNzIjoicmVnaWx5In0.AFqGAHm-4_WkUcefDdme_-9wNZVF3TmCWaE5U7F9sg4zMVW0CZJJlJ-K6Rasl9umlHA8Em6HKO-MxTRjG4Z-oynbAK4d4fMT0bR_9ANWUPUDjTeXfJUGWwXCHXJqO0iIy89edB00cQWku_Iby2H-izWq5zxs6nXju1TCXtW9vEk4X6fC",
    "data": {  } // Array with all specifics from the scanned data
    }
}

📘

Verify the JWT

To make sure the application has been scanned and processed by Checkin.com it is recommended to decrypt the JWT contained in signed as described here.

4. Ping API for Final Status

In some cases, the scanning and verification of documents may require some additional time to finish.

If "data.ocr.data.status"="processing", you need to ping https://ocr.regily.com/verifications/results to get the updated results.

Here is an example of how to query the API:

curl --request GET \
 --url https://ocr.regily.com/verifications/results/[ID] \
 --header 'X-SECRET-KEY: [SECRET_ACCESS_KEY]' \ // This key will be shared separately

Here is an example of a response from a API request:

{
    "data": {
        "results": {
            "status": "declined",   //Application Status
            "concerns": [
                {
                    "message": "Found 2 issue(s).",
                    "service": "doc-check",
                    "status": "declined"
                },
                {
                    "message": "Fields from ocr and mrz have conflict: 1965-03-10, 2022-03-10, Checksum is not valid",
                    "service": "doc-check",
                    "status": "declined"
                }
            ]
        },
        "checks": [     //Checked Services
            {
                "name": "docCheck",
                "status": "declined",
                "comment": "Found 2 issue(s)."
            }
        ],
        "documents": [  //Collected Document Pictures During verification proccess
            {
                "name": "document",
                "files": [
                    {
                        "kind": "front",
                        "mediaType": "image/jpeg",
                        "uri": "https://ocr.regily.com/files/63a6377af8183ffc3f6cbabdd6dbc66d/document/front.jpeg"
                    },
                    {
                        "kind": "back",
                        "mediaType": "image/jpeg",
                        "uri": "https://ocr.regily.com/files/63a6377af8183ffc3f6cbabdd6dbc66d/document/back.jpeg"
                    }
                ]
            },
            {
                "name": "selfie",  //Collected Selfie Picture During verification proccess
                "files": []
            }
        ],
        "metadata": {
            "platform": "web",
            "ipAddress": "146.70.122.156",
            "country": "SWE",
            "city": "Skondal",
            "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
        }
        },
        "status": "done",
        "attributes": {       // Attrubutes collected from the document
            "documentType": "id-card",
            "firstName": "WILLEKE LISELOTTE",
            "originalFirstName": "Willeke Liselotte",
            "lastName": "DE BRUIJN",
            "originalLastName": "De Bruijn",
            "documentNumbers": [
                "SPECI2021",
                "SPECI2021"
            ],
            "idNumber": "",
            "referenceId": "",
            "gender": "female",
            "nationality": "NLD",
            "issueCountry": "NLD",
            "dateOfExpiry": "2031-08-02",
            "dateOfBirth": "1965-03-10",
            "placeOfBirth": "SPECIMEN"
        }
    },
    "signed": "eyJhbGciOiJFUzUxMiIsInR5cCI6...."
}

📘

You can also use the back-office

Together with your partner key, you will also get access to the Checkin.com back-office where all applications can be accessed

5. Download Documents

Uploaded documents and videos can be downloaded via the ocr.regily.com API.

curl --request GET   --url https://ocr.regily.com/files/[applicationId]/document/front.jpeg --header 'X-SECRET-Key: [APIkey]' --output test.jpg

5. (Optional) Cross-check documents with user data

When you trigger GetID, you can also pass collected user data to cross-reference the information on the documents with previously collected user data.

Currently, there is support to cross-check the following fields:

  • first name
  • last name
  • date of birth

6. (Optional) Pass address information for Proof-Of-Address

If you have the Proof-of-Address service as part of GetID, you need to pass some address information before triggering the flow. This information will be cross-referenced with the information extracted from the documents.

window.checkin.dataFlow.setKnownData({user: {firstName: 'Mustermann',
  lastName: 'Hartmut',
  birthdate: '1983-03-03',
  poaData: { // This is required for Proof of address 
      'country': 'USA',
      'city': 'Monterey Park',
      'postcode': '91754-2217',
      'addressLine": "24915 APPLE CT'
    }  
  }})