{
	"info": {
		"_postman_id": "4925a808-dffe-4bf6-93ff-f8a06ec27077",
		"name": "RIBBIT API v4",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "1441636",
		"_collection_link": "https://universal-firefly-406321.postman.co/workspace/Greg-Senne~aada054b-5b12-48d2-8430-34ee5cceff75/collection/1441636-4925a808-dffe-4bf6-93ff-f8a06ec27077?action=share&source=collection_link&creator=1441636"
	},
	"item": [
		{
			"name": "Token",
			"item": [
				{
					"name": "OAuth 2.0 Token",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"clientId\": \"{{clientId}}\",\r\n    \"clientSecret\": \"{{clientSecret}}\"\r\n}"
						},
						"url": {
							"raw": "https://{{domain}}/v4/token",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"token"
							]
						}
					},
					"response": []
				},
				{
					"name": "Health Check",
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": ""
						},
						"url": {
							"raw": "https://{{domain}}/v4/HealthCheck",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"HealthCheck"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Insights",
			"item": [
				{
					"name": "BankQUALIFY",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"var domain = pm.environment.get('domain');\r",
									"var clientId = pm.environment.get('clientId');\r",
									"var clientSecret = pm.environment.get('clientSecret');\r",
									"\r",
									"const postRequest = {\r",
									"  url: 'https://' + domain + '/v4/token',\r",
									"  method: 'POST',\r",
									"  timeout: 0,\r",
									"  header: {\r",
									"    \"Content-Type\": \"application/json\"\r",
									"  },\r",
									"  body: {\r",
									"      mode: 'raw',\r",
									"      raw: JSON.stringify({\r",
									"        \"clientId\" : clientId,\r",
									"        \"clientSecret\" : clientSecret\r",
									"      })\r",
									"  }\r",
									"};\r",
									"\r",
									"pm.sendRequest(postRequest, function (err, res) {\r",
									"    var responseJson = res.json();\r",
									"    console.log(responseJson);\r",
									"    pm.environment.set('token', responseJson['accessToken']);\r",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    // Product ID: 1: BankQUALIFY, 2: BankVERIFY+, 3: BankLOGIN+\r\n    \"productId\": 1,\r\n\r\n    // Reference ID: Your reference ID\r\n    \"referenceId\": null,\r\n\r\n    // Inquiry ID: Used when a previous Insights product was ran and you are getting more info (ex. You have ran BankQUALIFY, and would now like BankVERIFY+ Insights on the same data\r\n    \"inquiryId\": null,\r\n\r\n    // Account Details. Required for BankQUALIFY\r\n    \"account\": {\r\n        \"routingNumber\": \"642260020\",\r\n        \"accountNumber\": \"2182456087\"\r\n    },\r\n\r\n    // Consumer PII\r\n    \"consumer\": {\r\n        \"firstName\": \"John\",\r\n        \"middleName\": null,\r\n        \"lastName\": \"Smith\",\r\n        \"phone\": \"5135242320\",\r\n        \"email\": \"test@ribbit.ai\",\r\n        \"address\": {\r\n            \"address\": \"5166 College Corner Pike\",\r\n            \"city\": \"Oxford\",\r\n            \"state\": \"OH\",\r\n            \"zip\": \"45056\"\r\n        }\r\n    },\r\n\r\n    // The full loan amount or full purchase price. This value can be hard-coded as an average per portfolio\r\n    \"offerAmount\": 6000,\r\n\r\n    // The individual payment amount. This value can be hard-coded as an average per portfolio\r\n    \"paymentAmount\": 500,\r\n\r\n    // The repayment terms of the loan. Options: \"daily_oblig\", \"weekly_oblig\", \"biweekly_oblig\", \"monthly_oblig\"\r\n    \"terms\": \"biweekly_oblig\"\r\n\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://{{domain}}/v4/Insights",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"Insights"
							]
						}
					},
					"response": []
				},
				{
					"name": "BankVERIFY+",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"var domain = pm.environment.get('domain');\r",
									"var clientId = pm.environment.get('clientId');\r",
									"var clientSecret = pm.environment.get('clientSecret');\r",
									"\r",
									"const postRequest = {\r",
									"  url: 'https://' + domain + '/v4/token',\r",
									"  method: 'POST',\r",
									"  timeout: 0,\r",
									"  header: {\r",
									"    \"Content-Type\": \"application/json\"\r",
									"  },\r",
									"  body: {\r",
									"      mode: 'raw',\r",
									"      raw: JSON.stringify({\r",
									"        \"clientId\" : clientId,\r",
									"        \"clientSecret\" : clientSecret\r",
									"      })\r",
									"  }\r",
									"};\r",
									"\r",
									"pm.sendRequest(postRequest, function (err, res) {\r",
									"    var responseJson = res.json();\r",
									"    console.log(responseJson);\r",
									"    pm.environment.set('token', responseJson['accessToken']);\r",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    // Product ID: 1: BankQUALIFY, 2: BankVERIFY+, 3: BankLOGIN+\r\n    \"productId\": 2,\r\n\r\n    // Reference ID: Your reference ID\r\n    \"referenceId\": null,\r\n\r\n    // Inquiry ID: Used when a previous Insights product was ran and you are getting more info (ex. You have ran BankQUALIFY, and would now like BankVERIFY+ Insights on the same data\r\n    \"inquiryId\": null,\r\n\r\n    // Account Details. Required for BankQUALIFY, recommended for BankVERIFY+\r\n    \"account\": {\r\n        \"routingNumber\": \"642260020\",\r\n        \"accountNumber\": \"5378534336\"\r\n    },\r\n\r\n    // Consumer PII\r\n    \"consumer\": {\r\n        \"firstName\": \"John\",\r\n        \"middleName\": null,\r\n        \"lastName\": \"Doe\",\r\n        \"phone\": \"5135242320\",\r\n        \"email\": \"test@RIBBIT.ai\",\r\n        \"address\": {\r\n            \"address\": \"5166 College Corner Pike\",\r\n            \"city\": \"Oxford\",\r\n            \"state\": \"OH\",\r\n            \"zip\": \"45056\"\r\n        },\r\n        \"annualIncome\": 100000,\r\n        \"employerName\": null,\r\n        \"payCheckFrequency\": null,\r\n        \"avgPaycheckAmount\": 4166\r\n    },\r\n\r\n    // For business requests, include the business node instead of the consumer node\r\n    \"business\": null,\r\n\r\n    // The full loan amount or full purchase price. This value can be hard-coded as an average per portfolio\r\n    \"offerAmount\": 6000,\r\n\r\n    // The individual payment amount. This value can be hard-coded as an average per portfolio\r\n    \"paymentAmount\": 500,\r\n\r\n    // The repayment terms of the loan. Options: \"daily_oblig\", \"weekly_oblig\", \"biweekly_oblig\", \"monthly_oblig\"\r\n    \"terms\": \"biweekly_oblig\"\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://{{domain}}/v4/Insights",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"Insights"
							]
						}
					},
					"response": []
				},
				{
					"name": "BankLOGIN+",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"var domain = pm.environment.get('domain');\r",
									"var clientId = pm.environment.get('clientId');\r",
									"var clientSecret = pm.environment.get('clientSecret');\r",
									"\r",
									"const postRequest = {\r",
									"  url: 'https://' + domain + '/v4/token',\r",
									"  method: 'POST',\r",
									"  timeout: 0,\r",
									"  header: {\r",
									"    \"Content-Type\": \"application/json\"\r",
									"  },\r",
									"  body: {\r",
									"      mode: 'raw',\r",
									"      raw: JSON.stringify({\r",
									"        \"clientId\" : clientId,\r",
									"        \"clientSecret\" : clientSecret\r",
									"      })\r",
									"  }\r",
									"};\r",
									"\r",
									"pm.sendRequest(postRequest, function (err, res) {\r",
									"    var responseJson = res.json();\r",
									"    console.log(responseJson);\r",
									"    pm.environment.set('token', responseJson['accessToken']);\r",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "// BankLOGIN+ request when using bank transaction data from a third-party aggregator.\r\n// To use BankLOGIN+ with our bank login solution, please see https://test.RIBBIT.ai/CONNECT\r\n\r\n{\r\n    // Product ID: 1: BankQUALIFY, 2: BankVERIFY+, 3: BankLOGIN+\r\n    \"productId\": 3,\r\n\r\n    // Reference ID: Your reference ID\r\n    \"referenceId\": null,\r\n\r\n    // Inquiry ID: Used when a previous Insights product was ran and you are getting more info (ex. You have ran BankQUALIFY, and would now like BankVERIFY+ Insights on the same data\r\n    \"inquiryId\": null,\r\n\r\n    // Consumer PII\r\n    \"consumer\": {\r\n        \"firstName\": \"John\",\r\n        \"middleName\": null,\r\n        \"lastName\": \"Doe\",\r\n        \"phone\": \"5135242320\",\r\n        \"email\": \"test@RIBBIT.ai\",\r\n        \"address\": {\r\n            \"address\": \"5166 College Corner Pike\",\r\n            \"city\": \"Oxford\",\r\n            \"state\": \"OH\",\r\n            \"zip\": \"45056\"\r\n        },\r\n        \"annualIncome\": 100000,\r\n        \"employerName\": null,\r\n        \"payCheckFrequency\": null,\r\n        \"avgPaycheckAmount\": 4166\r\n    },\r\n\r\n    // The blp object is required to submit external bank transaction data\r\n    \"blp\" : {\r\n\r\n        // The number of days of transaction history that BankLOGINInsights  should consider. \r\n        // Default (and minimum): 93 days\r\n        \"transactionHistoryDays\": 93,\r\n\r\n        \"thirdPartySourceData\": {\r\n            \r\n            // The ID of the third-party source. See https://apidocs.RIBBIT.ai for list\r\n            \"externalProviderId\": 0,\r\n\r\n            // A JSON string of the external bank transaction data\r\n            \"data\" : \"{your third party JSON }\"\r\n        }\r\n    },\r\n\r\n    // For business requests, include the business node instead of the consumer node\r\n    \"business\": null,\r\n\r\n    // The full loan amount or full purchase price. This value can be hard-coded as an average per portfolio\r\n    \"offerAmount\": 6000,\r\n\r\n    // The individual payment amount. This value can be hard-coded as an average per portfolio\r\n    \"paymentAmount\": 500,\r\n\r\n    // The repayment terms of the loan. Options: \"daily_oblig\", \"weekly_oblig\", \"biweekly_oblig\", \"monthly_oblig\"\r\n    \"terms\": \"biweekly_oblig\"\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://{{domain}}/v4/Insights",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"Insights"
							]
						}
					},
					"response": []
				},
				{
					"name": "Get Insights",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"var domain = pm.environment.get('domain');\r",
									"var clientId = pm.environment.get('clientId');\r",
									"var clientSecret = pm.environment.get('clientSecret');\r",
									"\r",
									"const postRequest = {\r",
									"  url: 'https://' + domain + '/v4/token',\r",
									"  method: 'POST',\r",
									"  timeout: 0,\r",
									"  header: {\r",
									"    \"Content-Type\": \"application/json\"\r",
									"  },\r",
									"  body: {\r",
									"      mode: 'raw',\r",
									"      raw: JSON.stringify({\r",
									"        \"clientId\" : clientId,\r",
									"        \"clientSecret\" : clientSecret\r",
									"      })\r",
									"  }\r",
									"};\r",
									"\r",
									"pm.sendRequest(postRequest, function (err, res) {\r",
									"    var responseJson = res.json();\r",
									"    console.log(responseJson);\r",
									"    pm.environment.set('token', responseJson['accessToken']);\r",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": ""
						},
						"url": {
							"raw": "https://{{domain}}/v4/Insights/2/{{inquiryId}}",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"Insights",
								"2",
								"{{inquiryId}}"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "CONNECT",
			"item": [
				{
					"name": "CONNECT Session",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    // CONNECT credentials are different from API credentials.\r\n    // You can find your credentials by logging in to https://{test|portal}.RIBBIT.ai and clicking CONNECT\r\n    \"token\": {\r\n        \"clientId\": \"{{widgetClientId}}\",\r\n        \"clientSecret\": \"{{widgetClientSecret}}\"\r\n    },\r\n\r\n    // Consumer PII\r\n    \"customer\": {\r\n        \"customerId\": \"RIBBIT_TEST\",\r\n        \"firstName\": \"John\",\r\n        \"lastName\": \"Smith\",\r\n        \"emailAddress\": \"test@noemail.com\",\r\n        \"phoneNumber\": \"1112223333\",\r\n        \"address\": {\r\n            \"addressLine1\": \"123 Main St\",\r\n            \"city\": \"Oxford\",\r\n            \"state\": \"OH\",\r\n            \"zip\": \"12345\"\r\n        },\r\n        \"annualIncome\": 100000,\r\n        \"employerName\": null,\r\n        \"payCheckFrequency\": null,\r\n        \"avgPaycheckAmount\": 4166\r\n    },\r\n\r\n    // The terms of the loan or payment. These fields are used in the generation of insights attributes\r\n    \"terms\": {\r\n        \"fullAmount\": 500,\r\n        \"amount\": 100,\r\n        \"loanTerms\": \"biweekly_oblig\"\r\n    },\r\n\r\n    // Session-specific settings\r\n    \"settings\": {\r\n\r\n        // To have events returned to a custom webhook URL, provide it here.\r\n        // The webhook URL can also be set for all sessions in your application settings.\r\n        // By default, we will only send the complete and launch events. To send additional events, they must be enabled in your application settings. \r\n        // Log in and select CONNECT > Settings for more details, or see https://test.RIBBIT.ai/Widgets/Events\r\n        \"webhookURL\" : null,\r\n\r\n        // Bank ID for forcing a user to a specific bank\r\n        // See https://test.ribbit.ai/Widgets/BankLookup for details\r\n        \"bankId\" : null,\r\n\r\n        // The number of days of transaction history that BankLOGINInsights  should consider. \r\n        // Default (and minimum): 93 days\r\n        \"transactionHistoryDays\": 93\r\n    },\r\n\r\n    // To send the CONNECT link to your customer\r\n    // 0: Do not send, 1: Send SMS to phone number in the customer object, 2: Send email to address in customer object\r\n    \"notificationType\": 0\r\n}"
						},
						"url": {
							"raw": "https://{{domain}}/v4/CONNECT/Session",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"CONNECT",
								"Session"
							]
						}
					},
					"response": []
				},
				{
					"name": "Bank Lookup",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"var domain = pm.environment.get('domain');\r",
									"var clientId = pm.environment.get('clientId');\r",
									"var clientSecret = pm.environment.get('clientSecret');\r",
									"\r",
									"const postRequest = {\r",
									"  url: 'https://' + domain + '/v4/token',\r",
									"  method: 'POST',\r",
									"  timeout: 0,\r",
									"  header: {\r",
									"    \"Content-Type\": \"application/json\"\r",
									"  },\r",
									"  body: {\r",
									"      mode: 'raw',\r",
									"      raw: JSON.stringify({\r",
									"        \"clientId\" : clientId,\r",
									"        \"clientSecret\" : clientSecret\r",
									"      })\r",
									"  }\r",
									"};\r",
									"\r",
									"pm.sendRequest(postRequest, function (err, res) {\r",
									"    var responseJson = res.json();\r",
									"    console.log(responseJson);\r",
									"    pm.environment.set('token', responseJson['accessToken']);\r",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"url": {
							"raw": "https://{{domain}}/v4/CONNECT/Banks?search={{routingNumber}}",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"CONNECT",
								"Banks"
							],
							"query": [
								{
									"key": "search",
									"value": "{{routingNumber}}"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Get Full Account Info from CONNECT Session",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"var domain = pm.environment.get('domain');\r",
									"var clientId = pm.environment.get('clientId');\r",
									"var clientSecret = pm.environment.get('clientSecret');\r",
									"\r",
									"const postRequest = {\r",
									"  url: 'https://' + domain + '/v4/token',\r",
									"  method: 'POST',\r",
									"  timeout: 0,\r",
									"  header: {\r",
									"    \"Content-Type\": \"application/json\"\r",
									"  },\r",
									"  body: {\r",
									"      mode: 'raw',\r",
									"      raw: JSON.stringify({\r",
									"        \"clientId\" : clientId,\r",
									"        \"clientSecret\" : clientSecret\r",
									"      })\r",
									"  }\r",
									"};\r",
									"\r",
									"pm.sendRequest(postRequest, function (err, res) {\r",
									"    var responseJson = res.json();\r",
									"    console.log(responseJson);\r",
									"    pm.environment.set('token', responseJson['accessToken']);\r",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"url": {
							"raw": "https://{{domain}}/v4/accounts/{accountToken}/export",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"accounts",
								"{accountToken}",
								"export"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Reports",
			"item": [
				{
					"name": "AffordAi",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"var domain = pm.environment.get('domain');\r",
									"var clientId = pm.environment.get('clientId');\r",
									"var clientSecret = pm.environment.get('clientSecret');\r",
									"\r",
									"const postRequest = {\r",
									"  url: 'https://' + domain + '/v4/token',\r",
									"  method: 'POST',\r",
									"  timeout: 0,\r",
									"  header: {\r",
									"    \"Content-Type\": \"application/json\"\r",
									"  },\r",
									"  body: {\r",
									"      mode: 'raw',\r",
									"      raw: JSON.stringify({\r",
									"        \"clientId\" : clientId,\r",
									"        \"clientSecret\" : clientSecret\r",
									"      })\r",
									"  }\r",
									"};\r",
									"\r",
									"pm.sendRequest(postRequest, function (err, res) {\r",
									"    var responseJson = res.json();\r",
									"    console.log(responseJson);\r",
									"    pm.environment.set('token', responseJson['accessToken']);\r",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    // Provide an inquiryId from BankLOGIN+\r\n    // AffordAI will not run with a BankQUALIFY or BankVERIFY+ InquiryId\r\n   \"blpInquiryId\": \"{{inquiryId}}\",\r\n\r\n\r\n   // Optional Parameters\r\n\r\n   // Your Reference ID for tracking purposes\r\n   \"referenceId\": null,\r\n\r\n   \"customization\" : {\r\n       // Show Consumer PII on the generated report\r\n       \"showPII\": true\r\n   }\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://{{domain}}/v4/affordai",
							"protocol": "https",
							"host": [
								"{{domain}}"
							],
							"path": [
								"v4",
								"affordai"
							]
						}
					},
					"response": []
				}
			]
		}
	]
}