Skip to main content

Phase 2

Overview

In phase 2 we will focus on the following:

  • In addition to the applicant-level verifications in phase 1 (residence and identity), we will be adding the income verification.

Checklist

Locate the Python script

In your terminal navigate to the the destination directory containing the unzipped folder:

cd <local directory>/implementation_guide_phases/phase2/python
tip

The accompanying zip file can be accessed here.

Install requirements

While in the directory above, ensure you have the necessary python modules available:

pip install -r requirements.txt

Update the webhook

Update the value of the webhook variable at the top of main.py with the callback endpoint you created.

Run the script

Once the checklist above is complete, run:

python main.py

You can look over the printouts in your terminal to see:

  • All the stages described below:
    • payload printouts
    • synchronous responses
    • steps taken to push payloads and files to Informed
  • That the payloads match the specifications in the documentation
  • The synchronous responses received from Informed

Verify Results

The script did the following:

  1. Converted the CSV data into a valid JSON payload (as described in register application)
  2. Submitted the payload to Informed and received an app_id from Informed in the synchronous response
  3. Used this app_id to send a list of filenames to Informed and received URL's for each image (the filenames are taken from ../test_images/<app_ref_id>)
  4. Used these URL's to upload all the files to their respective URL's
  5. Asynchronous responses were sent to the webhook provided
  6. The webhook received one extractions response for each file uploaded and one verifications response once all files have been classified, extracted, and verified by Informed

Continue to phase 3 to see the process of adding application-level verifications.

Example app registration payload

register app payload (seen in terminal at run)
{
"application_reference_id": "Phase2_appid_001_f27e66a1-c4d1-4d52-858a-f54854059281",
"application_date": "2021-04-20T00:00:00",
"contract_date": "2021-05-12T00:00:00",
"contract_type": "Paper",
"applicants": {
"applicant1": {
"first_name": "Jo",
"middle_name": "M",
"last_name": "Boren",
"suffix": "JR",
"phone": "919-123-3456",
"ssn": "666443906",
"date_of_birth": "1965-12-10",
"address_info": [
{
"address": {
"street_address": "8717 S 4th Ave",
"city": "Inglewood",
"state": "CA",
"zip": "90305"
},
"start_date": "2019-11-21",
"is_current": true
}
],
"employment_info": [
{
"employment_type": "Employed",
"employer_name": "Informed",
"occupation": "Engineer",
"income": {
"period": "Monthly",
"amount": 4000.0
},
"start_date": "2018-04-13",
"is_current": true
}
],
"additional_incomes": [
{
"source": "Other",
"income": {
"period": "Monthly",
"amount": 300.0
}
}
]
},
"applicant2": {
"first_name": "Lucinda",
"middle_name": "J",
"last_name": "Bonadio",
"phone": "919-123-5678",
"ssn": "444113333",
"date_of_birth": "1971-12-25",
"address_info": [
{
"address": {
"street_address": "2317 N Winery Ave",
"city": "Fresno",
"state": "CA",
"zip": "93703"
},
"start_date": "2016-10-14",
"is_current": true
}
],
"employment_info": [
{
"employment_type": "Employed",
"employer_name": "American Airlines",
"occupation": "Builder",
"income": {
"period": "Monthly",
"amount": 5312.0
},
"start_date": "2019-10-14",
"is_current": true
}
]
}
},
"verifications": {
"income": [
{
"belongs_to": "applicant1"
},
{
"belongs_to": "applicant2"
}
],
"residence": [
{
"belongs_to": "applicant1"
},
{
"belongs_to": "applicant2"
}
],
"identity": [
{
"belongs_to": "applicant1"
}
]
},
"services": [
"extract",
"verify"
],
"webhook": "https://your.callback.com/here"
}

Example asynchronous extractions response

extractions response (received at callback url)
{
"event_type": "extractions",
"application_id": "ee1674bd-3635-4c82-80ff-ec6558a3f62d",
"application_reference_id": "Phase2_appid_001_f27e66a1-c4d1-4d52-858a-f54854059281",
"documents": {
"paystub": [
{
"data_action": "create",
"document_id": "f50e85e4-3dda-47cc-82f0-416592d3acaf",
"file_ids": [
"db11125f-2061-41e1-b225-14edd7d7b429"
],
"file_reference_ids": [
"../test_images/appid_001/paystub.pdf"
],
"url": "https://file-location-in-S3.com",
"extracted_data": {
"applicants": {
"applicant1": {
"address": {
"street_address": "8717 South 4th Avenue",
"street_2": null,
"city": "Inglewood",
"state": "CA",
"zip": "90305"
},
"first_name": "Jo",
"middle_name": null,
"last_name": "Boren",
"suffix": null,
"ssn": "3906"
}
},
"employer_name": "INFORMED, INC",
"pay_begin_date": "2021-03-01",
"pay_end_date": "2021-03-15",
"pay_date": "2021-03-16",
"regular_pay": {
"current": 2880,
"ytd": ""
},
"gross_pay": {
"current": 5392,
"ytd": 15976
},
"overtime_pay": {
"current": 1512,
"ytd": 3456
},
"garnishments": {
"current": 0,
"ytd": 0
},
"loans401_k": {
"current": 0,
"ytd": 0
},
"bonus_pay": {
"current": 1000,
"ytd": 1000
},
"commission_pay": {
"current": 0,
"ytd": 0
},
"tips_pay": {
"current": 0,
"ytd": 0
},
"pay_period_frequency": "Semimonthly",
"hours_worked": 80
},
"updated_at": "2023-04-24T19:37:48Z"
}
]
}
}

