{"info":{"_postman_id":"9096fb14-ec77-4ece-9bbf-5e804ecafd71","name":"Basiq API 2.1 (Beta Postman Collection)","description":"<html><head></head><body><p>We know how hard it can be to start developing with API's so at Basiq we have improved the experience by providing a beta template known as a Postman Collection.\nIn under 10 minutes you will have access to Basiq's full suite of products using our Sandbox environment!</p>\n<p>We hope you find it useful and we always welcome feedback. Enjoy!</p>\n<p>For full API Documentation see <a href=\"https://api.basiq.io\">https://api.basiq.io</a></p>\n<p>See also the <strong>Get started with Basiq</strong> guide: <a href=\"http://docs.basiq.io/getting-started/get-started-with-basiq\">http://docs.basiq.io/getting-started/get-started-with-basiq</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"16249946","collectionId":"9096fb14-ec77-4ece-9bbf-5e804ecafd71","publishedId":"UV5deuuH","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-10-28T02:20:29.000Z"},"item":[{"name":"Authenticate","item":[{"name":"Authenticate (server)","event":[{"listen":"test","script":{"id":"dc442ddb-065c-47eb-95b1-ddb198ffee63","exec":["postman.clearEnvironmentVariable('nextRequest');","postman.clearEnvironmentVariable('server-access-token');","postman.setEnvironmentVariable('accounts-checked', false)","","var data =  pm.response.json();","","pm.test(\"Acquired server_scope access token\", function () {","    pm.response.to.have.status(200);","    pm.response.to.have.jsonBody('access_token'); ","});","","postman.setEnvironmentVariable('server-access-token', data.access_token);","postman.setNextRequest('Get Institutions');",""],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"fb509f2b-07c3-4b31-b566-cba6a75d85be","exec":["var max_wait_secs = 180; //must be divisible by 10 and not greater than 300","","//Leave this alone!","postman.setEnvironmentVariable(\"poll-count\", max_wait_secs / 180); //multiple of 10 cannot be more than "],"type":"text/javascript"}}],"id":"0da7b1f6-8f1b-4815-ae69-16ce0280df30","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Authorization","value":"Basic XXXXXX","description":"<p>Replace XXXXXX with your API Key here</p>\n"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"},{"key":"basiq-version","value":"2.1"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"scope","value":"SERVER_ACCESS","description":"<p>For requests from your server side</p>\n","type":"text"}]},"url":"https://au-api.basiq.io/token","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#authentication\">https://api.basiq.io/reference#authentication</a></p>\n<p>Exchange your API key for a token - this token is valid for one hour.  Include the token in the Authorization header of each API request.</p>\n","urlObject":{"protocol":"https","path":["token"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"0da7b1f6-8f1b-4815-ae69-16ce0280df30"},{"name":"Authenticate (client)","event":[{"listen":"test","script":{"id":"2b8b354c-e65f-43d2-95f2-03871ec8a06c","exec":["postman.clearEnvironmentVariable('client-access-token');","","var data =  pm.response.json();","","pm.test(\"Acquired client_scope access token\", function () {","    pm.response.to.have.status(200);","    pm.response.to.have.jsonBody('access_token'); ","});","","postman.setEnvironmentVariable('client-access-token', data.access_token);","postman.setNextRequest('Create Connection');",""],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"d24f6652-5464-4666-bea8-e5fc8d362178","exec":["var max_wait_secs = 180; //must be divisible by 10 and not greater than 300","","//Leave this alone!","postman.setEnvironmentVariable(\"poll-count\", max_wait_secs / 180); //multiple of 10 cannot be more than "],"type":"text/javascript"}}],"id":"5e7e19ac-8386-44aa-9fd6-8f7d6edf5bf8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Authorization","value":"Basic XXXXXX","description":"<p>Replace XXXXXX with your API Key here</p>\n"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"},{"key":"basiq-version","value":"2.1"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"scope","value":"CLIENT_ACCESS","description":"<p>For requests from the client, e.g., Create Connection</p>\n","type":"text"}]},"url":"https://au-api.basiq.io/token","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#authentication\">https://api.basiq.io/reference#authentication</a></p>\n<p>Exchange your API key for a token - this token is valid for one hour.  Include the token in the Authorization header of each API request.</p>\n","urlObject":{"protocol":"https","path":["token"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"5e7e19ac-8386-44aa-9fd6-8f7d6edf5bf8"}],"id":"b14b9bd6-f38f-4967-befa-40b9947862bc","description":"<p>When working with Basiq APIs your application will need to complete the authentication process first before you can access any of the available resources.</p>\n<p>The authentication process is fairly straightforward and simply requires you to exchange your API key for a token which is valid for one hour. Once you obtain the token, you can call any of the available API services by simply including the token in the Authorization header of each request.</p>\n<hr />\n<h1 id=\"scope\">Scope</h1>\n<p><strong>Requests from your server</strong> to Basiq should include a token with <code>scope=SERVER_ACCESS</code>, which grants full access to the Basiq API.</p>\n<p><strong>Requests from your client</strong> should have a <code>CLIENT_ACCESS</code> token.  This token has restricted access and only allows the creation or update of a connection.  If an attacker intercepts a request and steals your <code>CLIENT_ACCESS</code> token, the risk is mitigated as they will not be able to get your users' data.</p>\n<p>A <code>CLIENT_ACCESS</code> token only grants access to the following requests:</p>\n<ul>\n<li>Get Institutions</li>\n<li>Get Institution Details</li>\n<li>Create Connection</li>\n<li>Update Connection</li>\n<li>Check Job Status</li>\n</ul>\n<hr />\n<h1 id=\"best-practice\">Best practice</h1>\n<p>The token lasts for one hour.  You should cache this token for global use: <strong>do not</strong> re-authenticate separately for each user or connection, etc., as this will cause trouble as your app scales.</p>\n","_postman_id":"b14b9bd6-f38f-4967-befa-40b9947862bc"},{"name":"Institutions","item":[{"name":"Get Institutions","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('institution-id');","","var data = pm.response.json();","","pm.test(\"Institutions successfuly acquired (\" + data.data.length + \")\", function () {","    pm.response.to.have.status(200);","});","","postman.setEnvironmentVariable('institution-id', data.data[0].id);","postman.setNextRequest('Get Institution Details');",""],"type":"text/javascript","id":"b2ccdb78-8a22-4162-828b-6647489f524f"}}],"id":"204c7327-5b0e-4a24-9372-565dbf502ed0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/institutions","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#institutions\">https://api.basiq.io/reference#institutions</a></p>\n<p>Returns a list of all available institutions.</p>\n<hr />\n<h1 id=\"best-practice\">Best practice</h1>\n<p>If you are building your own bank picker for web connections:</p>\n<ul>\n<li><strong>filter out</strong> institutions with <code>\"authorization\": \"other\"</code> as these will not work for web connections</li>\n<li><strong>filter out</strong> institutions with <code>\"stage\": \"alpha\"</code> as these are still in development</li>\n<li><strong>filter out</strong> institutions with <code>\"status\": \"major-outage\"</code> as these connections are likely to fail due to a temporary issue on the bank's side (e.g., a maintenance outage or performance issue)</li>\n<li><strong>filter out</strong> institutions which do not offer the data points essential to you (e.g., NAB does not return <code>features.accounts.accountHolder</code> for <code>web</code> connections)</li>\n</ul>\n","urlObject":{"protocol":"https","path":["institutions"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"204c7327-5b0e-4a24-9372-565dbf502ed0"},{"name":"Get Institution Details","event":[{"listen":"test","script":{"exec":["var data =  pm.response.json();","","pm.test(data.shortName + \" (\" + data.id + \") current status is \" + data.status, function () {","    pm.response.to.have.status(200);","    pm.expect(data.id).to.equal(postman.getEnvironmentVariable('institution-id'));","});","","postman.setNextRequest('Create User');",""],"type":"text/javascript","id":"c123c91d-da13-4b44-a24f-8c6c048b102f"}}],"id":"aded9e6f-7dd8-4227-888b-08594ced9fc7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/institutions/{{institution-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#retrieve-an-institution\">https://api.basiq.io/reference#retrieve-an-institution</a></p>\n<p>This request returns the details for a single institution.</p>\n","urlObject":{"protocol":"https","path":["institutions","{{institution-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"aded9e6f-7dd8-4227-888b-08594ced9fc7"}],"id":"45f93747-e9a8-4758-bacc-987dddfd2ef4","description":"<p>Under the hood, Basiq connects to the internet banking portals of more than 70 different institutions - with more released every month.  Each bank’s website is designed and behaves differently and we see large variations in performance and reliability.  </p>\n<p>For transparency and to allow you to manage the user experience, we expose all details relating to the <strong>maturity</strong>, <strong>availability</strong>, <strong>performance</strong>, and <strong>data points</strong> returned by each bank's website in the <code>/institutions</code> endpoint.</p>\n<p>Basiq's own UI solutions are built on this endpoint, so it has everything you need to build your own bank picker if you prefer.</p>\n","_postman_id":"45f93747-e9a8-4758-bacc-987dddfd2ef4"},{"name":"Users","item":[{"name":"Create User","event":[{"listen":"prerequest","script":{"id":"a7fb089c-e97e-466a-9608-6ddb805af543","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"0a7d198f-42f1-4b94-90f7-677156f9ed94","exec":["postman.clearEnvironmentVariable('user-id');","","var data =  pm.response.json();","","pm.test(\"Created new user \" + data.email + \", id \" + data.id, function () {","    pm.response.to.have.status(201);","    pm.response.to.have.jsonBody('id'); ","});","","postman.setEnvironmentVariable('user-id', data.id);","postman.setNextRequest('Authenticate (client)');",""],"type":"text/javascript"}}],"id":"01cd601b-9455-40cd-93de-0e3d6566ffc7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"email\": \"max@hooli.com\",\n  \"mobile\": \"+61434644440\"\n}"},"url":"https://au-api.basiq.io/users","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#create-a-user\">https://api.basiq.io/reference#create-a-user</a></p>\n<p>You need to provide either an <code>email</code> or a <code>mobile</code> argument in the body.  </p>\n<p>There is no uniqueness check: you need to manage this on your side.</p>\n","urlObject":{"protocol":"https","path":["users"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"01cd601b-9455-40cd-93de-0e3d6566ffc7"},{"name":"Get User Details","event":[{"listen":"test","script":{"exec":["var data =  pm.response.json();","","pm.test(\"Returned user \" + data.email, function () {","    pm.response.to.have.status(200);","    pm.expect(data.id).to.equal(postman.getEnvironmentVariable('user-id'));","});",""],"type":"text/javascript","id":"acec9379-ca8b-4b53-9790-ac52d554a43d"}}],"id":"cf3bb173-0fa6-46cd-bb06-7d1e881de588","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#retrieve-a-user\">https://api.basiq.io/reference#retrieve-a-user</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"cf3bb173-0fa6-46cd-bb06-7d1e881de588"}],"id":"d9c85e56-2cbc-42ef-aa75-927b500e485c","description":"<p>The user object in Basiq is just a bucket in which we aggregate financial data across various banks, relating to a single person.</p>\n","_postman_id":"d9c85e56-2cbc-42ef-aa75-927b500e485c"},{"name":"Connections","item":[{"name":"Create Connection","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('job-id');","","var data =  pm.response.json();","","pm.test(\"Created new connection to Pied Piper Bank, poll job \" + data.id + \" for progress fetching data\", function () {","    pm.response.to.have.status(202);","    pm.response.to.have.jsonBody('id'); ","});","","postman.setEnvironmentVariable('job-id', data.id);","postman.setNextRequest('Check Job Status');",""],"type":"text/javascript","id":"43f603c2-761e-4349-b350-32f8bd3f416b"}}],"id":"f1eb8cc6-11f3-43bb-bbfb-af9f526b350b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{client-access-token}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"loginId\": \"Gilfoyle\",\n  \"password\": \"PiedPiper\",   \n  \"institution\":{\n    \"id\":\"AU00002\"\n  }\n}"},"url":"https://au-api.basiq.io/users/{{user-id}}/connections","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#create-a-connection\">https://api.basiq.io/reference#create-a-connection</a></p>\n<hr />\n<h1 id=\"if-youre-using-the-basiq-simple-ui\">If you're using the Basiq simple UI</h1>\n<p>If you are using the Basiq simple UI Control, the tool will make this request on your behalf.  </p>\n<hr />\n<h1 id=\"if-youre-building-your-own-bank-picker\">If you're building your own bank picker</h1>\n<p>If you are building your own UI, we recommend that you post the credentials directly from your client to Basiq, to avoid the hassle of managing user credentials.  </p>\n<p>As you are making the connection request directly, you will get an asynchronous job resource in the response: you should poll this job to check the progress of syncing the user's data.  More details under the <strong>Check Job Status</strong> request, next.</p>\n<p>Be aware that some banks require additional login parameters.  Look for attributes in the <code>/institutions</code> endpoint with \"Caption\" in the label.  Pass additional login parameters as optional arguments in the Create Connection request - details in the API reference.</p>\n<hr />\n<h1 id=\"best-practice\">Best practice</h1>\n<p>You should use a <code>CLIENT_ACCESS</code> scope token for this request, regardless of whether you're using the Basiq simple UI or building your own bank picker.  The <code>CLIENT_ACCESS</code> scope token does not grant access to your users' data.</p>\n<hr />\n<h1 id=\"test-credentials\">Test credentials</h1>\n<p>More demo users can be found here: <a href=\"https://api.basiq.io/v2.1/reference#connect-api\">https://api.basiq.io/v2.1/reference#connect-api</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","connections"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"f1eb8cc6-11f3-43bb-bbfb-af9f526b350b"},{"name":"Get Connections","event":[{"listen":"test","script":{"exec":["var data =  pm.response.json();","","pm.test(\"Connections successfuly acquired (\" + data.data.length + \")\", function () {","    pm.response.to.have.status(200);","    pm.expect(jsonData.data.length).to.be.above(0);","});",""],"type":"text/javascript","id":"68173563-dd4f-4367-b74c-919f37b3626d"}}],"id":"d4436aeb-7977-479f-b06f-cd0c6ef42c0c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}/connections/","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#connections\">https://api.basiq.io/reference#connections</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","connections",""],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"d4436aeb-7977-479f-b06f-cd0c6ef42c0c"},{"name":"Get Connection Details","event":[{"listen":"test","script":{"exec":["var data =  pm.response.json();","","pm.test(\"Connection details successfuly acquired (\" + data.profile.fullName + \" - \" + data.institution.id + \")\", function () {","    pm.response.to.have.status(200);","    pm.expect(data.id).to.equal(postman.getEnvironmentVariable('connection-id'));","});",""],"type":"text/javascript","id":"1443e367-7152-4e46-93ba-00b8cd5644da"}}],"id":"ff21d697-34bc-476e-b524-e35d8812ef21","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}/connections/{{connection-id}}","description":"<p><a href=\"https://api.basiq.io/reference#retrieve-a-connection\">https://api.basiq.io/reference#retrieve-a-connection</a></p>\n<p>In addition to attributes reported in the Get Connections request, this also returns <strong>login profile</strong> information for the user who has shared their credentials.</p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","connections","{{connection-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"ff21d697-34bc-476e-b524-e35d8812ef21"},{"name":"Update Connection","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('job-id');","","var data =  pm.response.json();","","pm.test(\"Updated connection\", function () {","    pm.response.to.have.status(202);","    pm.response.to.have.jsonBody('id'); ","});","","postman.setEnvironmentVariable('job-id', data.id);",""],"type":"text/javascript","id":"ce5d2107-93e4-4a1a-9fe5-7d1cd5be40d0"}}],"id":"74a91fd3-4a04-410b-b816-f578c86eb2af","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{client-access-token}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"password\": \"PiedPiper\"\n}"},"url":"https://au-api.basiq.io/users/{{user-id}}/connections/{{connection-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#update-a-connection\">https://api.basiq.io/reference#update-a-connection</a></p>\n<p>Use this request to update the login credentials on an existing connection.</p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","connections","{{connection-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"74a91fd3-4a04-410b-b816-f578c86eb2af"},{"name":"Refresh Connection","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('job-id');","","var data =  pm.response.json();","","pm.test(\"Refreshed connection\", function () {","    pm.response.to.have.status(202);","    pm.response.to.have.jsonBody('id'); ","});","","postman.setEnvironmentVariable('job-id', data.id);",""],"type":"text/javascript","id":"d7707f9d-f0d2-47d0-b567-f9873d8ede17"}}],"id":"d4f2ffd2-857c-4273-92ba-afaf960d6535","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://au-api.basiq.io/users/{{user-id}}/connections/{{connection-id}}/refresh","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#refresh-a-connection\">https://api.basiq.io/reference#refresh-a-connection</a></p>\n<p>Use this request to refresh the data for this connection.  </p>\n<p><strong>Note that if you need ongoing refreshed data you should not use this request as a default</strong>: instead, ask the Basiq team to enable you for background daily refreshes.</p>\n<hr />\n<h1 id=\"use-the-smart-cache-instead\">Use the smart cache instead</h1>\n<p><strong>For ongoing daily refreshed data</strong>, ask the Basiq team to enable your application for background refreshes (the \"smart cache\" feature).  This is a much more efficient way to refresh data than initiating a Refresh Connection request yourself each day.</p>\n<hr />\n<h1 id=\"best-practice\">Best practice</h1>\n<p><strong>Keep these ad hoc refreshes to a minimum</strong>: these requests put extra load on the banks' websites and if used excessively are liable to trigger action from the bank: your user may be locked out of their account.</p>\n<p><strong>Avoid bulk refreshes, e.g., cron jobs</strong>: if you refresh thousands of connections at the same time, this will put load on the banks' websites which may cause problems.  Let the smart cache handle this for you, and use the Refresh Connection request only after confirming that Basiq has not recently refreshed.</p>\n<p><strong>Before refreshing, check when the connection was last refreshed</strong>: check the user's jobs for a complete view of when the connection was last refreshed and the result, or for a more lightweight option check the <code>connection.lastUsed</code> attribute to see when the connection was last refreshed.</p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","connections","{{connection-id}}","refresh"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"d4f2ffd2-857c-4273-92ba-afaf960d6535"},{"name":"Create Statement","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('job-id');","","var data =  pm.response.json();","","pm.test(\"Imported statement\", function () {","    pm.response.to.have.status(202);","     pm.response.to.have.jsonBody('id'); ","});","","postman.setEnvironmentVariable('job-id', data.id);",""],"type":"text/javascript","id":"b88ce671-d935-4bd9-86a2-c224ca077966"}}],"id":"e2a1d655-092f-4c69-9ff0-91d957e98c5f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"statement","description":"<p>select file</p>\n","type":"file","value":null},{"key":"institutionId","value":"AUxxxxx","description":"<p>replace with Basiq institution ID</p>\n","type":"text"}]},"url":"https://au-api.basiq.io/users/{{user-id}}/statements","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#statements\">https://api.basiq.io/reference#statements</a></p>\n<p>Use this request to upload an official PDF bank statement, instead of or complimentary to a web connection.</p>\n<p>Check the features attribute of a bank in the <code>/institutions</code> endpoint to check whether PDFs are supported - and please contact Basiq support if you are considering this option.  (See the <strong>Get Institutions</strong> request above for details.)</p>\n<p><strong>Note that we do not typically recommend using PDF uploads</strong>: it's more hassle for your user, and the data fetched is far more limited than that fetched via web connections.</p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","statements"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"e2a1d655-092f-4c69-9ff0-91d957e98c5f"},{"name":"Create Auth Link","event":[{"listen":"test","script":{"exec":["var data =  pm.response.json();","","pm.test(\"Created auth_link (\" + data.links.public + \")\", function () {","    pm.response.to.have.status(201);","    pm.response.to.have.jsonBody('links'); ","});",""],"type":"text/javascript","id":"5b266dd4-383f-4834-bb94-eb9a4b111a54"}}],"id":"aa3b5189-df54-45e0-845b-162122cb2556","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"mobile\": \"+614xxxxxxxx\"\n}"},"url":"https://au-api.basiq.io/users/{{user-id}}/auth_link","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#auth-links\">https://api.basiq.io/reference#auth-links</a></p>\n<p>Use this request to create a secured authorised link, which can be sent to a user to allow for the self-service capture of financial data.  The link is valid for 3 days or until the user has used it to link all accounts - whichever comes first.</p>\n<p>After you create the auth_link, you can poll it with the <strong>GET Auth Link</strong> request below: once the GET request returns an HTTP 410 / GONE status, the user has either used the link, or it has expired after 3 days.</p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","auth_link"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"aa3b5189-df54-45e0-845b-162122cb2556"},{"name":"Get Auth Link","event":[{"listen":"test","script":{"exec":[""],"type":"text/javascript","id":"2ab7bb7a-fd00-46a1-9f87-30a77a89a202"}}],"id":"97fbde79-ddbc-46e4-bd45-8c1bbd0e2332","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}/auth_link","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#retrieve-an-auth_link\">https://api.basiq.io/reference#retrieve-an-auth_link</a></p>\n<p>Use this request to poll the auth_link: if an auth_link is returned, the user has not yet disclosed all banks.  If an HTTP 410 / GONE status is returned, the user has either linked all of their accounts, or (after 3 days) the link has expired.</p>\n<p>On receiving the HTTP 410 status (i.e., the link has gone), we recommend you make a <strong>GET User Jobs</strong> request:</p>\n<ul>\n<li><em>If no jobs are returned</em> - the link has expired and you will need to create a new one to send to the user</li>\n<li><em>If a job is returned</em> - the user has linked of their banks and you can follow the progress of the data retrieval</li>\n</ul>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","auth_link"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"97fbde79-ddbc-46e4-bd45-8c1bbd0e2332"},{"name":"MFA Response","event":[{"listen":"test","script":{"exec":["var data =  pm.response.json();","","pm.test(\"MFA response posted\", function () {","    pm.response.to.have.status(202);","});","","postman.setNextRequest('Check Job Status');",""],"type":"text/javascript","id":"aba902a1-2371-47fd-a2f8-df2d3a972591"}}],"id":"9baf51e6-2bc0-465d-810c-fedcb26a24db","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{client-access-token}}","description":"<p>Requires a CLIENT_SCOPE access token</p>\n"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"mfa-response\": [\"Hooli\"]\n}","options":{"raw":{"language":"json"}}},"url":"https://au-api.basiq.io/jobs/{{job-id}}/mfa","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/v2.1/reference#create-mfa-challenge-response\">https://api.basiq.io/v2.1/reference#create-mfa-challenge-response</a></p>\n","urlObject":{"protocol":"https","path":["jobs","{{job-id}}","mfa"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"9baf51e6-2bc0-465d-810c-fedcb26a24db"}],"id":"1a377bf4-3e66-43ad-b973-7fbb6ae1e45a","description":"<p>A connection is the means by which Basiq aggregates your user's financial data: typically this is via web connections to the banks' internet banking portals.</p>\n<p>The connection object holds your user's encrypted credentials.  The point-in-time retrieval of accounts and transactions from the bank is executed via a job resource.</p>\n","_postman_id":"1a377bf4-3e66-43ad-b973-7fbb6ae1e45a"},{"name":"Jobs","item":[{"name":"Check Job Status","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('connection-id');","","var data =  pm.response.json();","","for(var i=0; i<=data.steps.length -1; i++) {","    if(data.steps[i].status == 'success' || data.steps[i].status == 'failed') {","        pm.test(data.steps[i].title + ' ' + data.steps[i].status, function() {","            pm.expect(data.steps[i].status).to.equal('success');","        });","    } else {","        pm.test.skip(data.steps[i].title + ' ' + data.steps[i].status);","    }","}","","if(data.steps[0].status == 'success') {","    postman.setEnvironmentVariable('connection-id', data.steps[0].result.url.substring(data.steps[0].result.url.lastIndexOf('/')+1));","}","","/* routing based on progress through job steps","[0] verify-credentials","[1] mfa-challenge","[2] retrieve-accounts","[3] retrieve-transactions","*/","if (data.steps[1].status == 'in-progress') {","    postman.clearEnvironmentVariable('nextRequest');","    postman.setNextRequest('MFA Response');","} else if (data.steps[2].status == 'success' && postman.getEnvironmentVariable('accounts-checked') === false) {","    postman.setEnvironmentVariable('accounts-checked', true)","    postman.clearEnvironmentVariable('nextRequest');","    postman.setNextRequest('Get Accounts'); ","} else if (data.steps[3].status == 'success') {","    postman.clearEnvironmentVariable('nextRequest');","    postman.setNextRequest('Get Transactions');","} else {","    postman.clearEnvironmentVariable('nextRequest');","    postman.setNextRequest('Delay 5 seconds');","}",""],"type":"text/javascript","id":"f18128cb-abfd-4c73-b967-a436676fc527"}}],"id":"02226033-626f-4174-bc46-31639c8d8e6a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{client-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/jobs/{{job-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#jobs\">https://api.basiq.io/reference#jobs</a></p>\n<p>When Basiq fetches a user's data from their bank, the data retrieval is executed through an asynchronous job.  An MFA job goes through three steps:</p>\n<ul>\n<li>verify-credentials</li>\n<li>mfa-challenge</li>\n<li>retrieve-accounts</li>\n<li>retrieve-transactions</li>\n</ul>\n<p>As soon as a step is complete you can make relevant requests without having to wait for further steps.  For example, you can get the user's accounts from Basiq as soon as the retrieve-accounts step is complete: you don't have to wait for the transactions step.</p>\n<p>In practice, live banks sometimes do not return accounts or transactions, and in these cases Basiq will fail the job at the relevant step with an actionable error code, to help you and your user clear the issue.</p>\n<p>For example, if the bank's website is down for a maintenance outage, or if the bank requires the user to accept new terms and conditions before they return transactions, or if the credentials are invalid - you will get a clear error in the job.</p>\n<hr />\n<h1 id=\"errors-and-recommended-action\">Errors and recommended action</h1>\n<p>If you're not sure what an error means, or what to do about it, you can check the advice here: <a href=\"https://api.basiq.io/v2.1/reference#handling-failed-jobs\">https://api.basiq.io/v2.1/reference#handling-failed-jobs</a></p>\n<hr />\n<h1 id=\"best-practice\">Best practice</h1>\n<p>If you are building your own UI, you should keep your user engaged until the first (<code>verify-credentials</code>) step is complete: it's not a good experience to let the user go and then have to drag them back if the credentials didn't work.</p>\n<p>As soon as the credentials step is complete you should release the user to continue with your onboarding journey while Basiq fetches their accounts and transactions: there is no sense in keeping them hanging around watching a spinning wheel.</p>\n<p>To help manage the user journey, check the <code>institution.stats</code> in the <code>/institutions</code> endpoint for an indication of how long each bank typically takes to complete each job step. </p>\n<p>For the best user experience, have the user connect their banks as early in the onboarding journey as possible.  This gives Basiq the best chance of having their transactions ready in time for them finishing the onboarding.</p>\n","urlObject":{"protocol":"https","path":["jobs","{{job-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"02226033-626f-4174-bc46-31639c8d8e6a"},{"name":"Get User Jobs (last 7 days)","event":[{"listen":"test","script":{"exec":["var data = pm.response.json();","","pm.test(\"User jobs in last 7 days successfully acquired (\" + data.data.length + \")\", function () {","    pm.response.to.have.status(200);","    pm.expect(data.data.length).to.be.above(0);","});",""],"type":"text/javascript","id":"6bd433b8-69c1-4d00-b8e6-bcddb03f2ecb"}}],"id":"99f84180-6420-4b9a-abe4-734be271223f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}/jobs","description":"<p><a href=\"https://api.basiq.io/reference#retrieve-jobs\">https://api.basiq.io/reference#retrieve-jobs</a></p>\n<p>Returns a list of all jobs executed for this user across all connections, for the last 7 days.</p>\n<p>This is an indispensable query for managing user experience, ongoing connections and troubleshooting.</p>\n<hr />\n<h1 id=\"best-practice\">Best practice</h1>\n<p>Check the user's jobs regularly, e.g., once a day and every time they login, and handle any unresolved errors.</p>\n<p>For example, the user may have initially connected their banks without issues, but Basiq has since had trouble refreshing their data.  The user may have changed their login credentials, or the bank may be presenting a popup requiring the user to acknowledge new T&amp;Cs, etc.</p>\n<p>See the <strong>Check Job Status</strong> request above for tips on troubleshooting and resolving errors.</p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","jobs"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"99f84180-6420-4b9a-abe4-734be271223f"}],"id":"7eaa0d84-dfad-4e4d-9916-0e0c36a9cff1","description":"<p>The point-in-time retrieval of accounts and transactions from the user's bank is executed through the job resource.</p>\n<p>The job uses the credentials encrypted in the connection and uses them to login to the bank and read transactions and accounts.</p>\n<p>If Basiq is unable to retrieve all data from the bank, the job will fail with an actionable error code on the relevant job step.</p>\n","_postman_id":"7eaa0d84-dfad-4e4d-9916-0e0c36a9cff1"},{"name":"Accounts","item":[{"name":"Get Accounts","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('account-id');","","var data = pm.response.json();","","pm.test(\"Fetched \" + data.data.length + \" accounts\", function () {","    pm.response.to.have.status(200);","    pm.expect(data.data.length).to.be.above(0);","});","","postman.setEnvironmentVariable('account-id', data.data[0].id);","postman.setNextRequest('Get Account Details');",""],"type":"text/javascript","id":"f3dd5954-8fae-483a-8d37-b10b82117ad8"}}],"id":"e7ebceae-5d40-478c-b93d-3d5919051196","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}/accounts","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#accounts\">https://api.basiq.io/reference#accounts</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","accounts"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"e7ebceae-5d40-478c-b93d-3d5919051196"},{"name":"Get Account Details","event":[{"listen":"test","script":{"exec":["var data = pm.response.json();","","pm.test(\"Returned account: \" + data.class.product + \" with balance $\" + data.balance, function () {","    pm.response.to.have.status(200);","    pm.expect(data.id).to.equal(postman.getEnvironmentVariable('account-id'));","});","","postman.setNextRequest('Check Job Status');",""],"type":"text/javascript","id":"7f61716b-d475-4d00-b61f-682c076d8214"}}],"id":"8b8bc0a3-97bb-45f4-ab0d-a0b94d05d636","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}/accounts/{{account-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#retrieve-an-account\">https://api.basiq.io/reference#retrieve-an-account</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","accounts","{{account-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"8b8bc0a3-97bb-45f4-ab0d-a0b94d05d636"}],"id":"516ee531-34fc-4c8d-a030-332b29df2fa2","description":"<p>As soon as the <code>retrieve-accounts</code> step has completed successfully, you can get the user’s accounts right away without having to wait for the transactions step.</p>\n","_postman_id":"516ee531-34fc-4c8d-a030-332b29df2fa2"},{"name":"Transactions","item":[{"name":"Get Transactions","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('transaction-id');","","var data = pm.response.json();","","pm.test(\"Fetched \" + data.size + \" transactions\", function () {","    pm.response.to.have.status(200);","    pm.expect(data.data.length).to.be.above(0);","});","","postman.setEnvironmentVariable('transaction-id', data.data[0].id);","postman.setNextRequest('Get Transaction Details');",""],"type":"text/javascript","id":"77da3ba7-1dad-4e18-bc55-19f0da3ee342"}}],"id":"f2d3514f-8757-4207-b771-4347846b54e9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}/transactions","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#transactions\">https://api.basiq.io/reference#transactions</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","transactions"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"f2d3514f-8757-4207-b771-4347846b54e9"},{"name":"Get Transaction Details","event":[{"listen":"test","script":{"exec":["var data = pm.response.json();","","pm.test(\"Returned transaction: '\" + data.description + \"' / amount: $\" + data.amount + \" / made on \" + data.postDate, function () {","    pm.response.to.have.status(200);","    pm.expect(data.id).to.equal(postman.getEnvironmentVariable('transaction-id'));","});","","postman.setNextRequest('Create Affordability');",""],"type":"text/javascript","id":"c9c808ac-34d1-4daa-8fd8-aeff5edeb4c0"}}],"id":"12a31926-3f01-45f2-8009-c8adc1b12306","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}/transactions/{{transaction-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#retrieve-a-transaction\">https://api.basiq.io/reference#retrieve-a-transaction</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","transactions","{{transaction-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"12a31926-3f01-45f2-8009-c8adc1b12306"}],"id":"c6667860-dbfd-4b1d-b803-1e9a19322c1d","description":"<p>Once the <code>retrieve-transactions</code> step of the job has completed successfully, you can fetch the user’s transactions.</p>\n","_postman_id":"c6667860-dbfd-4b1d-b803-1e9a19322c1d"},{"name":"Affordability","item":[{"name":"Create Affordability","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('affordability-id');","postman.clearEnvironmentVariable('income-id');","postman.clearEnvironmentVariable('expenses-id');","","var data = pm.response.json();","","pm.test(\"Calculated assets: $\" + data.summary.assets + \" / liabilities: $\" + data.summary.liabilities + \" / net position: $\" + data.summary.netPosition + \" / credit limit: $\" + data.summary.creditLimit + \" / expenses: $\" + data.summary.expenses + \" / savings: $\" + data.summary.savings + \" / regular income: $\" + data.summary.regularIncome.previous3Months.avgMonthly, function () {","    pm.response.to.have.status(200);","    pm.response.to.have.jsonBody('summary'); ","});","","postman.setEnvironmentVariable('affordability-id', data.id);","postman.setEnvironmentVariable('income-id', data.links.income.substring(data.links.income.lastIndexOf('/')+1));","postman.setEnvironmentVariable('expenses-id', data.links.expenses.substring(data.links.expenses.lastIndexOf('/')+1));","","postman.setNextRequest('Get Affordability');",""],"type":"text/javascript","id":"a59b194e-9986-4214-8a60-e5bbf64ab038"}}],"id":"84d22269-b7da-4238-b5ff-c45aabf964ad","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json","description":"<p>or application/pdf for example visualisation</p>\n"}],"body":{"mode":"raw","raw":""},"url":"https://au-api.basiq.io/users/{{user-id}}/affordability","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#affordability\">https://api.basiq.io/reference#affordability</a></p>\n<p>Transactions are a required input for an Affordability analysis.  You should check the user's jobs to confirm the <code>retrieve-transactions</code> step has completed successfully before you create an Affordability resource.</p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","affordability"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"84d22269-b7da-4238-b5ff-c45aabf964ad"},{"name":"Get Affordability","event":[{"listen":"test","script":{"exec":["pm.test(\"Retrieved Affordability PDF\", function () {","    pm.response.to.have.status(200);","});","","postman.setNextRequest('Get Affordability Transactions');",""],"type":"text/javascript","id":"654ab686-7c05-42ef-aa68-9339d2a63a40"}}],"id":"e4fbe519-86f3-427e-8ad1-0badc433b5d5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/pdf","description":"<p>or application/json for raw data</p>\n"}],"url":"https://au-api.basiq.io/users/{{user-id}}/affordability/{{affordability-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#retrieve-an-affordability-summary\">https://api.basiq.io/reference#retrieve-an-affordability-summary</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","affordability","{{affordability-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"e4fbe519-86f3-427e-8ad1-0badc433b5d5"},{"name":"Get Affordability Transactions","event":[{"listen":"test","script":{"exec":["var data = pm.response.json();","","// find a payment to use in test case","var paymentIndex = 0;","for (var i=0; i<data.data.length; i++) {","    if (data.data[i].class == 'payment') {","        paymentIndex = i;","        break;","    }","}","","pm.test(\"Transaction report acquired, e.g., \" ","    + data.data[paymentIndex].class + \" '\" ","    + data.data[paymentIndex].description + \"' ($\" ","    + data.data[paymentIndex].amount + \") classed '\"  ","    + data.data[paymentIndex].subClass.title + \"'\", ","    function () {","        pm.response.to.have.status(200); ","    }",");","","postman.setNextRequest('Get Income');",""],"type":"text/javascript","id":"5263cfed-de1a-4092-b371-faba043fe707"}}],"id":"d7b8e436-c763-4787-9eb4-20aeea310186","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json","description":"<p>or text/csv</p>\n","type":"text"}],"url":"https://au-api.basiq.io/users/{{user-id}}/affordability/{{affordability-id}}/transactions","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#list-all-affordability-transactions\">https://api.basiq.io/reference#list-all-affordability-transactions</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","affordability","{{affordability-id}}","transactions"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"d7b8e436-c763-4787-9eb4-20aeea310186"},{"name":"Create Income","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('income-id');","","var data = pm.response.json();","","pm.test(\"Detected regular income: $\" + data.summary.regularIncomeYTD + \" year to date\", function () {","    pm.response.to.have.status(200);","    pm.response.to.have.jsonBody('summary'); ","});","","postman.setEnvironmentVariable('income-id', data.id);",""],"type":"text/javascript","id":"7e2674ae-942c-408b-93ed-e9fa85b9dfdb"}}],"id":"4a249a27-5e67-40cd-9968-09d8d6c82573","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://au-api.basiq.io/users/{{user-id}}/income","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#income\">https://api.basiq.io/reference#income</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","income"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"4a249a27-5e67-40cd-9968-09d8d6c82573"},{"name":"Get Income","event":[{"listen":"test","script":{"exec":["var data = pm.response.json();","","pm.test(\"Detected regular income: $\" + data.summary.regularIncomeYTD + \" year to date\", function () {","    pm.response.to.have.status(200);","    pm.response.to.have.jsonBody('summary'); ","});","","postman.setNextRequest('Get Expenses');",""],"type":"text/javascript","id":"30a4d7ba-1b05-4c72-9ff7-aa98cc3aa282"}}],"id":"ec000742-d79c-45ac-9962-11debcb7d345","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"url":"https://au-api.basiq.io/users/{{user-id}}/income/{{income-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#retrieve-an-income-summary\">https://api.basiq.io/reference#retrieve-an-income-summary</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","income","{{income-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"ec000742-d79c-45ac-9962-11debcb7d345"},{"name":"Create Expenses","event":[{"listen":"test","script":{"exec":["postman.clearEnvironmentVariable('expenses-id');","","var data = pm.response.json();","","pm.test(\"Identified average monthly spend on '\" + data.payments[0].division + \"' expenses: $\" + data.payments[0].avgMonthly, function () {","    pm.response.to.have.status(200);","    pm.response.to.have.jsonBody('type'); ","});","","postman.setEnvironmentVariable('expenses-id', data.id);",""],"type":"text/javascript","id":"00a79963-4996-41fb-aec8-5a01a0ec9d8f"}}],"id":"8aca347b-a5ff-40ef-aa61-ba17381a4dcc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json","description":"<p>or text/csv</p>\n"}],"body":{"mode":"raw","raw":""},"url":"https://au-api.basiq.io/users/{{user-id}}/expenses","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#expenses\">https://api.basiq.io/reference#expenses</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","expenses"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"8aca347b-a5ff-40ef-aa61-ba17381a4dcc"},{"name":"Get Expenses","event":[{"listen":"test","script":{"exec":["var data = pm.response.json();","","pm.test(\"Identified average monthly spend on '\" + data.payments[0].division + \"' expenses: $\" + data.payments[0].avgMonthly, function () {","    pm.response.to.have.status(200);","    pm.response.to.have.jsonBody('type'); ","});","","postman.setNextRequest('Delete Connection');",""],"type":"text/javascript","id":"718636c4-eb86-4e91-ab4b-e6d25eb35641"}}],"id":"24c8c71c-f726-4b10-af20-d0300f71b63b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json","description":"<p>or text/csv</p>\n"}],"url":"https://au-api.basiq.io/users/{{user-id}}/expenses/{{expenses-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#retrieve-an-expense-summary\">https://api.basiq.io/reference#retrieve-an-expense-summary</a></p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","expenses","{{expenses-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"24c8c71c-f726-4b10-af20-d0300f71b63b"}],"id":"f9e5d0fc-a299-4546-aa2c-f7d1d2e0ad40","description":"<p>Once you have aggregated your user's financial data using the Connect API, you can use Basiq Affordability to get a complete picture of their financial position across all declared accounts: their assets, liabilities, income, expenses and identity.</p>\n","_postman_id":"f9e5d0fc-a299-4546-aa2c-f7d1d2e0ad40"},{"name":"Other","item":[{"name":"Delay 5 seconds","event":[{"listen":"test","script":{"exec":["var max = parseInt(postman.getEnvironmentVariable('poll-count'));","var cnt = parseInt(postman.getEnvironmentVariable('poll-idx')) || 1;","","if(cnt < max) {","    postman.setEnvironmentVariable(\"poll-idx\", cnt + 1);","    postman.setNextRequest('Delay');","} else {","    postman.setNextRequest('Check Job Status');","}"],"type":"text/javascript","id":"1f25fd79-4c3e-4aee-9bba-c8c3dc004f11"}}],"id":"de181af2-4491-42d2-a00c-4e066db6942b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://postman-echo.com/delay/5","description":"<p>Using this endpoint one can configure how long it takes for the server to come back with a response. Appending a number to the URL defines the time (in seconds) the server will wait before responding.</p>\n<p>Note that a maximum delay of 10 seconds is accepted by the server.</p>\n","urlObject":{"protocol":"https","path":["delay","5"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"de181af2-4491-42d2-a00c-4e066db6942b"}],"id":"42e48118-6ac1-403d-aff1-0a854b6ca628","description":"<p>Not required to use the Basiq API - but delays are needed to run the collection to demonstrate polling the job to monitor progress.</p>\n","_postman_id":"42e48118-6ac1-403d-aff1-0a854b6ca628"},{"name":"Clean Up","item":[{"name":"Delete Connection","event":[{"listen":"prerequest","script":{"exec":[""],"type":"text/javascript","id":"d1c1fbe3-8541-45f4-a704-3704fe209067"}},{"listen":"test","script":{"exec":["pm.test(\"Deleted connection\", function () {","    pm.response.to.have.status(204);","});","","postman.clearEnvironmentVariable('connection-id');","postman.setNextRequest('Delete User');",""],"type":"text/javascript","id":"94f8ef1e-1d86-421f-a089-5cfe42ff0a4d"}}],"id":"5d216f37-e1f8-4356-a4fa-e20f9ceb2f6d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://au-api.basiq.io/users/{{user-id}}/connections/{{connection-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#delete-a-connection\">https://api.basiq.io/reference#delete-a-connection</a></p>\n<p>Deleting the connection deletes the credentials and we will no longer refresh the data - <em>but previously fetched accounts and transactions remain available from those endpoints</em>.</p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}","connections","{{connection-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"5d216f37-e1f8-4356-a4fa-e20f9ceb2f6d"},{"name":"Delete User","event":[{"listen":"prerequest","script":{"exec":[""],"type":"text/javascript","id":"bb0e0629-efa6-4925-adf4-f6575c01b7de"}},{"listen":"test","script":{"exec":["pm.test(\"Deleted user\", function () {","    pm.response.to.have.status(204);","});","","postman.clearEnvironmentVariable('user-id');",""],"type":"text/javascript","id":"85267e6b-4f35-4cbf-ad0b-0436d3488c6c"}}],"id":"8248eaf7-ca45-44fd-8ab2-2c50446bad48","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{server-access-token}}"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"https://au-api.basiq.io/users/{{user-id}}","description":"<p><strong>API reference</strong>: <a href=\"https://api.basiq.io/reference#delete-a-user\">https://api.basiq.io/reference#delete-a-user</a></p>\n<p>Deleting the user deletes all data relating to the user: all connections, accounts and transactions are removed.</p>\n","urlObject":{"protocol":"https","path":["users","{{user-id}}"],"host":["au-api","basiq","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"8248eaf7-ca45-44fd-8ab2-2c50446bad48"}],"id":"78afc908-a007-4b89-8a3b-9d564e52ef7f","_postman_id":"78afc908-a007-4b89-8a3b-9d564e52ef7f","description":""}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""],"id":"a701bf3c-c085-4520-961a-bcb15d410276"}},{"listen":"test","script":{"type":"text/javascript","exec":[""],"id":"af8d68f9-b754-490b-acf9-a18da41a8725"}}]}