/

to search

Introducing Setu Changelog Check it out ↗

#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"
}

If the request gives you a 502 BAD GATEWAY error, please retry the request. This is a known issue and will be solved


#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

The response comes with status: COMPLETED which signifies that FI data fetch is completed 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?