Example asynchronous verifications response

verifications response (received at callback url)
{
"event_type": "verifications",
"application_id": "ee1674bd-3635-4c82-80ff-ec6558a3f62d",
"application_reference_id": "Phase2_appid_001_f27e66a1-c4d1-4d52-858a-f54854059281",
"data_sources": {
"image_files": [
{
"file_id": "e54739d2-ea77-43a1-8c00-1bc809ac3f2f",
"file_reference_id": "../test_images/appid_001/UtilityBill.png"
},
{
"file_id": "c7682056-d003-4b53-b350-7373ab50482f",
"file_reference_id": "../test_images/appid_001/joint_documents.pdf"
},
{
"file_id": "db11125f-2061-41e1-b225-14edd7d7b429",
"file_reference_id": "../test_images/appid_001/paystub.pdf"
}
],
"structured_data": []
},
"verifications": {
"income": [
{
"status": "pass",
"belongs_to": "applicant1",
"updated_at": "2023-04-24 19:38:29 +0000",
"description": "The applicant's income is in-line with what s/he stated based on the Current Paystub. Informed searched for a Current Paystub and found multiple in the deal jacket. The 1st Current Paystub matches the applicant's name. The 1st Current Paystub matches the applicant's employer's name. The 1st Current Paystub has YTD earnings. The 1st Current Paystub is not similar to a paystub known to be fraudulent. The 1st Current Paystub has no loan deductions. The 1st Current Paystub has no garnishments. The 1st Current Paystub was issued within 60 days of the contract date. used to calculate income The 2nd Current Paystub matches the applicant's name. The 2nd Current Paystub matches the applicant's employer's name. The 2nd Current Paystub has YTD earnings. The 2nd Current Paystub is not similar to a paystub known to be fraudulent. The 2nd Current Paystub has no loan deductions. The 2nd Current Paystub has no garnishments. The 2nd Current Paystub was issued within 60 days of the contract date.",
"verification_questions": {
"poi_income_from_employer": {
"question": "What is the income from the employer?",
"expected": "",
"answer": "$69,120.00",
"status": "pass"
},
"poi_documents_used": {
"question": "Which document was used to calculate income?",
"expected": "",
"answer": "Current Paystub",
"status": "pass"
},
"poi_income_within_threshold": {
"question": "Is the applicant's income in-line with that what s/he stated?",
"expected": "$48,000.00",
"answer": "$69,120.00",
"status": "pass"
}
},
"acceptable_documents": {
"paystub": [
{
"document_id": "f50e85e4-3dda-47cc-82f0-416592d3acaf",
"file_ids": [
"db11125f-2061-41e1-b225-14edd7d7b429"
],
"file_reference_ids": [
"../test_images/appid_001/paystub.pdf"
],
"category": "Current Paystub",
"document_questions": {
"matches_applicant_name": {
"question": "Matches the applicant's name?",
"expected": "Jo Boren",
"answer": "Jo Boren",
"status": "pass"
},
"has_garnishments_deducted": {
"question": "Garnishments deducted?",
"expected": "<=$0.00",
"answer": "$0.00",
"status": "pass"
},
"has_loans_deducted": {
"question": "Loans deducted?",
"expected": "<=$0.00",
"answer": "$0.00",
"status": "pass"
},
"has_ytd_earnings": {
"question": "Has YTD earnings?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"is_similar_to_fraudulent_paystub": {
"question": "Similar to a paystub known to be fraudulent?",
"expected": "FALSE",
"answer": "FALSE",
"status": "pass"
},
"is_issued_recently": {
"question": "Issued within 60 days of the contract date?",
"expected": ">=03/13/2021",
"answer": "03/16/2021",
"status": "pass"
},
"working_days_elapsed": {
"question": "Working days elapsed?",
"expected": "",
"answer": 73,
"status": "pass"
},
"first_working_day": {
"question": "First working day of the year?",
"expected": "",
"answer": "01/01/2021",
"status": "pass"
},
"first_working_day_methodology": {
"question": "Methodology used to calculate the first working day of the year?",
"expected": "",
"answer": "begin_of_year",
"status": "pass"
},
"matches_employer_name": {
"question": "Matches the applicant's employer's name?",
"expected": "Informed",
"answer": "INFORMED, INC",
"status": "pass"
}
}
}
]
},
"recommendations": []
},
{
"status": "pass",
"belongs_to": "applicant2",
"updated_at": "2023-04-24 19:38:29 +0000",
"description": "The applicant's income is in-line with what s/he stated based on the Current Paystub. Informed searched for a Current Paystub and found one in the deal jacket. The Current Paystub matches the applicant's name. The Current Paystub matches the applicant's employer's name. The Current Paystub has YTD earnings. The Current Paystub is not similar to a paystub known to be fraudulent. The Current Paystub has no loan deductions. The Current Paystub has no garnishments. The Current Paystub was issued within 60 days of the contract date. used to calculate income",
"verification_questions": {
"poi_income_from_employer": {
"question": "What is the income from the employer?",
"expected": "",
"answer": "$60,000.00",
"status": "pass"
},
"poi_documents_used": {
"question": "Which document was used to calculate income?",
"expected": "",
"answer": "Current Paystub",
"status": "pass"
},
"poi_income_within_threshold": {
"question": "Is the applicant's income in-line with that what s/he stated?",
"expected": "$63,744.00",
"answer": "$60,000.00",
"status": "pass"
}
},
"acceptable_documents": {
"paystub": [
{
"document_id": "cadac273-a325-420d-9717-661fae04bd79",
"file_ids": [
"c7682056-d003-4b53-b350-7373ab50482f"
],
"file_reference_ids": [
"../test_images/appid_001/joint_documents.pdf"
],
"category": "Current Paystub",
"document_questions": {
"matches_applicant_name": {
"question": "Matches the applicant's name?",
"expected": "Lucinda Bonadio",
"answer": "Lucinda Bonadio",
"status": "pass"
},
"has_garnishments_deducted": {
"question": "Garnishments deducted?",
"expected": "<=$0.00",
"answer": "$0.00",
"status": "pass"
},
"has_loans_deducted": {
"question": "Loans deducted?",
"expected": "<=$0.00",
"answer": "$0.00",
"status": "pass"
},
"has_ytd_earnings": {
"question": "Has YTD earnings?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"is_similar_to_fraudulent_paystub": {
"question": "Similar to a paystub known to be fraudulent?",
"expected": "FALSE",
"answer": "FALSE",
"status": "pass"
},
"is_issued_recently": {
"question": "Issued within 60 days of the contract date?",
"expected": ">=03/13/2021",
"answer": "03/16/2021",
"status": "pass"
},
"working_days_elapsed": {
"question": "Working days elapsed?",
"expected": "",
"answer": 73,
"status": "pass"
},
"first_working_day": {
"question": "First working day of the year?",
"expected": "",
"answer": "01/01/2021",
"status": "pass"
},
"first_working_day_methodology": {
"question": "Methodology used to calculate the first working day of the year?",
"expected": "",
"answer": "begin_of_year",
"status": "pass"
},
"matches_employer_name": {
"question": "Matches the applicant's employer's name?",
"expected": "American Airlines",
"answer": "American Airlines",
"status": "pass"
}
}
}
]
},
"recommendations": []
}
],
"residence": [
{
"status": "pass",
"belongs_to": "applicant1",
"updated_at": "2023-04-24 19:38:29 +0000",
"description": "Informed searched for a Driver's License and found one in the deal jacket. The Driver's License matches the applicant's name. The Driver's License matches the applicant's address. The Driver's License was issued by a U.S. State. The Driver's License is not expired. Informed searched for a Paystub and found multiple in the deal jacket. The 1st Paystub matches the applicant's name. The 1st Paystub matches the applicant's address. The 1st Paystub was issued within 30 days of the contract date. The 2nd Paystub matches the applicant's name. The 2nd Paystub matches the applicant's address. The 2nd Paystub was issued within 30 days of the contract date. Informed searched for a Utility Bill and found multiple in the deal jacket. The 1st Utility Bill matches the applicant's name. The 1st Utility Bill matches the applicant's address. The 1st Utility Bill may not be issued within 30 days of the contract date; a manual review is needed. The 1st Utility Bill has a past due amount. The 2nd Utility Bill matches the applicant's name. The 2nd Utility Bill matches the applicant's address. The 2nd Utility Bill was issued within 30 days of the contract date. The 2nd Utility Bill has a past due amount.",
"verification_questions": {},
"acceptable_documents": {
"driver_license_front": [
{
"document_id": "116f8fc6-9873-467f-8690-c65e4df35736",
"file_ids": [
"c7682056-d003-4b53-b350-7373ab50482f"
],
"file_reference_ids": [
"../test_images/appid_001/joint_documents.pdf"
],
"category": "Driver's License",
"document_questions": {
"matches_applicant_name": {
"question": "Matches the applicant's name?",
"expected": "Jo Boren",
"answer": "Jo Boren",
"status": "pass"
},
"is_us_issued_id": {
"question": "Is a US Driver's License?",
"expected": true,
"answer": "CA",
"status": "pass"
},
"is_expired": {
"question": "Expired?",
"expected": ">05/12/2021",
"answer": "10/12/2027",
"status": "pass"
},
"matches_applicant_address": {
"question": "Matches the applicant's address?",
"expected": "8717 S 4th Ave Inglewood CA 90305",
"answer": "8717 S 4th Ave, Inglewood, CA 90305, USA",
"status": "pass"
}
}
}
]
},
"recommendations": []
},
{
"status": "pass",
"belongs_to": "applicant2",
"updated_at": "2023-04-24 19:38:29 +0000",
"description": "Informed searched for a Driver's License and found one in the deal jacket. The Driver's License matches the applicant's name. The Driver's License matches the applicant's address. The Driver's License was issued by a U.S. State. The Driver's License is not expired. Informed searched for a Paystub and found one in the deal jacket. The Paystub matches the applicant's name. The Paystub matches the applicant's address. The Paystub was issued within 30 days of the contract date. Informed searched for a Utility Bill and found one in the deal jacket. The Utility Bill matches the applicant's name. The Utility Bill matches the applicant's address. The Utility Bill was issued within 30 days of the contract date. The Utility Bill has a past due amount.",
"verification_questions": {},
"acceptable_documents": {
"utility_bill": [
{
"document_id": "83960c26-7fb2-4b72-8786-3b859d41a6b3",
"file_ids": [
"c7682056-d003-4b53-b350-7373ab50482f"
],
"file_reference_ids": [
"../test_images/appid_001/joint_documents.pdf"
],
"category": "Utility Bill",
"document_questions": {
"matches_applicant_name": {
"question": "Matches the applicant's name?",
"expected": "Lucinda Bonadio",
"answer": "Lucinda Bonadio",
"status": "pass"
},
"is_issued_recently": {
"question": "Issued within 30 days of the contract date?",
"expected": ">=03/13/2021",
"answer": "04/10/2021",
"status": "pass"
},
"has_amount_past_due": {
"question": "Has amount past due?",
"expected": "FALSE",
"answer": "FALSE",
"status": "pass"
},
"matches_applicant_address": {
"question": "Matches the applicant's address?",
"expected": "2317 N Winery Ave Fresno CA 93703",
"answer": "2317 N Winery Ave, Fresno, CA 93703, USA",
"status": "pass"
}
}
}
]
},
"recommendations": []
}
],
"identity": [
{
"status": "pass",
"belongs_to": "applicant1",
"updated_at": "2023-04-24 19:38:29 +0000",
"description": "Informed searched for a Driver's License and found one in the deal jacket. The Driver's License matches the applicant's name. The Driver's License is not expired. The Driver's License was issued by a U.S. State. The Driver's License may not show the same Identification Number as provided by the Applicant; a manual review is needed. The Driver's License may not show the same Expiration Date as provided by the Applicant; a manual review is needed.",
"verification_questions": {},
"acceptable_documents": {
"driver_license_front": [
{
"document_id": "116f8fc6-9873-467f-8690-c65e4df35736",
"file_ids": [
"c7682056-d003-4b53-b350-7373ab50482f"
],
"file_reference_ids": [
"../test_images/appid_001/joint_documents.pdf"
],
"category": "Driver's License",
"document_questions": {
"matches_applicant_name": {
"question": "Matches the applicant's name?",
"expected": "Jo Boren",
"answer": "Jo Boren",
"status": "pass"
},
"is_us_issued_id": {
"question": "Is a US Driver's License?",
"expected": true,
"answer": "CA",
"status": "pass"
},
"is_expired": {
"question": "Expired?",
"expected": ">05/12/2021",
"answer": "10/12/2027",
"status": "pass"
},
"matches_cudl_driver_license_id": {
"question": "Matches Drivers License identification number?",
"expected": "",
"answer": "D1234568",
"status": "review"
},
"matches_cudl_driver_license_expiration_date": {
"question": "Matches Drivers License expiration date?",
"expected": "",
"answer": "2027-10-12",
"status": "review"
}
}
}
]
},
"recommendations": []
}
]
}
}