#Data Flow
Below is a summary of the APIs you need to use to fetch FI data. These APIs are to be used only once your customer has approved consent request. The flow mainly involves data fetching against a valid data session with below APIs.
- Create Data Session—Call this API against an
APPROVEDconsent. This initiates data preparation at user's linked FIP accounts. You will be notified by Setu once the data is ready to be fetched. - Fetch FI data—Fetch decrypted FI data with data session id.

#Create new Data Session API
Call this API to create a data session against the approved consentId.
Request
Specify the format in which you wish to receive the decrypted financial data, this can be xml or json.
Make sure that values of DataRange array in the body, matches or is within the FIDataRange specified in the Create consent request API.
POST /sessions{"consentId": "d4f40bd9-a22f-4408-a622-4e8a1e4fbda6","DataRange": {"from": "2016-12-06T11:39:57.153Z","to": "2021-12-31T14:25:33.440Z"},"format": "json"}
Response
This initiates a data session with a id, that uniquely identifies this data request. Setu will also notify you when the FIP is ready to share the data you requested and you can use the id to fetch the data with the next API.
{"status": "PENDING","format": "json","Payload": null,"id": "378ec65c-f558-49fc-89ea-e880c2cf88b3","DataRange": {"from": "2021-04-01T00:00Z","to": "2021-09-30T00:00Z"},"consentId": "d4f40bd9-a22f-4408-a622-4e8a1e4fbda6"}
#Fetch FI data
The notification URL you have configured with Setu will be used to notify you when data is ready to be fetched. Then,use the id received in Create Data Session API in the previous step to call this API to fetch the financial information of your user.
Request
If you request for multiple FI types, you will receive all the FI data from end-user's linked accounts in an array.
GET /sessions/:id
Response
Response
The response comes with status:
COMPLETEDwhich signifies that FI data fetch is completed for the requested session.PARTIALwhich signifies that some FIP FI data fetches are completed and some have failed for the requested session.PENDINGwhich signifies that some FIP FI data fetches are completed and some are still pending for the requested session.
The payload contains Profile, Summary and Transactions as requested in Create consent request.
{"status": "COMPLETED","format": "json","Payload": [{"data": [{"decryptedFI": {"account": {"linkedAccRef": "b2329f47-0a6f-4131-adb5-9ef7b4c1ca6a","maskedAccNumber": "XXXXXX4373","type": "deposit","version": "1.1","profile": {"holders": {"type": "SINGLE","holder": {"address": "8/1190, 5th Cross, 3rd Main, 7th Block, Jayanagar, Bangalore - 560011","ckycCompliance": "true","dob": "1947-08-15","email": "mail@mail.com","landline": "","mobile": "8569884373","name": "Akshay Kumar","nominee": "REGISTERED","pan": "AAAAA0000A"}}},"summary": {"currentBalance": "101666.33","currency": "INR","branch": "Jayanagar 4th Block","balanceDateTime": "2020-06-22T07:50:00+00:00","currentODLimit": "0","drawingLimit": "0","exchgeRate": " ","facility": "OD","ifscCode": "ICIC0001124","micrCode": "500240246","openingDate": "2004-08-06","status": "ACTIVE","type": "SAVINGS","Pending": {"transactionType": "DEBIT","amount": "0"}},"transactions": {"startDate": "2021-04-01","endDate": "2021-09-30"}}},"linkRefNumber": "b2329f47-0a6f-4131-adb5-9ef7b4c1ca6a","maskedAccNumber": "XXXXXX4373"}],"fipID": "Setu-FIP"}],"id": "378ec65c-f558-49fc-89ea-e880c2cf88b3","DataRange": {"from": "2021-04-01T00:00Z","to": "2021-09-30T00:00Z"},"consentId": "d4f40bd9-a22f-4408-a622-4e8a1e4fbda6"}
Was this page helpful?
