Phase 4
Overview
In phase 4, we add the ability to upload eContract data along with the images. Examples of an eContract in XML format and in a JSON formatted version accepted by Informed are provided in the phase4 directory of the unzipped files labeled econtract.xml and structured_data.json respectively.
The fourth phase will focus on the following:
- Submitting an application that includes eContract data:
- As seen in the documentation,
structured_datais the JSON formatted representation ofeContract data structured_datawill be submitted along with the file names- Notice that we removed the
retail_installment_sales_contractverification in this step as the eContract data is taken as a source of truth for the contractual data
- As seen in the documentation,
- Submitting documents to satisfy the verifications
- Receiving the analyses back from Informed
Checklist
Locate the Python script
In your terminal navigate to the the destination directory containing the unzipped folder:
cd <local directory>/implementation_guide_phases/phase4/python
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
- structured_data payload
- 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:
- Converted the CSV data into a valid JSON payload with all the application-level verifications listed in
main.py->ALL_VERIFICATIONS - Submitted the payload to Informed and received an
app_idfrom Informed in the synchronous response - Used this
app_idto send a list of filenames to Informed along with the eContract data in the form of the JSON structured_data, and received URLs for each file - Used these URL's to upload all the files to their respective URL's
- Asynchronous responses were sent to the
webhookprovided - The webhook received one
extractionsresponse for each file uploaded and oneverificationsresponse once all files have been classified, extracted, and verified by Informed
Example app registration payload
register app payload (seen in terminal at run)
{
"application_reference_id": "Phase4_appid_001_337b6296-125f-40ea-b523-4ccf9d0c73f5",
"application_date": "2021-04-20T00:00:00",
"contract_date": "2021-05-12T00:00:00",
"contract_type": "Electronic",
"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": "Stocker",
"income": {
"period": "Monthly",
"amount": 4000.0
},
"start_date": "2018-04-13",
"is_current": true
}
],
"additional_incomes": [
{
"source": "Other",
"income": {
"period": "Monthly",
"amount": 300.0
}
}
]
}
},
"vehicle_info": {
"vin": "1HGCR2F52GA195235",
"make": "Honda",
"model": "Accord",
"year": 2016,
"condition": "Used",
"odometer": 62940,
"selling_price": 16900
},
"dealer_info": {
"dealer_name": "Toyota Of Hollywood",
"address": {
"street_address": "6000 Hollywood Blvd",
"city": "Los Angeles",
"state": "CA",
"zip": "90028"
},
"dealer_reference_id": "987654321"
},
"verifications": {
"credit_application": [
{
"belongs_to": "application"
}
],
"odometer_statement": [
{
"belongs_to": "application"
}
],
"bookout_sheet": [
{
"belongs_to": "application"
}
],
"gap_waiver_contract": [
{
"belongs_to": "application"
}
],
"vehicle_service_contract": [
{
"belongs_to": "application"
}
]
},
"services": [
"extract",
"verify"
],
"webhook": "https://your.callback.com/here"
}
Example filenames and econtract data payload
register filenames and structured data (seen in terminal at run)
{
"image_files": [
"../test_images/appid_001/vehicle_service_contract.pdf",
"../test_images/appid_001/gap_waiver_contract.pdf",
"../test_images/appid_001/paystub.pdf",
"../test_images/appid_001/DriversLicense.png",
"../test_images/appid_001/credit_application.pdf",
"../test_images/appid_001/odometer.pdf",
"../test_images/appid_001/bookout_sheet.pdf",
"../test_images/appid_001/UtilityBill.png"
],
"structured_data": [
{
"document_type": "retail_installment_sales_contract",
"document_reference_id": "Phase4_eContract_data_0001",
"source": "Dealertrack",
"url": null,
"extracted_data": {
"amount_financed": 42000.0,
"number_of_monthly_payments": 72,
"insurance_charges": [
{
"term": {
"month": 60,
"mileage": 60000
},
"type": "vsc",
"provider": "Secure One",
"premium": 3500.0
},
{
"term": null,
"type": "gap",
"provider": "DebtCancelONE",
"premium": 500.0
}
],
"other_charges": null
}
}
]
}
Example asynchronous extractions response
extractions response (received at callback url)
{
"event_type": "extractions",
"application_id": "44d9f9bf-0125-4789-9166-1fd3990597b8",
"application_reference_id": "Phase4_appid_001_337b6296-125f-40ea-b523-4ccf9d0c73f5",
"documents": {
"vehicle_service_contract": [
{
"data_action": "create",
"document_id": "c1612df4-7145-45af-b444-55e12d89441a",
"file_ids": [
"437910f9-7e4b-42a1-ac5a-50bd176d3590"
],
"file_reference_ids": [
"../test_images/appid_001/vehicle_service_contract.pdf"
],
"url": "https://file-location-in-S3.com",
"extracted_data": {
"applicants": {
"applicant1": {
"address": {
"zip": null,
"street_address": null,
"state": null,
"city": null
},
"last_name": "Boren",
"middle_name": null,
"suffix": null,
"first_name": "Jo"
},
"applicant2": {
"address": {
"zip": null,
"street_address": null,
"state": null,
"city": null
},
"last_name": null,
"middle_name": null,
"suffix": null,
"first_name": null
}
},
"policy_number": "",
"form_number": "SO-MAC 10/15",
"revision_date": "",
"effective_date": "2021-05-09",
"vin": "1HGCR2F52GA195235",
"year": 2016,
"make": "Honda",
"model": "Accord",
"provider": "secureone",
"premium": 3500,
"term_in_months": 36,
"expiration_date": "",
"term_in_miles": 30000,
"miles_expiration": "",
"lender_name": "Acme Financial, LLC",
"odometer": 62940,
"signatures": {
"document": {
"dealer": {
"section_present": true,
"signature_present": true,
"signature_date": "2021-05-09"
},
"applicant1": {
"section_present": true,
"signature_present": true,
"signature_date": "2021-05-09"
},
"applicant2": {
"section_present": null,
"signature_present": null,
"signature_date": null
}
}
}
},
"updated_at": "2023-04-24T20:23:47Z"
}
]
}
}
Example asynchronous verifications response
verifications response (received at callback url)
{
"event_type": "verifications",
"application_id": "44d9f9bf-0125-4789-9166-1fd3990597b8",
"application_reference_id": "Phase4_appid_001_337b6296-125f-40ea-b523-4ccf9d0c73f5",
"data_sources": {
"image_files": [
{
"file_id": "104c309d-88ff-4c83-9c99-814b96a94f5b",
"file_reference_id": "../test_images/appid_001/DriversLicense.png"
},
{
"file_id": "f620564f-a729-4e53-8b28-60d7e0046cee",
"file_reference_id": "../test_images/appid_001/UtilityBill.png"
},
{
"file_id": "80a4f590-1bb1-4874-87ba-33b45c8ee19e",
"file_reference_id": "../test_images/appid_001/paystub.pdf"
},
{
"file_id": "8ea0d5a5-6409-45cc-86c2-1675792de874",
"file_reference_id": "../test_images/appid_001/bookout_sheet.pdf"
},
{
"file_id": "af2ba261-1894-4452-b2d8-61fc76fc6c30",
"file_reference_id": "../test_images/appid_001/odometer.pdf"
},
{
"file_id": "d2fc20b8-fce0-494d-a224-855af5879b5b",
"file_reference_id": "../test_images/appid_001/credit_application.pdf"
},
{
"file_id": "0c752efa-e3bb-431c-9eae-66d8e1af3c19",
"file_reference_id": "../test_images/appid_001/gap_waiver_contract.pdf"
},
{
"file_id": "437910f9-7e4b-42a1-ac5a-50bd176d3590",
"file_reference_id": "../test_images/appid_001/vehicle_service_contract.pdf"
}
],
"structured_data": [
{
"document_id": "07a8f13f-516c-403e-ba99-fa242c4d803f",
"document_reference_id": "Phase4_eContract_data_0001"
}
]
},
"verifications": {
"bookout_sheet": [
{
"status": "pass",
"belongs_to": "application",
"updated_at": "2023-04-24 20:23:47 +0000",
"description": "Informed searched for a Bookout Sheet and found one in the deal jacket. The Bookout Sheet was issued within configured days of the credit approval. The Bookout Sheet matches the contract's mileage. The Bookout Sheet matches the contract's price. The Bookout Sheet matches the contract's vehicle identification number. The Bookout Sheet matches the application's vehicle make. The Bookout Sheet matches the application's vehicle model. The Bookout Sheet matches the application's vehicle year.",
"verification_questions": {},
"acceptable_documents": {
"bookout_sheet": [
{
"document_id": "ae834b6c-0404-437c-a5d2-2b88e751d512",
"file_ids": [
"8ea0d5a5-6409-45cc-86c2-1675792de874"
],
"file_reference_ids": [
"../test_images/appid_001/bookout_sheet.pdf"
],
"category": "Bookout Sheet",
"document_questions": {
"document_recency": {
"question": "Issued within configured days of the contract date?",
"expected": ">=03/13/2021",
"answer": "05/07/2021",
"status": "pass"
},
"matches_contract_mileage": {
"question": "Matches the contract's mileage?",
"expected": 62940,
"answer": 62913,
"status": "pass"
},
"matches_contract_price": {
"question": "Is the price in-line with what's listed on the contract?",
"expected": 16900,
"answer": 19007,
"status": "pass"
},
"matches_contract_vin": {
"question": "Matches the contract's VIN?",
"expected": "1HGCR2F52GA195235",
"answer": "1HGCR2F52GA195235",
"status": "pass"
},
"matches_application_vehicle_make": {
"question": "Matches the application's vehicle make?",
"expected": "Honda",
"answer": "Honda",
"status": "pass"
},
"matches_application_vehicle_model": {
"question": "Matches the application's vehicle model?",
"expected": "Accord",
"answer": "Accord",
"status": "pass"
},
"matches_application_vehicle_year": {
"question": "Matches the application's vehicle year?",
"expected": "2016",
"answer": 2016,
"status": "pass"
}
}
}
]
},
"recommendations": []
}
],
"credit_application": [
{
"status": "pass",
"belongs_to": "application",
"updated_at": "2023-04-24 20:23:47 +0000",
"description": "Informed searched for a Credit Application and found one in the deal jacket. The Credit Application matches the applicant1's name. The Credit Application has been signed by applicant1. The Credit Application matches the applicant1's address. The Credit Application marketing consent has been signed by applicant 1. The Credit Application FCRA has been signed by applicant 1. The Credit Application matches the applicant1's SSN. The Credit Application matches the applicant date of birth.",
"verification_questions": {},
"acceptable_documents": {
"credit_application": [
{
"document_id": "932b9213-2453-4eef-83b8-3fb10512a7cb",
"file_ids": [
"d2fc20b8-fce0-494d-a224-855af5879b5b"
],
"file_reference_ids": [
"../test_images/appid_001/credit_application.pdf"
],
"category": "Credit Application",
"document_questions": {
"matches_applicant1_name": {
"question": "Matches the applicant1's name?",
"expected": "Jo Boren",
"answer": "Jo Boren",
"status": "pass"
},
"signed_by_applicant1": {
"question": "Signed by applicant1?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"matches_applicant1_address": {
"question": "Matches the applicant1's address?",
"expected": "8717 S 4th Ave Inglewood CA 90305",
"answer": "8717 S 4th Ave, Inglewood, CA 90305, USA",
"status": "pass"
},
"marketing_consent_signed_by_applicant1": {
"question": "Marketing Consent Signed by Applicant 1?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"fcra_signed_by_applicant1": {
"question": "FCRA Signed by Applicant 1?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"matches_applicant1_ssn": {
"question": "Matches the applicant1's SSN?",
"expected": "666443906",
"answer": "666443906",
"status": "pass"
},
"matches_applicant1_dob": {
"question": "Matches applicant1 date of birth?",
"expected": "1965-12-10",
"answer": "1965-12-10",
"status": "pass"
}
}
}
]
},
"recommendations": []
}
],
"gap_waiver_contract": [
{
"status": "pass",
"belongs_to": "application",
"updated_at": "2023-04-24 20:23:47 +0000",
"description": "Informed searched for a Gap Binder and found one in the deal jacket. The Gap Binder matches the applicant1's name. The Gap Binder has been signed by applicant1. The Gap Binder has been signed by dealer. The Gap Binder has the administrator name. The Gap Binder has an expiration date. The Gap Binder matches an approved form number. The Gap Binder matches the contract's premium. The Gap Binder spans a portion of the contract's term. The Gap Binder lists lender as loss payee. The Gap Binder matches the contract's vehicle identification number.",
"verification_questions": {},
"acceptable_documents": {
"gap_binder": [
{
"document_id": "fd4bcf3f-7a77-4622-ba14-cf83f408320e",
"file_ids": [
"0c752efa-e3bb-431c-9eae-66d8e1af3c19"
],
"file_reference_ids": [
"../test_images/appid_001/gap_waiver_contract.pdf"
],
"category": "Gap Binder",
"document_questions": {
"matches_applicant1_name": {
"question": "Matches the applicant1's name?",
"expected": "Jo Boren",
"answer": "Jo Boren",
"status": "pass"
},
"signed_by_applicant1": {
"question": "Signed by applicant1?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"signed_by_dealer": {
"question": "Signed by dealer?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"provider": {
"question": "What is the administrator name?",
"expected": "",
"answer": "Universal Warranty Corporation",
"status": "pass"
},
"expiration_date": {
"question": "What is the expiration date?",
"expected": "",
"answer": "2027-04-09",
"status": "pass"
},
"matches_approved_form_number": {
"question": "Matches an approved form number?",
"expected": "",
"answer": "GAP-150-PRO-TX (04-21)",
"status": "pass"
},
"matches_contract_premium": {
"question": "Matches the contract's premium?",
"expected": 500,
"answer": 500,
"status": "pass"
},
"is_effective_on_contract_date": {
"question": "Is effective on contract date?",
"expected": "<=05/12/2021",
"answer": "05/09/2021",
"status": "pass"
},
"is_lender_loss_payee": {
"question": "Lists lender as loss payee?",
"expected": "acme financial, llc",
"answer": "Acme Financial, LLC",
"status": "pass"
},
"matches_contract_vin": {
"question": "Matches the contract's VIN?",
"expected": "1HGCR2F52GA195235",
"answer": "1HGCR2F52GA195235",
"status": "pass"
}
}
}
]
},
"recommendations": []
}
],
"odometer_statement": [
{
"status": "pass",
"belongs_to": "application",
"updated_at": "2023-04-24 20:23:47 +0000",
"description": "Informed searched for an Odometer Disclosure Statement Retail and found one in the deal jacket. The Odometer Disclosure Statement Retail matches the applicant1's name. The Odometer Disclosure Statement Retail has been signed by applicant1. The Odometer Disclosure Statement Retail has been signed by dealer. The Odometer Disclosure Statement Retail matches the contract's mileage. The Odometer Disclosure Statement Retail matches the contract's vehicle identification number.",
"verification_questions": {},
"acceptable_documents": {
"odometer_disclosure_statement_retail": [
{
"document_id": "44860109-85d9-4e94-8db6-152d78ab27cc",
"file_ids": [
"af2ba261-1894-4452-b2d8-61fc76fc6c30"
],
"file_reference_ids": [
"../test_images/appid_001/odometer.pdf"
],
"category": "Odometer Disclosure Statement Retail",
"document_questions": {
"matches_applicant1_name": {
"question": "Matches the applicant1's name?",
"expected": "Jo Boren",
"answer": "Jo Boren",
"status": "pass"
},
"signed_by_applicant1": {
"question": "Signed by applicant1?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"signed_by_dealer": {
"question": "Signed by dealer?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"matches_contract_mileage": {
"question": "Matches the contract's mileage?",
"expected": 62940,
"answer": 62940,
"status": "pass"
},
"matches_contract_vin": {
"question": "Matches the contract's VIN?",
"expected": "1HGCR2F52GA195235",
"answer": "1HGCR2F52GA195235",
"status": "pass"
}
}
}
]
},
"recommendations": []
}
],
"vehicle_service_contract": [
{
"status": "pass",
"belongs_to": "application",
"updated_at": "2023-04-24 20:23:47 +0000",
"description": "Informed searched for a Vehicle Service Contract and found one in the deal jacket. The Vehicle Service Contract matches the applicant1's name. The Vehicle Service Contract has been signed by applicant1. The Vehicle Service Contract has been signed by dealer. The Vehicle Service Contract has the administrator name. The Vehicle Service Contract has a mileage expiration. The Vehicle Service Contract has an expiration date. The Vehicle Service Contract matches an approved form number. The Vehicle Service Contract matches the contract's premium. The Vehicle Service Contract spans a portion of the contract's term. The Vehicle Service Contract matches the contract's vehicle identification number.",
"verification_questions": {},
"acceptable_documents": {
"vehicle_service_contract": [
{
"document_id": "c1612df4-7145-45af-b444-55e12d89441a",
"file_ids": [
"437910f9-7e4b-42a1-ac5a-50bd176d3590"
],
"file_reference_ids": [
"../test_images/appid_001/vehicle_service_contract.pdf"
],
"category": "Vehicle Service Contract",
"document_questions": {
"matches_applicant1_name": {
"question": "Matches the applicant1's name?",
"expected": "Jo Boren",
"answer": "Jo Boren",
"status": "pass"
},
"signed_by_applicant1": {
"question": "Signed by applicant1?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"signed_by_dealer": {
"question": "Signed by dealer?",
"expected": "TRUE",
"answer": "TRUE",
"status": "pass"
},
"provider": {
"question": "What is the administrator name?",
"expected": "",
"answer": "secureone",
"status": "pass"
},
"mileage_expiration": {
"question": "What is the mileage expiration?",
"expected": "",
"answer": 92940,
"status": "pass"
},
"expiration_date": {
"question": "What is the expiration date?",
"expected": "",
"answer": "2024-05-09",
"status": "pass"
},
"matches_approved_form_number": {
"question": "Matches an approved form number?",
"expected": "",
"answer": "SO-MAC 10/15",
"status": "pass"
},
"matches_contract_premium": {
"question": "Matches the contract's premium?",
"expected": 3500,
"answer": 3500,
"status": "pass"
},
"is_effective_on_contract_date": {
"question": "Is effective on contract date?",
"expected": "<=05/12/2021",
"answer": "05/09/2021",
"status": "pass"
},
"matches_contract_vin": {
"question": "Matches the contract's VIN?",
"expected": "1HGCR2F52GA195235",
"answer": "1HGCR2F52GA195235",
"status": "pass"
}
}
}
]
},
"recommendations": []
}
]
}
}