{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"63b05ae4-6e2f-4c94-b680-9141ae141820","name":"Setu FIU APIs","description":"Follow these steps, as an FIU, to fetch financial information from FIPs using Setu AA\n\n## Legend\n\nFIU - Financial Information User\n\nFIP - Financial Information Provider\n\nAA - Account Aggregator\n\n\n\n# Quick start\n\n<hr/>\n\n## Contents\n\n- Setup Setu Bridge\n\n- Download Setu Postman collection\n\n- Make APIs call for consent flow\n\n- Make APIs call for FI data flow\n\n<br/>\n\n## Setup Setu Bridge\n\n<hr>\n\nCreate an account on [Setu Bridge](https://bridge.setu.co/).\n\nClick on Available Products on the left-side menu, select Data and create an FIU (Financial Information User) app\n\n- Step 1 : Enter the name of FIU\n\n- Step 2 : Add the data sources according to your need\n\n- Step 3 : Theme your app\n\n- Step 4(a) : Enter an endpoint URL to receive notifications from Setu.\n\n- Step 4(b) : Enter your Request signing public key. [How do I generate one?](https://docs.setu.co/data/account-aggregator/request-signing)\n\n- Step 5 : Get all credentials regarding FIU. Setu generates ```aa_api_key```, ```client_api_key``` for the API request authentication and also provides you with Setu's request signing public key for signature verification on your end.\n\n<br/>\n\n## Download Setu Postman Collection\n\n<hr>\n\nClick on ```Run in Postman``` button on the top-right to import the Setu FIU's API collection. \n\nSet the Postman collection environment to \"Setu Environment\"\n\n<br/>\n\n**Environment variables**\n\n> To edit environment variables, click on the eye icon to the top-right and click \"Edit\"\n\n- In Step 5 of the configuration, you'll find the ```client_api_key```. Copy, paste the value to \"Setu Environment\" in ```client_api_key``` as current value\n\n- Use the request signing private key in PEM format you saved while generating your request signing keys and copy, paste the value to \"Setu Environment\" in ```signing_private_key``` as current value.\n\n- Set ```phone_number``` in \"Setu Environment\" to the customer mobile number that will be used for testing.\n\nClick \"Save\" after all the changes.\n\n<br/>\n\n## Consent Flow\n\n<hr>\n\n#### 1. Create Consent request\n\nUse this endpoint to create consent -> [**/Consent**](https://documenter.getpostman.com/view/16080598/TzzBoun5#8b55cf5b-2c60-42bc-ae24-b6cb0ecbbb50)\n\n<br/>\n\n#### 2. Approve consent in Setu Anumati\n\nReplace the ```{ConsentHandle}``` placeholder in the below Setu Anumati URL with the ```ConsentHandle``` in response of Create Consent request and visit the webpage to approve consent\n\n```yourRedirectURL``` - This will be used to pass control back to your app from Setu's AA. Setu's AA will redirect your customer to this provided URL.\n\nhttps://anumati.setu.co/{ConsentHandle}?redirect_url={yourRedirectUrl}\n\n**Example** \n\nIf ```ConsentHandle``` in the response is ```XXX-YYY-XXX-ZZZ```, your Setu Anumati URL will be https://anumati.setu.co/XXX-YYY-XXX-ZZZ\n\n> Use 123456 as OTP in Setu Anumati wherever prompted\n\n<br/>\n\n#### 3. Check consent artefact status \n\nUse this endpoint to get the status of consent artefact -> [**/Consent/handle/{ConsentHandle}**](https://documenter.getpostman.com/view/16080598/TzzBoun5#9074a1f0-3f8f-4e49-9436-2390d26d1f4a)\n\nIf the consent is approved, the ```ConsentStatus``` in the response will be READY.\n\n> Once Consent is approved, Setu AA will notify you regarding the consent status by sending a request to the Endpoint you entered on the Bridge.\n\n<br/>\n\n#### 4. Fetch signed consent\n\nUse this endpoint to get the status of consent artefact -> [**/Consent/{ConsentId}**](https://documenter.getpostman.com/view/16080598/TzzBoun5#dc80cd44-772a-4c2b-a607-c73f265aad5b)\n\nIf the consent is approved, the ```status``` in the response will be ACTIVE\n\n<br/>\n\n## FI Data flow\n\n<hr/>\n\n#### 1. Request FI data\n\nUse this endpoint to request FI for the consent created above -> [**/FI/request**](https://documenter.getpostman.com/view/16080598/TzzBoun5#9c8538a5-f848-4d6c-9cd4-916f5336941c). Before making this request, you need to generate keys for e2e encryption of financial data.\n\n**Generate keys for e2e encryption**\n\n[How does the e2e encryption work?](https://docs.setu.co/data/account-aggregator/encryption)\n\n[What is Rahasya helper library?](https://docs.setu.co/data/account-aggregator/encryption#rahasya-helper-library)\n\nGenerate a public, private key pair using this [**endpoint**](https://documenter.getpostman.com/view/16080598/TzzBoun5#fc609f6e-4f1e-4065-9c92-be041b81ae0f) in Postman. Remember, these keys should be ephemeral in nature, meaning they should be generated every time when placing the Request FI data request.\n\n- Use the ```KeyMaterial``` in the response and replace it with existing ```KeyMaterial``` in the body of Request FI data.\n\n- Save ```privateKey``` and ```KeyMaterial``` from the response of Setu Rahasya endpoint safely to decrypt data.\n\nAfter generating keys and passing them in the body of Request data API call, Setu will pass on this request to relevant FIP(s), which will then prepare data as per your request.\n\n> Make sure that values of `FIDataRange` array in the body, is exact or less than the `FIDataRange` mentioned in the Create Consent Request.\n\nOnce data is ready to fetch, Setu AA will notify you by sending a request to the Endpoint you entered on the Bridge.\n\n<br/>\n\n#### 2. Fetch FI Data\n\nUse this endpoint to fetch encrypted FI data for the created consent above -> [**/FI/fetch/{sessionId}**](https://documenter.getpostman.com/view/16080598/TzzBoun5#6de800ab-e816-4046-ba37-e2bf30c450d8)\n\n> If you request for multiple FI types, you will receive all the FI data from end-user's linked accounts in an array. Decrypt each FI data using the ```KeyMaterial``` corresponding to each FIP given in the response. \n\n<br/>\n\n#### 3. Decrypt FI data\n\n[What is Rahasya helper library?](https://docs.setu.co/data/account-aggregator/encryption#rahasya-helper-library)\n\nFI data is sent in encrypted form in the response of Fetch FI Data request and can be decrypted using this [**endpoint**](https://documenter.getpostman.com/view/16080598/TzzBoun5#4a52e76f-7010-4b19-a948-3447a6f5f8e5)\n\nReplace the existing value of ```base64Data``` in the body with the ```encryptedFI``` from the response of Fetch FI data request.\n\nReplace ```base64RemoteNonce``` in the body with ```Nonce``` value from the ```KeyMaterial``` from the response of Fetch FI data request.\n\nReplace ```base64YourNonce``` in the body with ```Nonce``` value from the ```KeyMaterial``` you saved when generating keys.\n\nReplace ```ourPrivateKey``` in the body with ```privateKey``` value you saved when generating keys.\n\nReplace the existing value of ```remoteKeyMaterial``` in the body with ```KeyMaterial``` from the response of Fetch FI data request.\n\nOnce all the values in the body are replaced, make the request and you receive the decrypted data as ```base64Data``` which is a base64 string.\n\nDecode the base64 string to get the FI data requested. You can use this [link](https://www.base64decode.org/) to decode data.\n\n## Reset end-user\n\nReset details of the end-user associated with your FIU app. This will reset the end-user PIN and all the linked accounts associated with the mobile number in Setu AA","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"16080598","collectionId":"63b05ae4-6e2f-4c94-b680-9141ae141820","publishedId":"TzzBoun5","public":true,"publicUrl":"https://documenter-api.postman.tech/view/16080598/TzzBoun5","privateUrl":"https://go.postman.co/documentation/16080598-63b05ae4-6e2f-4c94-b680-9141ae141820","customColor":{"top-bar":"1f024b","right-sidebar":"303030","highlight":"42b0bd"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2021-09-24T08:37:41.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"Setu Environment","id":"433d3405-8ebc-4e07-83f7-27223c398e46","owner":"16080598","values":[{"key":"client_api_key","value":"YOUR_CLIENT_API_KEY","enabled":true},{"key":"signing_private_key","value":"YOUR_REQUEST_SIGNING_PRIVATE_KEY","enabled":true},{"key":"phone_number","value":"9999999999","enabled":true}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Setu Environment","value":"16080598-433d3405-8ebc-4e07-83f7-27223c398e46"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/TzzBoun5"}