diff --git a/finicity.postman_collection.json b/finicity.postman_collection.json index fbdef14..fa16b5b 100644 --- a/finicity.postman_collection.json +++ b/finicity.postman_collection.json @@ -3949,15 +3949,6 @@ "})" ] } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } } ] }, @@ -15946,6 +15937,212 @@ "body": "{\n \"code\": 10100,\n \"message\": \"Cannot find consumer with id 1234.\"\n}" } ] + }, + { + "name": "Get Account Owner Details", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Check status code\", function () {\r", + " pm.expect(pm.response.code).to.equals(200)\r", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Finicity-App-Key", + "value": "{{appKey}}", + "type": "text" + }, + { + "key": "Finicity-App-Token", + "value": "{{appToken}}", + "type": "text" + } + ], + "url": { + "raw": "{{baseUrl}}/aggregation/v3/customers/{{customerId}}/accounts/{{accountId}}/owner", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "aggregation", + "v3", + "customers", + "{{customerId}}", + "accounts", + "{{accountId}}", + "owner" + ] + }, + "description": "This service retrieves the account details for an account holder from an institution. The following data objects are available.\n* Account holders\n* Addresses\n* Emails\n* Phones\n* Documentations\n\nNote: the data returned varies from institution to institution as not all of them make the same data available. This is a premium service, billable per each successful API call.\n\n_Supported regions_: ![🇺🇸](https://flagcdn.com/20x15/us.png)" + }, + "response": [ + { + "name": "The account owner was successfully retrieved", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Finicity-App-Key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/aggregation/v3/customers/:customerId/accounts/:accountId/owner", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "aggregation", + "v3", + "customers", + ":customerId", + "accounts", + ":accountId", + "owner" + ], + "variable": [ + { + "key": "customerId", + "value": "1005061234", + "description": "(Required) A customer ID" + }, + { + "key": "accountId", + "value": "5011648377", + "description": "(Required) The account ID" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{}" + }, + { + "name": "The request was rejected", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Finicity-App-Key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/aggregation/v3/customers/:customerId/accounts/:accountId/owner", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "aggregation", + "v3", + "customers", + ":customerId", + "accounts", + ":accountId", + "owner" + ], + "variable": [ + { + "key": "customerId", + "value": "1005061234", + "description": "(Required) A customer ID" + }, + { + "key": "accountId", + "value": "5011648377", + "description": "(Required) The account ID" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"code\": \"10010\",\n \"status\": \"400\",\n \"message\": \"\\\"partnerId\\\" is required\",\n \"user_message\": \"One or more of the fields could not be validated. Please ensure you have entered the correct data.\",\n \"tags\": \"\"\n}" + }, + { + "name": "The request lacks valid authentication credentials. Check \"Finicity-App-Key\" or \"Finicity-App-Token\".", + "originalRequest": { + "method": "GET", + "header": [ + { + "description": "Added as a part of security scheme: apikey", + "key": "Finicity-App-Key", + "value": "" + } + ], + "url": { + "raw": "{{baseUrl}}/aggregation/v3/customers/:customerId/accounts/:accountId/owner", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "aggregation", + "v3", + "customers", + ":customerId", + "accounts", + ":accountId", + "owner" + ], + "variable": [ + { + "key": "customerId", + "value": "1005061234", + "description": "(Required) A customer ID" + }, + { + "key": "accountId", + "value": "5011648377", + "description": "(Required) The account ID" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "cookie": [], + "body": "{\n \"code\": \"10022\",\n \"status\": \"401\",\n \"message\": \"Invalid authorization credentials\",\n \"user_message\": \"The session has expired or is invalid\",\n \"tags\": \"\"\n}" + } + ] } ], "description": "Fetch ACH details and account balances", @@ -15961,11 +16158,12 @@ "const appToken = pm.globals.get(\"appToken\")", "", "const savingAccountId = pm.variables.get(\"savingAccountId\")", - "if (savingAccountId) {", + "const accountId = pm.variables.get(\"accountId\")", + "if (savingAccountId && accountId) {", " return", "}", "", - "console.log(\"Fetching 'savings' account ID\")", + "console.log(\"Fetching account IDs\")", "const options = {", " url: baseUrl + \"/aggregation/v1/customers/\"+ customerId + \"/accounts\",", " method: 'GET',", @@ -15978,8 +16176,10 @@ "pm.sendRequest(options, function (err, response) {", " pm.expect(err).to.be.null", " pm.expect(response.code).to.equals(200)", - " const account = response.json().accounts.filter(a => a.type === \"savings\")[0]", + " const accounts = response.json().accounts;", + " const account = accounts.filter(a => a.type === \"savings\")[0]", " pm.variables.set(\"savingAccountId\", account.id)", + " pm.variables.set(\"accountId\", accounts[0].id)", "})" ] } @@ -17860,15 +18060,6 @@ "" ] } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } } ] }, @@ -17878,15 +18069,6 @@ { "name": "Generate Third Party Access Key", "event": [ - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - }, { "listen": "test", "script": { @@ -18603,15 +18785,6 @@ "})" ] } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } } ] }, @@ -24761,15 +24934,6 @@ "})" ] } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } } ] } @@ -24786,15 +24950,6 @@ "pm.environment.set(\"tomorrowIso8601\", `${moment().add(1, 'days').format(ISO_8601_OFFSET)}Z`);" ] } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } } ], "variable": [